ci: cut a GitHub release for every published version - #20
Merged
Merged
Conversation
The repo had no GitHub releases at all — publish.yml only ever pushed to npm, and the last tag is 0.2.0. Add a step after the npm publish that tags the release commit and creates the release, with that version's CHANGELOG.md section as the notes plus links to each published package. It runs only on the push that bumps the root version (compared with the first parent), so merging an unbumped PR never tags code that isn't on npm, and it skips a release that already exists, so re-runs are safe. A missing changelog section falls back to GitHub's generated notes with a warning rather than failing after npm already has the version. Tags stay bare semver, matching 0.2.0. The logic lives in scripts/github-release.ts (`--dry-run` prints the notes), alongside version.ts and publish.ts. The job now needs `contents: write`. 🌸 Shipped with Kanna — https://kanna.sh Co-Authored-By: Kanna <noreply@kanna.sh> Kanna-Agent: claude/opus[1m]
This branch had an error being deployed
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.
Why
The repo has no GitHub releases at all, and the last tag is
0.2.0.publish.ymlonly pushes to npm, so there's no tag for any published version and nowhere on GitHub to see what shipped. I cut 0.3.2 by hand; this makes the publish workflow do it from now on.What
After the npm publish step,
publish.ymlrunsscripts/github-release.ts, which:package.jsonversion as its tag. Tags stay bare semver (0.3.3) to match0.2.0and0.3.2. It targets the commit being published.CHANGELOG.mdas the notes, plus npm links for each published package. The format matches the 0.3.2 release.--latest, or--prereleasefor ax.y.z-betaversion.It is guarded in three ways:
mainwithout a bump, never tags code that isn't what's on npm.The job now needs
contents: write, and checkout usesfetch-depth: 2so the first parent is available. The script lives next toversion.tsandpublish.ts.--dry-runprints the notes without creating anything, and dispatching the workflow withdry_runpasses that flag through.Tested
mainat0ee074c, the 0.3.2 bump: prints the 0.3.2 notes and would create the release on that commit, marked latest. The output matches the release created by hand.ba54c2b, whose parent has the same version:Version unchanged (0.3.1) — no release to cut.main, where 0.3.2 already exists:Release 0.3.2 already exists — skipping.Nothing was created; the repo still has 1 release.Publishenvironment only deploys frommainand rejected the branch dispatch. The first real run will be the next version bump, e.g. fix: make SDK startup survive hostile environments #19 as 0.3.3.🌸 Shipped with Kanna — an open-source workspace for all your coding agents. Written by
claude/opus[1m].