Skip to content

Auto-release on merge to main#152

Merged
TingluoHuang merged 1 commit into
mainfrom
copilot/automatic-release-on-pr-merge
Jul 6, 2026
Merged

Auto-release on merge to main#152
TingluoHuang merged 1 commit into
mainfrom
copilot/automatic-release-on-pr-merge

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

CI required a manual workflow_dispatch with an explicit version to cut a release. Now a push to main publishes a new release tagged with the next patch version after the current latest release.

Changes to .github/workflows/ci.yml

  • releaseVersion input is now optional — kept as a manual override for major/minor bumps.
  • New Determine next version step — uses the input when supplied; otherwise reads gh release view --json tagName, parses vMAJOR.MINOR.PATCH, and increments patch. Defaults to v1.0.0 (→ first auto-release v1.0.1) when no release exists, and fails loudly on non-semver tags so a maintainer can fall back to the manual input.
  • Release step now fires on workflow_dispatch or push to main, using the computed version. Assets and --generate-notes unchanged.
  • permissions: contents: write added to the job so the default GITHUB_TOKEN can create the tag/release.
  • concurrency group keyed on github.ref with cancel-in-progress: false to serialize rapid merges to main and avoid tag races, while leaving per-PR builds independent.

PR builds continue to run build + test only; no release is cut.

@TingluoHuang TingluoHuang marked this pull request as ready for review July 6, 2026 14:38
@TingluoHuang TingluoHuang requested a review from a team as a code owner July 6, 2026 14:38
Copilot AI review requested due to automatic review settings July 6, 2026 14:38
@TingluoHuang TingluoHuang force-pushed the copilot/automatic-release-on-pr-merge branch from fa9e55e to d602542 Compare July 6, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 releaseVersion optional and computes the next patch version from the latest release tag when not provided.
  • Triggers the release step on push to main in addition to manual dispatch, using the computed version output.
  • Adds workflow-level concurrency serialization for main and 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

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
@TingluoHuang TingluoHuang merged commit 6fe8a8c into main Jul 6, 2026
4 checks passed
@TingluoHuang TingluoHuang deleted the copilot/automatic-release-on-pr-merge branch July 6, 2026 15:36
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.

3 participants