Repository navigation
ci: release with release-please and Conventional Commits - #17
Merged
Merged
Conversation
release-please picks the next version and writes the changelog from commit types, so every commit that reaches main must have one. A CI job checks each commit of a pull request; a commit-msg hook in .githooks catches a bad message before it is pushed, since pushed commits are not rewritten. The check is a small script, not commitlint: it needs only the subject rules, and commitlint would add a tree of dependencies. Dependabot commits get the build(deps) and ci(deps) prefixes.
release-please keeps one release PR open with the next version and CHANGELOG.md, from the Conventional Commits on main. Merging it tags v<version> and creates the GitHub Release; a person still decides when to release. It runs as the first job of release.yml, not in its own workflow: a tag made with GITHUB_TOKEN starts no other workflow, and a PAT or a GitHub App would be a secret to keep. So the build, attest and publish jobs run in the same run when it reports a release. The publish job now adds its files to that release; a tag pushed by hand still creates one, as before. See ADR 31.
The five fixes merged since v0.1.0 predate Conventional Commits, so release-please does not count them. This footer makes it propose 0.1.1 for them. Release-As: 0.1.1
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
Commits follow Conventional Commits, and release-please makes the release PR (ADR 31).
sequenceDiagram participant Dev participant CI as ci.yml participant RP as release.yml: release-please participant Pub as release.yml: build, attest, publish Dev->>CI: PR CI->>CI: commits job: check-commits.ts base..head Dev->>RP: merge to main RP->>RP: open or update release PR (version + CHANGELOG.md) Dev->>RP: merge release PR RP->>Pub: release_created, tag v<version> Pub->>Pub: pnpm check, tarball, SBOMs, provenance Pub->>Pub: plugin branch, files + install notes on the release.githooks/commit-msg # opt in: git config core.hooksPath .githooks .github/ dependabot.yml # build(deps) / ci(deps) subjects workflows/ ci.yml # + commits job (pull requests only) release.yml # + release-please job; build runs on its release or a hand-pushed tag +release-please-config.json # node, tags v<version>, bump-minor-pre-major +.release-please-manifest.json # 0.1.0 scripts/ + check-commits.ts # <base>..<head> | --file <path> + lib/commit-message.ts # subject rules, no dependency workflows.test.ts # writers: release-please + publish jobs only docs/adr/0031-… # the decision; ADR 30 amended AGENTS.md # commit typesThe last commit is empty with
Release-As: 0.1.1: the five fixes since v0.1.0 predate the new style, so release-please would not count them. Merging this opens the 0.1.1 release PR; their notes get added to the release by hand.Evidence
node scripts/check-commits.ts v0.1.0..origin/main→5 of 5 commit message(s) do not follow Conventional Commits, exit 1.After:
node scripts/check-commits.ts origin/main..HEAD→3 commit message(s) follow Conventional Commits.scripts/lib/commit-message.test.ts: 15 cases (acceptsfeat(viewer): …,feat!: …,build(deps): …; rejects no type, bad scope, final period, > 72, no blank line, empty).scripts/workflows.test.tsfailed on the oldrelease.yml(norelease-pleasejob writing), passes now.pnpm checkgreen on each commit;actionlintclean on all workflows.Merge Danger
Door: two-way
Revert restores the tag-only release. A release already cut stays (tag, GitHub Release, plugin branch commit).
Blast Radius: releases
The release path is untested on GitHub until the first release PR merges. Failure modes are a release without files or install notes, or no build run; a hand-pushed tag still releases. CI does not run on the release PR (
GITHUB_TOKENstarts no workflow); the release build runspnpm checkfirst. PRs with old-style commit subjects now fail thecommitsjob.