Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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]

Expand Down Expand Up @@ -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
Expand Down
Loading