Skip to content

ci: automate npm releases with release-please - #209

Merged
tvdeyen merged 2 commits into
mainfrom
chore/release-please-npm
Sep 1, 2026
Merged

tvdeyen merged 2 commits into
mainfrom
chore/release-please-npm

Conversation

@tvdeyen

@tvdeyen tvdeyen commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Stage 2 of the monorepo reorganization — the npm release automation. Stacked on #208 (the move); this PR's diff is only the release-please machinery. Retarget its base to main once #208 merges.

Adds release-please as a single, path-scoped component: it tags package-vX.Y.Z — continuing the existing package-v1.2.0 … package-v3.0.1 series, separate from the gem's vX.Y.Z — maintains javascript/CHANGELOG.md, and publishes to npm via OIDC trusted publishing (no stored token).

The manifest is seeded at the last published version 3.0.1, and a per-package release-as: "4.0.0" makes release-please's first release publish 4.0.0 (which is not on npm yet). The override is necessary because the breaking chore(npm)! commit predates the javascript/ move, so release-please's path-based commit analysis wouldn't attribute it to the package and compute 4.0.0 on its own.

Around merge

  • npm trusted publisher registered on npmjs (repo + release-please.yml).
  • Enable Settings → Actions → General → "Allow GitHub Actions to create and approve pull requests" (else release-please can't open its release PR).
  • After merge, confirm release-please opens a 4.0.0 release PR; merging it tags package-v4.0.0 and publishes 4.0.0.
  • Remove release-as from release-please-config.json after that PR merges — it does not self-clear, or it will keep forcing 4.0.0.
  • Update branch-protection required checks to the new job names (RSpec, Standard, Build, Vitest, Prettier).

The npm package's last published version is 3.0.1; 4.0.0 is not yet on
npm. release-please owns versioning from here: the manifest is seeded at
3.0.1 (and package.json set back to it), and a per-package `release-as`
override drives the first release to 4.0.0. The override is needed because
the breaking commit predates the javascript/ move, so release-please's
path-based commit analysis wouldn't attribute it to the package and compute
4.0.0 on its own. `release-as` does not clear itself and must be removed
once 4.0.0 ships.
On every push to main, release-please maintains a release PR; when a
release is created, a gated job publishes to npm via OIDC trusted
publishing so no long-lived token is stored. The per-package outputs are
keyed by the package path (`javascript--release_created`).
Base automatically changed from refactor/monorepo-package-separation to main September 1, 2026 10:21
@tvdeyen
tvdeyen marked this pull request as ready for review September 1, 2026 10:21
@tvdeyen
tvdeyen force-pushed the chore/release-please-npm branch 2 times, most recently from 8977b3a to 9013474 Compare September 1, 2026 10:29
@tvdeyen
tvdeyen merged commit 342a851 into main Sep 1, 2026
12 checks passed
@tvdeyen
tvdeyen deleted the chore/release-please-npm branch September 1, 2026 11:01
tvdeyen added a commit that referenced this pull request Sep 1, 2026
Fixes the stuck first release. After #209 merged, release-please ran but
**skipped** — its path-scoped scan of `javascript/` found only
`refactor`/`docs`/`ci`/`build` commits since `package-v3.0.1` ("No user
facing commits found - skipping"), and the config `release-as` set the
version but didn't override that skip.

This forces the first release with a `Release-As: 4.0.0` footer on a
commit that touches `javascript/` (so it's attributed to the package),
which release-please honours by opening a release PR for that exact
version. It also seeds `javascript/CHANGELOG.md` and drops the
now-redundant config `release-as` (the footer is one-time and needs no
later cleanup).

⚠️ **Merge so the `Release-As: 4.0.0` line stays in the commit message
on `main`** — release-please reads it from the merged commit. A merge
commit preserves it verbatim; a squash merge keeps it as long as the
footer remains in the squash commit body (it's there by default for this
single-commit PR — just don't strip it).

After this merges, release-please should open a `4.0.0` release PR;
merging that tags `package-v4.0.0` and publishes `4.0.0` via OIDC.
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