diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3a5f678..aa0f08c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,7 @@ name: Publish Python Package -# Trigger on: -# - pushes to main (publish to PyPI after merge) -# - published GitHub Releases (publish to PyPI for versioned releases) +# Trigger only on published GitHub Releases (tagged releases) on: - push: - branches: [main] release: types: [published] @@ -41,17 +37,11 @@ jobs: name: python-package-distributions path: dist/ - # Publish from pushes to main OR when a Release is published -> Production PyPI + # Publish only when a Release is published -> Production PyPI publish_pypi: - name: Publish to PyPI (main branch or GitHub Release) + name: Publish to PyPI (GitHub Release only) runs-on: ubuntu-latest needs: build_sdist_and_wheel - # Run when: - # - push to main branch, or - # - release published event (keeps existing release-based behavior) - if: | - (github.event_name == 'push' && github.ref == 'refs/heads/main') || - (github.event_name == 'release' && github.event.action == 'published') environment: pypi permissions: id-token: write