Skip to content

ci(release): auto-create GitHub Release from CHANGELOG on tag#167

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
ci/auto-github-release
Jun 15, 2026
Merged

ci(release): auto-create GitHub Release from CHANGELOG on tag#167
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
ci/auto-github-release

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Jun 15, 2026

Copy link
Copy Markdown
Member

What

Add a github-release job to .github/workflows/release.yml that, after the three images publish on a version-tag push, creates the GitHub Release — title = tag, body = the matching ## <tag> — <date> section of CHANGELOG.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

  • Runs only after build-push succeeds (a Release never points at a tag whose images failed).
  • Pre-release tags (-rc/-alpha/-beta) are marked pre-release and not "Latest".
  • Idempotent: updates the Release if it already exists (re-run safe).
  • Falls back to auto-generated notes (with a warning) if the CHANGELOG has no matching section.
  • Note: the job triggers only on tag push, so it is not exercised by this PR's CI.

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow to automatically create and manage GitHub Releases. Releases now include extracted changelog entries and appropriate prerelease flags based on version tags.

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>
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow gains a github-release job that runs after build-push. It checks for an existing release, extracts the relevant section from CHANGELOG.md using awk and sed, computes prerelease/latest flags from the tag suffix, then creates or updates the GitHub Release. A fallback to --generate-notes fires if no changelog section matches.

Changes

GitHub Release Job

Layer / File(s) Summary
github-release job: changelog extraction and release creation/update
.github/workflows/release.yml
Adds a workflow comment documenting the GitHub Release step and a new github-release job (lines 129–181) that checks for an existing release, parses the CHANGELOG.md section matching the pushed tag via awk/sed, determines prerelease/latest flags from tag suffix patterns (*-rc*, *-alpha*, *-beta*), and calls gh release edit or gh release create; falls back to --generate-notes if no matching changelog section is found.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A changelog was read, a release was made,
With awk and sed the notes were displayed.
Pre-release flags set by the tag's little tail,
gh release create — success without fail!
The rabbit hops on, new versions unveiled! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: automating GitHub Release creation from CHANGELOG on tag pushes, which aligns perfectly with the PR's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/auto-github-release

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9866305 and 880d9d5.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment on lines +129 to +150
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: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

@kvaps Andrei Kvapil (kvaps) merged commit d364a44 into main Jun 15, 2026
15 checks passed
@kvaps Andrei Kvapil (kvaps) deleted the ci/auto-github-release branch June 15, 2026 20:32
Andrei Kvapil (kvaps) added a commit that referenced this pull request Jun 17, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant