CI: publish to PyPI only on a published GitHub Release - #10
Merged
Conversation
Previously upload_pypi fired on any 'v*' tag push. Uploading on a deliberate, gated GitHub Release is safer, and matches green-igen / green-mbtools. The workflow now listens for release:[published] and the upload_pypi condition checks github.event_name == 'release', keeping on: and if consistent (no build/PR change). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 222 222
=========================================
Hits 222 222 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CI/CD workflow so that publishing to PyPI happens only when a GitHub Release is published, instead of on any v* tag push. This reduces the chance of accidentally triggering a production publish via an incidental tag push.
Changes:
- Switch workflow trigger configuration from
on: [push, pull_request]to explicitpush,pull_request, andrelease: [published]. - Gate the
upload_pypijob to run only for thereleaseevent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- push: ignore v* tags. Publishing a release already builds via `release: published`; without this the release tag push would trigger a second, redundant build. - upload_pypi: gate on `github.event.action == 'published'` in addition to `event_name == 'release'`, so the job is self-contained and safe even if the release trigger types are broadened later. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change the
upload_pypitrigger from anyv*tag push to a published GitHub Release, matching green-igen and green-mbtools.on:now listens forrelease: [published](build on push/PR is unchanged).upload_pypifires ongithub.event_name == 'release', soon:and theifare consistent.Why
Uploading on any tag push is easy to trigger accidentally; publishing a GitHub Release is a deliberate, gated action. This also makes the release mechanism uniform across the three Green packages.
Note
CI-only change — no version bump (0.2.8 is already released). Takes effect on the next release: publish a Release (e.g.
gh release create v…) to build + upload.🤖 Generated with Claude Code