Repository navigation
ci: publish a GitHub release when a version bump is merged - #69
Merged
Merged
Conversation
After Validate package succeeds for a push to main, read the version from both plugin manifests, and if no vX.Y.Z tag exists, tag that commit and publish a release whose notes are the version's CHANGELOG section. Merges that keep the version release nothing; a missing CHANGELOG section fails instead of publishing empty notes.
# Conflicts: # CHANGELOG.md
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
Releases are now published automatically when a version bump is merged. Until now, merging a release PR (e.g. #66) only changed files, and the tag and GitHub release had to be created by hand.
How it works
.github/workflows/release.yml:workflow_runof Validate package when it completes onmainfrom apush, and only when it succeeded. A release never points at a commit CI didn't pass. It can also be run manually (workflow_dispatch).workflow_run.head_sha).versionfrom.claude-plugin/plugin.jsonand.codex-plugin/plugin.json, and fails if they disagree.vX.Y.Zalready exists on the remote, it stops. An ordinary merge that leaves the version unchanged does nothing.## [X.Y.Z]section fromCHANGELOG.mdand fails if the section is missing or empty. It then runsgh release create vX.Y.Z --target <sha>with those notes plus a link to the tagged CHANGELOG.Permissions:
contents: readat the workflow level, andcontents: writeonly for the release job, usingGITHUB_TOKEN.Releasing is now: bump both manifests, move
[Unreleased]to## [X.Y.Z] - date, and merge.CONTRIBUTING.md's release checklist andCHANGELOG.md([Unreleased] → Added) describe this.Verification
actionlintisn't available locally.awk) run against the currentCHANGELOG.md:0.3.0yields its 393-line section, and a non-existent version yields nothing, which the workflow turns into a failure.python3 scripts/validate-package.py: VALID. Unit tests: OK.workflow_runworkflows only run from the default branch, so this can't fire before it is merged. After merging, the firstValidate packagerun onmainwill trigger it. Sincev0.3.0already exists, the expected result is "Tag v0.3.0 already exists; nothing to release."Note:
CHANGELOG.mdwill conflict trivially with #68, since both add under[Unreleased]. Whichever merges second needs both entries kept.