From b65926811704befd97706189e42f02afe5341166 Mon Sep 17 00:00:00 2001 From: Sven Luethi Date: Sun, 23 Nov 2025 16:43:27 +0100 Subject: [PATCH] modified: .github/workflows/python-publish.yml Update flow --- .github/workflows/python-publish.yml | 39 +++++++--------------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 82f8dbd..0ce212d 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,16 +9,17 @@ name: Upload Python Package on: - release: - types: [published] + push: + branches: + - main permissions: contents: read jobs: - release-build: + build-release: + name: Build runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -30,7 +31,7 @@ jobs: run: | # NOTE: put your own distribution build steps here. python -m pip install build - python -m build + python -m build --wheel - name: Upload distributions uses: actions/upload-artifact@v4 @@ -39,32 +40,10 @@ jobs: path: dist/ pypi-publish: - runs-on: ubuntu-latest - needs: - - release-build + name: Upload + environment: pypi permissions: - # IMPORTANT: this permission is mandatory for trusted publishing id-token: write - - # Dedicated environments with protections for publishing are strongly recommended. - # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules - environment: - name: pypi - # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: - # url: https://pypi.org/p/YOURPROJECT - # - # ALTERNATIVE: if your GitHub Release name is the PyPI project version string - # ALTERNATIVE: exactly, uncomment the following line instead: - # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} - steps: - - name: Retrieve release distributions - uses: actions/download-artifact@v4 - with: - name: release-dists - path: dist/ - - - name: Publish release distributions to PyPI + - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist/