diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..5073a0a --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,32 @@ +name: Python Package CI/CD + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + publish: + name: Publish to PyPI + container: + image: node:20-bookworm + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + apt update + apt install -y python3 python3-venv + + - name: Publish to PyPI + run: | + python3 -m venv venv + . ./venv/bin/activate + pip install -U hatchling twine build + python -m build . + python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/* + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 9b63d58..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -image: python:3.10 - -stages: - - publish - -before_script: - - python -V - - python -m venv venv - - source venv/bin/activate - - pip install -U pip - - pip install . - -publish: - stage: publish - script: - - pip install -U hatchling twine build - - python -m build . - - python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/* - only: - - tags \ No newline at end of file