Skip to content

Publish reviewed NodeBB tags through GitHub-hosted npm OIDC - #1

Merged
forumfortress merged 4 commits into
mainfrom
release/npm-oidc-on-tags-20261011
Oct 11, 2026
Merged

forumfortress merged 4 commits into
mainfrom
release/npm-oidc-on-tags-20261011

Conversation

@forumfortress

Copy link
Copy Markdown
Contributor

Why

The public NodeBB package currently publishes as part of the protected private monorepo full_release path, together with other platforms. Give NodeBB its own small npm release job that uses GitHub-hosted compute and npm trusted publishing (OIDC) instead of placing an npm credential in GitHub Actions or consuming the local CI dispatcher.

Changes

  • Add a tag-only .github/workflows/publish-npm.yml, pinned official Actions, hosted Ubuntu 24.04 / Node 24, no dependency cache, no uploaded build artifacts, no arbitrary workflow dispatch.
  • Require an annotated semver tag matching package.json, reachable from public main and having the exact repository identity.
  • Run npm ci --ignore-scripts, NodeBB lint, check/tests and a dry-run package build.
  • For a missing npm version, publish with OIDC npm publish --provenance (GitHub permissions restricted to contents:read and id-token:write).
  • For a previously published version, compare tarball member content with the tagged source; mismatches fail closed rather than attempting to overwrite npm.
  • Verify published npm registry tarball contents after a successful publish, including retries for registry propagation.
  • Document the one-time npm trusted-publisher configuration.

The package itself and existing NodeBB runtime requirements remain unchanged (current 1.0.1, Node 22+). No existing tag is touched and this workflow does not publish until a later reviewed release tag is created.

Rollout dependency

After merging but before the next release, the package administrator must register this trusted publisher in npm: organisation Forum-Fortress, repository nodebb, workflow filename publish-npm.yml, environment blank, and grant npm publish permission. Fresh npm trusted publisher configurations expire unless validated within two days, so perform that setting near the first new release.

Keep the existing Control-held npm token initially. After this OIDC workflow has successfully published a real release, update the private full_release path to stop independently republishing NodeBB and then retire the token.

No unreviewed PR code can publish: only an annotated tag of public main, pushed by the existing protected source publisher, triggers this job.

@forumfortress
forumfortress merged commit d13eb9c into main Oct 11, 2026
1 check passed
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