Skip to content

Commit b711458

Browse files
authored
Merge pull request #16 from devinslick/dev
Only upload to pypi when releases are created
2 parents 0668fe2 + ccfae3a commit b711458

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
name: Publish Python Package
22

3-
# Trigger on:
4-
# - pushes to main (publish to PyPI after merge)
5-
# - published GitHub Releases (publish to PyPI for versioned releases)
3+
# Trigger only on published GitHub Releases (tagged releases)
64
on:
7-
push:
8-
branches: [main]
95
release:
106
types: [published]
117

@@ -41,17 +37,11 @@ jobs:
4137
name: python-package-distributions
4238
path: dist/
4339

44-
# Publish from pushes to main OR when a Release is published -> Production PyPI
40+
# Publish only when a Release is published -> Production PyPI
4541
publish_pypi:
46-
name: Publish to PyPI (main branch or GitHub Release)
42+
name: Publish to PyPI (GitHub Release only)
4743
runs-on: ubuntu-latest
4844
needs: build_sdist_and_wheel
49-
# Run when:
50-
# - push to main branch, or
51-
# - release published event (keeps existing release-based behavior)
52-
if: |
53-
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
54-
(github.event_name == 'release' && github.event.action == 'published')
5545
environment: pypi
5646
permissions:
5747
id-token: write

0 commit comments

Comments
 (0)