Repository navigation
ci: Tag every merge to main, publish on GitHub release - #3
Merged
Merged
Conversation
Merging a pull request to main tags the merge commit with the next version (patch by default; minor-version or major-version labels bump more) and starts Publish on that tag, which publishes to PyPI and creates the GitHub release. The first tag is v1.0.0. The version now comes from the tag through setuptools-scm, so pyproject.toml no longer holds one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tag only tags the merge commit. Publishing a GitHub release on a v* tag starts Publish, which publishes to PyPI and attaches the wheel and sdist to that release. Pushing a tag no longer publishes, and running Publish by hand on a tag no longer reaches PyPI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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
Every pull request merged to
maingets a version tag automatically. Publishing to PyPI starts when someone publishes a GitHub release on that tag.Tag (
.github/workflows/tag.yml, new; runs onpull_request_target: closed): tags the merge commit with the next version.minor-versionmajor-versionIf no
v*tag exists yet, it createsv1.0.0. Tagging alone publishes nothing.Publish (
publish.yml; runs onrelease: published): when a user publishes a GitHub release on av*tag, it builds that tag, publishes to PyPI, and attaches the wheel and the sdist to the release. Running it by hand on a branch still publishes a.devNversion to TestPyPI. Pushing a tag no longer publishes, and PyPI is reached only from a release event.Details
dynamic = ["version"],local_scheme = "no-local-version").pyproject.tomlno longer holds a version, so no "bump" commit tomainis needed. Publish checks that the built version matches the tag.concurrency. A merge commit that is already tagged is refused.fetch-depth: 0is now set on the checkouts inci.ymlandpublish.yml, so setuptools-scm can see the tags.publish.yml.Needed before merging
release tagsruleset must not have "Restrict creations":GITHUB_TOKENcan't be a ruleset bypass actor (422: "must be part of the ruleset source or owner organization"). Moving and deletingv*tags stays admin-only, and a tag alone publishes nothing.mfiles-grpc: ownerM-Files, repositorymfiles-grpc-python, workflowpublish.yml, no environment.Tested locally
mfiles_grpc-0.1.dev5. With av1.0.0tag it givesmfiles_grpc-1.0.0, and the wheel holds no.proto.v1.9.9againstv1.10.0(compared as numbers);🤖 Generated with Claude Code