Skip to content

ci: manage releases with release-please - #36

Merged
priosshrsth merged 2 commits into
mainfrom
ci/release-please
Aug 19, 2026
Merged

ci: manage releases with release-please#36
priosshrsth merged 2 commits into
mainfrom
ci/release-please

Conversation

@priosshrsth

Copy link
Copy Markdown
Collaborator

Supersedes #35. You were right that a placeholder version in package.json is not how this is done — that was me working around the ruleset instead of using the flow the ruleset is designed for.

Every previous attempt hit the same wall: something has to decide the version, and doing it in CI meant either writing to a branch that requires PRs, signed commits and passing code scanning, or leaving the repo's version describing nothing. release-please is the standard answer for a single npm package in exactly this setup, and this repo is already a good fit — conventional commits throughout, and a history of manual chore: bump version to X PRs, which is the thing it automates.

How it works now: merge PRs as usual; release-please maintains an open chore(main): release x.y.z PR that bumps package.json, src/version.ts and CHANGELOG.md; merging that PR tags it, creates the GitHub Release, and triggers the publish job. Nothing is bumped or tagged by hand, and the merge goes through normal review so the rulesets are satisfied rather than bypassed.

Before this can run:

  • Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests" must be on, or release-please cannot open its PR. I could not read that setting via the API to check.
  • Delete the dangling tags — v3.0.0 (release was deleted, tag remains, pointing at current main), v0.0.6, and the typo v0.05. The manifest pins the current version at 0.0.5, so release-please will not be confused by the stray v1.0.x/v2.0.x tags, but they are still noise.

What to look at:

  • .release-please-manifest.json — bootstrapped to 0.0.5, matching npm's latest and the current package.json. This, not the git tags, is what release-please reads. Getting it wrong means the next release lands on the wrong number.
  • src/version.ts — the // x-release-please-version marker is what makes it bump alongside package.json. Removing that comment silently breaks the sync; tests/version.test.ts is what catches it.
  • .github/workflows/release.ymlpublish runs only on release_created, checks out the release tag rather than main, and keeps id-token: write scoped to that job.

Verified: bun run test (196 pass), vp check clean, workflow YAML and both JSON files parse. The release-please run itself is unverified until this lands on main.

🤖 Generated with Claude Code

Replaces the hand-rolled release workflow. The previous attempts all failed
on the same conflict: the version had to be decided somewhere, and every
option either required CI to write to a branch its rulesets protect, or left
package.json as a placeholder that no longer described the published package.

release-please resolves both. It opens a release PR that bumps package.json,
src/version.ts and CHANGELOG.md from the conventional commits on main. Merging
that PR goes through the normal review path, so the ruleset is satisfied and
the merge commit is signed by GitHub. release-please then tags it and creates
the GitHub Release, and the publish job builds from that tag.

The version in the repository is accurate again, and no tag or bump is created
by hand.
While the version is below 1.0.0, features bump the patch and breaking
changes bump the minor, matching how 0.0.2 through 0.0.5 were released —
0.0.5 itself carried a feat. Without this the next release would be 0.1.0.
@priosshrsth
priosshrsth merged commit b3bd4df into main Aug 19, 2026
5 checks passed
@priosshrsth
priosshrsth deleted the ci/release-please branch August 19, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant