Brigade publishes to npm as @spinabot/brigade
using an automated release-please
flow. You almost never run npm commands by hand.
-
Land work on
mainwith Conventional Commit messages:feat:/fix:/perf:/deps:/revert:→ counts toward a release.docs:/refactor:/test:/ci:/chore:→ no release.
-
release-please opens/updates a "Release PR" automatically (see
.github/workflows/release.yml). The PR bumpsversioninpackage.json, updatesCHANGELOG.md, and aggregates everything since the last release. -
Merge the Release PR when you want to ship. release-please then:
- creates a git tag (e.g.
v1.12.0) and a GitHub Release, and - triggers the
publish-npmjob, which runsnpm ci,npm run build,npm test, andnpm publish --access public(with--provenanceadded automatically when the repo is public — see below).
- creates a git tag (e.g.
That's it — the new version is live as npm i @spinabot/brigade.
The publish job needs credentials. Pick one:
- On npmjs.com, create an Automation access token (Account → Access Tokens →
Generate New Token → Automation) with publish rights to the
@spinabotscope. - Add it as a repo secret named
NPM_TOKEN, either:- CLI:
gh secret set NPM_TOKEN --repo spinabot/brigade(paste the token at the prompt — it is not echoed or logged), or - UI: Settings → Secrets and variables → Actions → New repository secret.
- CLI:
Provenance is published automatically once the repo is public, and skipped
while it is private — the publish step detects github.event.repository.private, so
no workflow edit is needed when you flip visibility.
- On npmjs.com, open the
@spinabot/brigadepackage settings (or the scope's settings before first publish) and add a trusted publisher pointing atspinabot/brigadewith workflowrelease.yml. - Remove the
NODE_AUTH_TOKENenv line from the publish step in.github/workflows/release.yml. The OIDCid-token: writepermission and a recent npm (the workflow upgrades npm) handle auth with no secret.
- Protect
main; require theCIworkflow to pass before merge. - (Optional) Add an
npm-releaseenvironment with required reviewers so a human approves each publish. The workflow already targets that environment.
If automation is unavailable, publish from a logged-in machine
(npm login, or an NPM_TOKEN in your environment):
npm ci
npm run build
npm test
npm publish --access publicDo not add
--provenancehere. Provenance can only be generated inside a supported CI run (GitHub Actions OIDC) on a public repo — the flag fails on a local machine. The release workflow attaches provenance for you.
To keep release-please's state consistent after a manual publish, bump version in
package.json, set the matching version in .release-please-manifest.json, and tag
the commit vX.Y.Z.