Releasing
How a version of @bloxwap/sfx reaches npm.
Releases publish with provenance from the publish job on GitHub-hosted
ubuntu-24.04, the sole permanent exception to the Mac-mini runner policy.
npm trusted publishing requires GitHub-hosted runners.
The job uses Node 24, pinned npm 11.6.1, OIDC, and the npm-release environment.
npm tries OIDC first and falls back to NODE_AUTH_TOKEN from the org-level
NPM_TOKEN secret while the npm Trusted Publisher is being configured.
--provenance attaches provenance even during this token fallback.
Flow
- Open a PR that bumps
versioninpackages/sfx/package.jsonand updatespackages/sfx/CHANGELOG.md. - Merge it after the Tests, Documentation, and Security checks pass.
- Create a GitHub release tagged
v<version>, for examplev0.6.0. - The Publish to npm workflow checks that the tag matches the package version, waits for
npm-releaseapproval, verifies the fallback token when present (otherwise defers OIDC authentication to npm), runs the full test suite (prepublishOnly), and publishes.
Pre-release versions (0.2.0-beta.1) publish under the matching dist-tag (beta, alpha, rc) instead of latest.
One-time setup
- Configure the GitHub
npm-releaseenvironment with required reviewers. The YAML environment name alone does not create an approval gate. - Keep the bloxwap org
NPM_TOKENsecret (granular, publish rights for@bloxwappackages) available as a transitional fallback so releases continue before npm setup. - Configure the npm Trusted Publisher for
@bloxwap/sfx: organization bloxwap, repository sfx, workflow filename publish_npm.yml, environment npm-release, allowing directnpm publish. - Verify a trusted publish succeeds, then delete
NPM_TOKENand its workflow references. The auth check accepts OIDC without a token; registry commands such aswhoamistill require a token. - In the repository settings, set GitHub Pages to deploy from GitHub Actions.
- Protect
main, and require the Tests check. - Keep at least one self-hosted Apple Silicon runner online with the labels and tools in
docs/ci-runners.md. The security scan, Pages deploy, and coverage upload still run there; npm publish builds and tests on Ubuntu.