Auto-release on version bump merged to main#75
Merged
Conversation
Extend the release workflow so merging a version bump to main triggers a PyPI release automatically, while still supporting manual v* tag pushes. - Trigger on push to main (in addition to v* tags) - check job: release only when no tag exists for the current pyproject version (main push) or when a pushed tag matches it (manual) - After publishing from a main push, create and push the v<version> tag This closes the gap where bumping the version and merging did nothing because no tag was ever pushed. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Extends
.github/workflows/release.ymlso that merging a version bump intomainautomatically publishes to PyPI — closing the gap that caused the recent missed0.3.0release (a bump was merged, but nov*tag was ever pushed, so nothing fired).How it works
The workflow now triggers on push to
mainand onv*tags:checkjob decides whether to release:v<version>tag exists yet for the currentpyproject.tomlversion (idempotent — re-running on main does nothing).pyproject.toml(preserves the existing manual-release path).should_release == true, using the existing PyPI trusted-publishing setup (samerelease.ymlfilename,pypienvironment, OIDC).tagjob (main-push path only) creates and pushesv<version>after a successful publish, so tags and releases stay in sync.Notes
release.ymlon purpose: PyPI trusted publishing is bound to the workflow filename, so a new file would have its uploads rejected.0.3.0— thev0.3.0tag already exists, so thecheckjob short-circuits.🤖 Generated with Claude Code