- Use the public GitHub repository
BeatAPI/beatapi-cli. - Log in to npm with the BeatAPI publishing account.
- Publish or reserve both package names:
beatapi-clientandbeatapi. - In GitHub, create an environment named
npm. - Add the publishing owner as a required reviewer for the
npmenvironment and allow release tags matchingv*. - On npmjs.com, configure a GitHub Actions Trusted Publisher separately for
beatapi-clientandbeatapiwith these exact values:- organization:
BeatAPI; - repository:
beatapi-cli; - workflow filename:
release.yml; - environment:
npm; - allowed action:
npm publish.
- organization:
The release workflow uses npm Trusted Publishing over OIDC. It intentionally
does not store or reference a long-lived NPM_TOKEN. GitHub grants the workflow
a short-lived identity for each approved release, and npm automatically records
provenance for public packages published from the public repository.
The package names were unregistered when this repository was prepared. npm names are first-come, first-served, so reserve them before announcing the release.
- Synchronize and review the public OpenAPI snapshot.
- Run
npm run verifyfrom a clean checkout. - Confirm
npm audit --omit=devreports no known runtime vulnerabilities. - Update
CHANGELOG.mdand both package versions together. - Commit and push the release branch.
- Merge to
mainonly after CI passes. - Create a GitHub release tagged
vX.Y.Z. - Approve the protected
npmenvironment deployment. The workflow checks each exact package version before publishing, so it is safe to rerun after one package succeeds and the other fails. - Confirm both npm package pages and install the CLI in a clean temporary directory.
- Run
beatapi --version,beatapi --help, and an authenticatedbeatapi auth statussmoke test.
The workflow installs the current npm CLI on Node.js 24 because Trusted
Publishing requires npm 11.5.1 or newer and Node.js 22.14.0 or newer. Do not add
an NPM_TOKEN fallback: a missing OIDC trust relationship should fail closed
instead of silently using a persistent credential.
npm package versions are immutable. If a release is defective:
- Deprecate the affected version with a clear message.
- Publish a corrected patch release.
- Mark the GitHub release as superseded and link to the patch.
- Revoke any credential that may have entered logs or artifacts.