ci: auto-create GitHub Release on tag push#5
Merged
Conversation
Agent-Id: agent-aa451ee5-71a4-4615-b875-078b204e672c
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.
Adds a
github-releasejob topython-publish.ymlso pushing a version tag (e.g.v26.5.22) creates the GitHub Release automatically — no more manual release creation through the UI.Why
The workflow already publishes to PyPI and TestPyPI on tag pushes, but the matching GitHub Release has been a manual step. Every existing release (v0.2.0 → v25.8.12) was hand-created.
What it does
New job runs only on tag pushes and only after
publish-to-pypisucceeds:gh release create "$GITHUB_REF_NAME" --generate-notes— uses GitHub's auto-generated release notes (the**Full Changelog**: compare/...style that matches your existing releases).gh release upload "$GITHUB_REF_NAME" dist/**— attaches the.whland.tar.gzto the release.Uses the default
GITHUB_TOKENwithpermissions: contents: write— no new secrets or PATs.What it does NOT do
Behavior on non-tag pushes
The new job has
if: startsWith(github.ref, 'refs/tags/'), matching the existing publish jobs, so it will appear as skipped (not failed) on every regular push tomain.Failure semantics
needs: publish-to-pypimeans if PyPI upload fails, no release is created. You can then fix the issue and retry the workflow cleanly without an orphaned GitHub Release.Verification
python -c "import yaml; yaml.safe_load(open('.github/workflows/python-publish.yml'))"— valid YAML, 4 jobs presentv26.5.22): the Release should appear at https://github.com/nextgenusfs/gapmm2/releases with the wheel and sdist attached.Single-file change, +34 / −0.
Pull Request opened by Augment Code with guidance from the PR author