Conversation
Reviewer's GuideAdds a GitHub Actions workflow that runs the Zig build + test pipeline on version tags and, if successful, validates the tag against build.zig.zon, generates release notes, and creates a GitHub Release (with automatic prerelease detection). Flow diagram for release job validation and release creation logicflowchart TD
Start["Start release job"]
Checkout["Checkout repository (fetch-depth: 0)"]
ExtractTag["Extract TAG from GITHUB_REF (strip prefix refs/tags/v)"]
ReadZon["Read ZON_VERSION from build.zig.zon via grep"]
Compare{TAG == ZON_VERSION?}
ErrorEnd["Fail workflow with error\nTag vTAG does not match build.zig.zon version"]
PrevTag["Get PREVIOUS_TAG via git describe --tags --abbrev=0 HEAD^"]
HasPrev{PREVIOUS_TAG found?}
InitialBody["Set body = 'Initial release.'"]
BuildNotes["Build body from git log\nPREVIOUS_TAG..HEAD as '- message (sha)' list"]
CreateRelease["Create GitHub Release via softprops/action-gh-release@v2\n- generate_release_notes: true\n- body: steps.notes.outputs.body\n- draft: false\n- prerelease: contains(github.ref, '-')"]
End["Release job complete"]
Start --> Checkout --> ExtractTag --> ReadZon --> Compare
Compare -- No --> ErrorEnd
Compare -- Yes --> PrevTag --> HasPrev
HasPrev -- No --> InitialBody --> CreateRelease --> End
HasPrev -- Yes --> BuildNotes --> CreateRelease --> End
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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.
Hey - I've left some high level feedback:
- The
grep -oP '\.version\s*=\s*"\K[^"]+' build.zig.zonparsing is quite brittle and will break on minor formatting changes; consider using a more robust approach (e.g., a small Zig script or a less format-sensitive pattern) to extract the version. - In the
Create GitHub Releasestep you setgenerate_release_notes: truewhile also passing a custombody; since the custom body will override generated notes, consider removinggenerate_release_notesor dropping the manual notes generation for clarity. - The
git describe --tags --abbrev=0 HEAD^logic forPREVIOUS_TAGcan behave unexpectedly around merge commits or non-linear histories; you may want to base it on the latest tag reachable fromHEAD(e.g.,git describe --tags --abbrev=0 --always HEAD~1or a similar strategy) to make release notes generation more predictable.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `grep -oP '\.version\s*=\s*"\K[^"]+' build.zig.zon` parsing is quite brittle and will break on minor formatting changes; consider using a more robust approach (e.g., a small Zig script or a less format-sensitive pattern) to extract the version.
- In the `Create GitHub Release` step you set `generate_release_notes: true` while also passing a custom `body`; since the custom body will override generated notes, consider removing `generate_release_notes` or dropping the manual notes generation for clarity.
- The `git describe --tags --abbrev=0 HEAD^` logic for `PREVIOUS_TAG` can behave unexpectedly around merge commits or non-linear histories; you may want to base it on the latest tag reachable from `HEAD` (e.g., `git describe --tags --abbrev=0 --always HEAD~1` or a similar strategy) to make release notes generation more predictable.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Add GitHub Release workflow
Summary
Adds a GitHub Actions workflow that creates a GitHub Release whenever a version tag (
v*.*.*) is pushed. The workflow runs the full test suite before publishing and validates that the tag matches the version declared inbuild.zig.zon.What changed
.github/workflows/release.ymlv*.*.*tags — runs unit + integration tests, validates tag/version consistency, generates release notes, and creates a GitHub ReleaseMotivation
build.zig.zoncheck prevents accidental mismatches between the Git tag and the declared package version.v0.2.0-rc1) are automatically marked as pre-releases.Workflow overview
Summary by Sourcery
Build: