ci: auto-bump version and release from Conventional Commits - #7
Merged
Conversation
…n main Every push to main is now scanned for Conventional Commit types since the last tag (fix -> patch, feat -> minor, `!`/BREAKING CHANGE -> major; any other type skips the bump entirely). When a bump is due, version-bump.yml writes the new version into package.json, package-lock.json, src-tauri/Cargo.toml, src-tauri/Cargo.lock and src-tauri/tauri.conf.json — the same 4 files the manual convention already touched — commits it, tags vX.Y.Z, and dispatches release.yml (added workflow_dispatch: to its triggers, since a GITHUB_TOKEN-authored tag push doesn't fire the existing `push: tags:` trigger on its own). Documented the required commit-type discipline in CLAUDE.md: a fix:/feat: commit landing on main is no longer just a commit, it becomes a public, signed release with a winget PR — so picking the right type matters now in a way it didn't when bumping was a manual, deliberate step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PioEvgnoP4fpxDrSAYTBdF
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.
Summary
.github/workflows/version-bump.yml: on every push tomain, scans commit subjects since the lastv*tag for Conventional Commit types (fix:→ patch,feat:→ minor,!/BREAKING CHANGE:→ major, anything else → no bump), writes the resulting version into the same 4 files the manual convention already touched (package.json,package-lock.json,src-tauri/Cargo.toml,src-tauri/Cargo.lock,src-tauri/tauri.conf.json), commits aschore: bump version to X.Y.Z, tagsvX.Y.Z, and dispatchesrelease.yml.workflow_dispatch:torelease.yml's triggers — required because aGITHUB_TOKEN-authored tag push does not fire its existingpush: tags:trigger, soversion-bump.ymlcallsgh workflow run release.yml --ref vX.Y.Zexplicitly instead.CLAUDE.mddocumenting the Conventional Commits requirement and its consequence: afix:/feat:commit onmainnow becomes a real, signed, public release (installers + winget PR) with no human confirmation step in between.Important: this was the "full automation" option, chosen explicitly
This turns every
fix:/feat:merge tomaininto an unattended public release — signed/notarized installers published to GitHub Releases, plus a winget-pkgs manifest PR. There is no manual gate between merge and release once this is onmain. Confirmed as the intended scope before implementing (the alternative — bump-and-commit only, tag/release left as a manual step — was the lower-blast-radius option).Things to verify/configure before merging
mainmust allow the Actions bot (GITHUB_TOKEN) to push directly (the bump commit + tag) — if "restrict who can push" or required status checks would block this, the push step will fail.GITHUB_TOKENpermissions for this repo must allowcontents: writeandactions: write(set explicitly in the workflow, but repo/org settings can still cap it below that).fix:-typed commit before relying on it — I validated the shell logic (bump-level detection, version arithmetic, theCargo.toml/tauri.conf.jsonversion substitutions) locally against sample data and real repo files, and confirmed the YAML structure by hand, but the workflow itself hasn't run in GitHub Actions yet.Test plan
Cargo.tomlandtauri.conf.jsonversion substitution tested against copies of the real files — correct, only the intended field changesnpm versiontested against copies of the realpackage.json/package-lock.json— correctfix:/feat:merge tomain🤖 Generated with Claude Code
https://claude.ai/code/session_01PioEvgnoP4fpxDrSAYTBdF