Auto-release on merge to main#152
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
TingluoHuang
July 6, 2026 14:36
View session
TingluoHuang
approved these changes
Jul 6, 2026
fa9e55e to
d602542
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflow to automatically publish a GitHub release when commits are merged to main, while still allowing a manual version override via workflow_dispatch. It introduces version auto-incrementation based on the latest release tag and adds concurrency controls to avoid tag/release races on rapid merges.
Changes:
- Makes
releaseVersionoptional and computes the next patch version from the latest release tag when not provided. - Triggers the release step on
pushtomainin addition to manual dispatch, using the computed version output. - Adds workflow-level concurrency serialization for
mainand grants write permissions needed to create releases.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds auto-versioning + release-on-main-push, concurrency control, and required permissions for creating releases. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 4
- Review effort level: Low
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.
CI required a manual
workflow_dispatchwith an explicit version to cut a release. Now a push tomainpublishes a new release tagged with the next patch version after the current latest release.Changes to
.github/workflows/ci.ymlreleaseVersioninput is now optional — kept as a manual override for major/minor bumps.Determine next versionstep — uses the input when supplied; otherwise readsgh release view --json tagName, parsesvMAJOR.MINOR.PATCH, and increments patch. Defaults tov1.0.0(→ first auto-releasev1.0.1) when no release exists, and fails loudly on non-semver tags so a maintainer can fall back to the manual input.Releasestep now fires onworkflow_dispatchorpushtomain, using the computed version. Assets and--generate-notesunchanged.permissions: contents: writeadded to the job so the defaultGITHUB_TOKENcan create the tag/release.concurrencygroup keyed ongithub.refwithcancel-in-progress: falseto serialize rapid merges tomainand avoid tag races, while leaving per-PR builds independent.PR builds continue to run build + test only; no release is cut.