From a703a8fec0c5584e3b47933f7a75604e38abbd75 Mon Sep 17 00:00:00 2001 From: Pontus Lurcock Date: Wed, 3 Jun 2026 16:37:04 +0200 Subject: [PATCH] Add GH workflow for PyPI publication --- .github/workflows/publish-pypi.yaml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish-pypi.yaml diff --git a/.github/workflows/publish-pypi.yaml b/.github/workflows/publish-pypi.yaml new file mode 100644 index 0000000..b8ca314 --- /dev/null +++ b/.github/workflows/publish-pypi.yaml @@ -0,0 +1,33 @@ +name: publish-pypi + +on: + release: + types: [released] + workflow_dispatch: + +jobs: + publish-job: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v6.0.3 + - uses: mamba-org/setup-micromamba@v3 + with: + environment-file: environment.yml + init-shell: >- + bash + cache-environment: false + create-args: python-build twine + post-cleanup: 'all' + - name: Build packages + shell: bash -el {0} + run: | + python3 -m build + - name: Check build + shell: bash -el {0} + run: | + python3 -m twine check dist/* + - name: Upload to PyPI + shell: bash -el {0} + run: | + python3 -m twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*