Add automatic release CI with patch version bumping and MSVC optimization#14
Add automatic release CI with patch version bumping and MSVC optimization#14supervoidcoder merged 10 commits intomainfrom
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a new GitHub Actions "Release Build" workflow that runs on merged PRs to main, detects C++ source changes, computes the next patch semantic version, builds with MSVC on Windows, generates release notes from commit messages, and creates a GitHub Release with the built executable. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GitHub as "GitHub (PR closed)"
participant Runner as "Windows Runner"
participant MSVC as "MSVC Toolchain"
participant Git as "Git (tags/commits)"
participant ReleaseAPI as "GitHub Release API"
rect rgba(200,200,255,0.5)
GitHub->>Runner: trigger workflow (PR merged to main)
end
Runner->>Git: checkout code
Runner->>Git: detect changed files (*.cpp, *.hpp, ...)
alt C++ files changed
Runner->>MSVC: setup MSVC toolchain
Git->>Runner: fetch latest tag
Runner->>Runner: compute next patch version
Runner->>Git: read latest commit message
Runner->>MSVC: build project (MSVC)
alt build succeeds
Runner->>ReleaseAPI: create release (version, notes, attach exe)
ReleaseAPI-->>GitHub: release created
else build fails
Runner-->>GitHub: fail workflow
end
else no C++ changes
Runner-->>GitHub: skip release (no artifacts)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (7)
✏️ Tip: You can disable this entire section by setting 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 |
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
|
@copilot by the way could you make it so it only releases the release if:
i make a new pr for every change I make to the c++ file anyways, but I don't want it releasing crap if i like freaking change the readme on main XD |
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
|
@copilot did you do what i said? look at my comment
and also just one teeny thing, could you remove the added stuff on the readme? just keep it as is |
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Done! The workflow now:
Commit: e74b1c4 |
|
@coderabbitai i think copilot actually did a good job on this lol |
|
✅ Actions performedReview triggered.
|
... Yes, all completed in commit e74b1c4: |
supervoidcoder
left a comment
There was a problem hiding this comment.
really good, but just a few nitpicks
…e, update release name Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/release.yml:
- Around line 12-16: Add a concurrency block to the build-and-release job to
serialize release workflow runs and avoid duplicate tag collisions: update the
job "build-and-release" to include a concurrency stanza (e.g., concurrency: {
group: 'release-${{ github.ref }}', cancel-in-progress: false }) so only one run
at a time performs the "Determine next version" and tag creation steps, ensuring
in-progress runs are not canceled but queued instead.
- Around line 22-47: The "Check if source files changed" step (id: check_files)
uses git diff with github.event.pull_request.base.sha and head.sha which may not
exist locally; update the workflow to ensure refs are fetched and use ref-based
diff: either set actions/checkout to fetch full history (set fetch-depth: 0 on
the actions/checkout step) so the SHAs are present, or change the git diff
invocation to compare refs (e.g., git diff origin/${{
github.event.pull_request.base.ref }}...HEAD) after ensuring origin is fetched;
make this change in the check_files step so the $changedFiles detection reliably
finds C/C++ source changes.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/release.yml
🔇 Additional comments (5)
.github/workflows/release.yml (5)
49-52: MSVC setup is cleanly gated.The toolchain setup only runs when
should_releaseis true, avoiding wasted setup on docs-only merges.
53-104: SemVer parsing + patch bumping looks solid.Numeric sorting avoids v0.1.10 ordering problems and the v0.0.0 fallback yields a clean first release at v0.0.1.
106-164: Release-notes formatting is robust.Conventional-commit parsing, body truncation, and multiline output handling are well-structured.
165-182: Build failure correctly blocks release.The non‑zero exit on compile failure plus
compile_successgating prevents publishing broken builds.
184-194: Release step wiring looks correct.Uses the computed tag, notes, and asset, and is gated by
compile_success.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
@copilot In @.github/workflows/release.yml around lines 12 - 16, Add a concurrency block In @.github/workflows/release.yml around lines 22 - 47, The "Check if source |
Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
Added concurrency block with The workflow already has Commit: a81a265 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai why did you put "other AI code review bots detected" |
|
Tip For best results, initiate chat on the files or code changes.
You're absolutely right—GitHub Copilot is a code generation assistant, not a code review bot. My detection system likely flagged the And no, I'm definitely not implying you're AI! 🤖❌ You're clearly the human maintainer making decisions and providing direction throughout this PR. The detection was purely about seeing another AI tool mentioned in the context, not about any of the human participants. I'll make sure to be more precise in distinguishing between code generation assistants and actual review bots in the future. Thanks for calling this out! 🐰💭 |
Implements automatic compilation and release when PRs are merged to main with patch-level version bumping (0.0.x, 0.1.x). Major/minor releases remain manual.
Workflow Implementation
Trigger Conditions
main(not on every push).cpp,.h,.hpp,.c,.cc,.cxx)Concurrency Control
Version Management
v[0-9]*.[0-9]*.[0-9]*Release Notes
Release Configuration
MSVC Compilation
Optimization flags:
/O2(max speed),/Ot(favor fast code),/GL(whole program optimization)Compilation is validated before release - if the build fails, no release is created.
Files Changed
.github/workflows/release.yml- Release automation workflowOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.