Auto-create GitHub Release on tag push#5
Merged
Conversation
Tag-push currently uploads to PyPI but does not create a GitHub Release entry — when DCEBE first ships, the Releases page on github.com/mstorath/DCEBE will stay empty unless a Release object is created. This step does that automatically: it tries to extract the matching `## <version>` section from CHANGELOG.md, falls through to a tag-commits-link stub if no changelog yet (DCEBE's port is still in progress), and posts to GitHub Releases via softprops/action-gh-release@v2 with all build artifacts attached. Implementation: - `contents: write` permission added (required by the release action). `id-token: write` for OIDC stays. - `actions/checkout@v4` added so CHANGELOG.md is on disk if/when one exists in the repo. - An awk extractor; defensive fallback to a tag-commits link if no CHANGELOG.md or no matching heading. - `generate_release_notes: true` provides an auto-generated PR/commit summary on top — this carries the first DCEBE Release until a curated CHANGELOG.md lands. - Idempotent: updates an existing Release for the tag rather than erroring, so manual pre-creation never blocks a re-run. See devcontainer reports/12-auto-github-release-pattern.md for the shared pattern and the rationale.
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
When DCEBE first ships via a
v*tag push, the workflow uploads to PyPI but does not create a GitHub Release entry. This PR closes that gap: thepublishjob inrelease.ymlnow also creates a Release.DCEBE doesn't have a
CHANGELOG.mdyet (port is in progress). The extractor is defensive — it falls through to a tag-commits-link stub when no CHANGELOG is present, andgenerate_release_notes: trueon the release action provides an auto-generated PR/commit summary as the visible body. When a curated CHANGELOG.md lands later, the same workflow starts using it without modification.Identical pattern to:
How it works
In the existing
publishjob, after the PyPI upload:actions/checkout@v4puts the repo (incl.CHANGELOG.mdif present) on disk.## <ver>section verbatim — bracket-tolerant. IfCHANGELOG.mdis missing or no heading matches, falls back to a one-line link.softprops/action-gh-release@v2creates the Release with that as the body, attachesdist/*, and stacksgenerate_release_notes: trueon top.contents: writeadded to the publish job's permissions (required by the release action).id-token: writefor OIDC stays as-is.Idempotent: updates in place if a Release for the tag already exists.
Test plan
v*.*.*tag push that ships DCEBE.