ci(release): auto-create GitHub Release from CHANGELOG on tag#167
Conversation
release.yml previously only built/pushed the ghcr images on a version tag; the GitHub Release object was created manually. Add a github-release job (needs: build-push) that extracts the matching CHANGELOG.md section and cuts the Release (pre-release + not-latest for -rc/-alpha/-beta tags, idempotent on re-run). Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
📝 WalkthroughWalkthroughThe release workflow gains a ChangesGitHub Release Job
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 129-150: The github-release job lacks a guard condition and will
attempt to process branch refs when manually dispatched, causing gh release
create to fail since it expects a version tag. Add an if condition to the
github-release job that gates execution to only refs matching the version tag
pattern refs/tags/v*, ensuring that manual workflow_dispatch runs targeting
branches do not trigger the release creation step.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8d23dab3-97ed-4857-9608-cdfe349bd72f
📒 Files selected for processing (1)
.github/workflows/release.yml
| github-release: | ||
| name: Create GitHub Release | ||
| # After all three images publish, cut the GitHub Release for the tag: | ||
| # title = the tag, body = the matching "## <tag> — <date>" section of | ||
| # CHANGELOG.md (the same content used for prior releases). Pre-release tags | ||
| # (vMAJOR.MINOR.PATCH-rc.N / -alpha / -beta) are marked pre-release and not | ||
| # "Latest". Idempotent: updates the release if it already exists (re-run). | ||
| needs: build-push | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Clone the code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Cut the GitHub Release from the CHANGELOG section | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| TAG: ${{ github.ref_name }} | ||
| run: | |
There was a problem hiding this comment.
Add an explicit tag-ref guard for workflow_dispatch runs.
github-release assumes github.ref_name is a version tag, but manual dispatch can target a branch; in that case gh release create ... --verify-tag fails. Gate the job to refs/tags/v* so manual misfires don’t break release runs.
Suggested patch
github-release:
name: Create GitHub Release
+ if: startsWith(github.ref, 'refs/tags/v')
# After all three images publish, cut the GitHub Release for the tag:
# title = the tag, body = the matching "## <tag> — <date>" section of📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| github-release: | |
| name: Create GitHub Release | |
| # After all three images publish, cut the GitHub Release for the tag: | |
| # title = the tag, body = the matching "## <tag> — <date>" section of | |
| # CHANGELOG.md (the same content used for prior releases). Pre-release tags | |
| # (vMAJOR.MINOR.PATCH-rc.N / -alpha / -beta) are marked pre-release and not | |
| # "Latest". Idempotent: updates the release if it already exists (re-run). | |
| needs: build-push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Clone the code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Cut the GitHub Release from the CHANGELOG section | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| github-release: | |
| name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| # After all three images publish, cut the GitHub Release for the tag: | |
| # title = the tag, body = the matching "## <tag> — <date>" section of | |
| # CHANGELOG.md (the same content used for prior releases). Pre-release tags | |
| # (vMAJOR.MINOR.PATCH-rc.N / -alpha / -beta) are marked pre-release and not | |
| # "Latest". Idempotent: updates the release if it already exists (re-run). | |
| needs: build-push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Clone the code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Cut the GitHub Release from the CHANGELOG section | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| run: | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 129 - 150, The github-release job
lacks a guard condition and will attempt to process branch refs when manually
dispatched, causing gh release create to fail since it expects a version tag.
Add an if condition to the github-release job that gates execution to only refs
matching the version tag pattern refs/tags/v*, ensuring that manual
workflow_dispatch runs targeting branches do not trigger the release creation
step.
BUG-048 concurrent late-vd fix (#164 converge) + resize-deadlock guard (#168), release-gate GO + completed 24h ZFS-thick burn-in. Also documents the #167 auto-release pipeline that now cuts the GitHub Release on tag. Signed-off-by: Andrei Kvapil <kvapss@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
What
Add a
github-releasejob to.github/workflows/release.ymlthat, after the three images publish on a version-tag push, creates the GitHub Release — title = tag, body = the matching## <tag> — <date>section ofCHANGELOG.md.Why
Pushing a
v*tag built and published the ghcr images but did not create the GitHub Release object, so that step was manual. This automates "cutting a release": push the tag → images publish → Release is cut from the CHANGELOG.Behaviour
build-pushsucceeds (a Release never points at a tag whose images failed).-rc/-alpha/-beta) are marked pre-release and not "Latest".Summary by CodeRabbit