Files
amq-adapter-python/.forgejo/workflows/publish-python.yaml
T
hurui200320 8d297e1e5b
Unit test coverage / pytest (push) Failing after 1m18s
CI for pypl publish / publish-lib (push) Failing after 1m19s
fix(General): fix broken pipeline
2025-03-27 21:21:12 +08:00

49 lines
1.5 KiB
YAML

name: "CI for pypl publish"
on:
push:
branches:
- master # publish release on master
- develop # publish snapshot on develop
- "feat/*" # test
workflow_dispatch:
# allow manual trigger
env:
DEBIAN_FRONTEND: noninteractive
TZ: UTC
jobs:
publish-lib:
runs-on: default
container:
image: ubuntu:24.04
steps:
# need to setup node and git
- run: |
apt-get update
apt-get install -y nodejs git libsqlite3-0
# check out code
- uses: actions/checkout@v4
- uses: https://github.com/actions/setup-python@v5
with:
python-version: '3.11'
# install dependencies
- run: pip install -e .[dev]
# run pytest
- run: pytest
# replace timestamp building dev version
- name: Add timestamp to version
if: github.head_ref != 'master'
run: |
sed -i -E "s/(version = \"[^\"]+)(-dev)DT\"/\1\2$(date -u +'%Y%m%d%H%M%S')\"/" pyproject.toml
cat pyproject.toml
- name: Build wheel
run: |
python -m build
# publish
- run: |
twine upload --repository-url https://git.cleverthis.com/api/packages/clevermicro/pypi \
--username $CI_REGISTRY_USER \
--password $CI_REGISTRY_PASSWORD \
dist/*
env:
CI_REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}