Skip to content

Auto semver and release notes generation for releases#696

Merged
sami-alajrami merged 6 commits intomainfrom
auto-semver
Mar 11, 2026
Merged

Auto semver and release notes generation for releases#696
sami-alajrami merged 6 commits intomainfrom
auto-semver

Conversation

@sami-alajrami
Copy link
Contributor

@sami-alajrami sami-alajrami commented Mar 11, 2026

Summary

Adds AI-powered automatic semantic versioning and release notes generation to the CLI release process, using Claude to analyse the git diff and suggest the appropriate version bump and changelog.

What changed

New scripts:

  • bin/suggest-version-ai.sh — sends the git diff (since the last tag) to the Anthropic API (Claude Opus) and parses back a semver bump recommendation (major/minor/patch) plus a markdown changelog. Authenticates via ANTHROPIC_API_KEY env var or 1Password CLI (op). Caps diff at 50k chars. The prompt instructs Claude to only consider user-facing CLI changes (under cmd/ and internal/), ignoring docs, CI, tests, scripts, etc.
  • bin/release-interactive.sh — interactive post-suggestion flow: displays the suggested version and release notes, opens the user's editor for review/edits, then asks for confirmation before creating an annotated tag (with release notes as body) and pushing.

Makefile changes:

  • make release (no tag= argument) now runs the AI suggestion flow → interactive review → tag & push. Requires jq and either ANTHROPIC_API_KEY or 1Password CLI.
  • make release tag=vX.Y.Z remains as a direct fallback that skips the AI step. Now also embeds dist/release_notes.md into the tag body if the file exists.
  • New make suggest-version-ai target for running the suggestion step standalone.

CI workflow (release.yml):

  • Adds a step to extract the tag's annotated body and, if present, pass it to GoReleaser via --release-notes=dist/release_notes.md. This means AI-generated (or manually edited) release notes flow through to the GitHub Release page.

Documentation (release-guide.md):

  • Updated to document both the new interactive (default) flow and the explicit-tag fallback, including prerequisites (1Password CLI, jq).

@sami-alajrami sami-alajrami requested a review from Copilot March 11, 2026 14:00
Copy link
Contributor

Copilot AI left a comment

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 introduces an interactive release flow that uses an AI-generated semver suggestion and draft release notes, then carries the final release notes through the annotated git tag body into the GitHub Release (via GoReleaser).

Changes:

  • Add make release default interactive flow (AI suggestion → optional edit → confirm → tag & push), plus a non-interactive fallback using an explicit tag.
  • Add scripts to generate suggested version + release notes from git diff and to drive the interactive confirmation/edit step.
  • Update the release GitHub Actions workflow to extract release notes from the tag body and pass them to GoReleaser.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
release-guide.md Documents the new interactive and fallback release flows.
bin/suggest-version-ai.sh Generates bump + next version + release notes using Claude from a diff.
bin/release-interactive.sh Interactive confirmation/edit step before tagging and pushing.
Makefile Adds suggest-version-ai target and updates release to support interactive + fallback flows.
.github/workflows/release.yml Pulls release notes from tag body and passes them to GoReleaser.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sami-alajrami sami-alajrami enabled auto-merge (squash) March 11, 2026 14:58
@sami-alajrami sami-alajrami merged commit 84778c7 into main Mar 11, 2026
10 checks passed
@sami-alajrami sami-alajrami deleted the auto-semver branch March 11, 2026 16:51
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