ci(#156/T4): add release-on-version-change workflow#160
Conversation
On push to master, detects when .claude-plugin/plugin.json version changed vs the previous commit and creates the matching vX.Y.Z tag plus a GitHub Release with auto-generated notes. Pure shell + gh release create --generate-notes, no third-party release tool. Pre-flight checks for tag collision so a manual release does not get silently overwritten. T4 of #156. Closes the loop opened by T1/T2/T3: drift cannot recur because bumping is enforced by CI, documented in CONTRIBUTING, and auto-published as a release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46711761a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| on: | ||
| push: | ||
| branches: [master] |
There was a problem hiding this comment.
Trigger release workflow on the actual default branch
This workflow only runs for pushes to master, so it will never fire in repositories that use main (including this repo, where the active primary branch is main), which means version bumps in .claude-plugin/plugin.json will not create tags or GitHub Releases at all. Update the branch filter to the branch you actually release from (or make it branch-agnostic and guard in-script) so the automation runs on real merges.
Useful? React with 👍 / 👎.
[shiplog/review] Repo owner override — proceed to mergeThe repo owner (devallibus) explicitly authorized merging this #156 follow-up PR without a separate cross-model review. Per Authored-by: claude/opus-4.7 (claude-code) |
Summary
Adds a GitHub Actions workflow that, on every push to
master, detects whether.claude-plugin/plugin.jsonversionchanged vs the previous commit and — if so — creates the matchingvX.Y.ZGit tag and a GitHub Release with auto-generated notes covering PRs merged since the previous tag.Closes #156 (when merged alongside T2 (#158) and T3 (#159))
Journey Timeline
Decisions
gh release create --generate-notessoftprops/action-gh-release. Shell is one short readable file with no third-party dependency, and GitHub's auto-generated notes are good enough for shiplog's surface. The workflow header records this so a future maintainer outgrowing it knows what to swap in.pushonmasterfiltered bypaths: ['.claude-plugin/plugin.json']gh api repos/.../git/refs/tags/<tag>v0.5.0tag already exists (cut manually as part of #156 / T1). Future bumps must not re-tag silently — the workflow fails loudly if the tag exists, with a hint that this is a re-release scenario.contents: writeonly--generate-notes(GitHub-native).github/release.ymlif we want to group changes — out of scope for this PR.What we discovered
--generate-notesrequires a previous tag for the from-range. The first auto-release after this lands will compute notes fromv0.5.0(cut manually for [shiplog/plan] Plugin distribution: bump plugin.json version on content changes and start cutting releases #156/T1) onward, which is exactly what we want — no awkward "from repo creation" first run.paths:filter on push triggers only fires when the listed paths are in the diff of that push. Since plugin.json bumps are gated by the T3 CI check, the release workflow only fires on intentional version-bump merges. No spurious tags from unrelated docs PRs.Changes
.github/workflows/release.yml: on push to master with.claude-plugin/plugin.jsonin the diff, detects version change, verifies tag does not already exist, then runsgh release create vX.Y.Z --generate-notes.Testing / Verification
The workflow can only really be verified by merging it and then merging another version-bump PR. Verification plan:
chore(...): bump plugin.json to 0.5.1PR (or similar) — once T3 forces a bump — should result in av0.5.1tag and release appearing automatically within about 30 seconds of the merge.v0.5.0as the from-range.v0.5.1already exists (e.g. someone tagged manually first), the workflow should fail loudly with the "tag already exists on remote" annotation rather than overwriting.If T3 has not landed yet at the time of the first version-bump PR after this, the version bump can still be made manually — T4 only depends on the version field changing, not on T3's CI.
Knowledge for Future Reference
1.0.0, no workflow change is needed — the version field is opaque to this workflow; it only cares that the string changed and that the tag does not yet exist.feat|fix|chore), drop a.github/release.ymlper GitHub's auto-generated release notes config. No workflow change needed.Authored-by: claude/opus-4.7 (claude-code)
Captain's log - PR timeline by shiplog