Add a GitHub Release step to the release workflow - #7
Merged
Dreamsorcerer merged 2 commits intoJun 22, 2026
Merged
Conversation
Extend the tag-triggered publish job to create a GitHub Release alongside the PyPI upload, mirroring aiohttp's deploy job: grant contents: write, check out the repo, guard against a pre-existing release so a re-run after a partial failure does not fail with HTTP 422, and create the release with aio-libs/create-release -- using the version's CHANGES.rst notes and attaching the built distributions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 171 171
Branches 38 38
=========================================
Hits 171 171
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 do these changes do?
On a
v*tag push, thepublish-pypijob now creates a GitHub Release in addition to publishing to PyPI, mirroring aiohttp'sdeployjob:contents: write, check out the repo, and guard against a pre-existing release so a re-run after a partial failure doesn't fail with HTTP 422;aio-libs/create-release@v1.6.6— the version'sCHANGES.rstnotes plus the built sdist + wheel;sigstore/gh-action-sigstore-python) and upload the signatures to the release (softprops/action-gh-release).The existing PyPI Trusted-Publishing step is unchanged.
Before the first release (process, not changed here)
create-releasereads the version from__version__and the notes from the matchingCHANGES.rstsection. So before tagging: runtowncrierto build the version's section (currently only the header + thetowncrier release notes startmarker), and make sure__version__matches the tag. Heads-up: there is av0.0.1tag with no Release while__version__is0.1.0— reconcile (or remove the tag) before the first real release.Testing
Only runs on a real
v*tag, so the PR's own CI can't exercise it; validated statically (the workflow YAML parses, the job graph stayslint+test→check→build→ publish, andCHANGES.rst/__version__are present forcreate-release). The idempotency guard makes re-runs after a partial failure safe.Drafted with Claude Code (Opus 4.8); reviewed by @rodrigobnogueira.