Publishing is automated; the account is not. This is the one-time setup, then the per-release steps.
@masterplaycoding must exist on npm and be yours, and it must allow public
packages.
npm login
npm org ls masterplaycoding # or create the scope at npmjs.comnpm's trusted publishing (OIDC) is the goal — no long-lived token at all — but it attaches to a package that already exists, so the first release has to be bootstrapped:
- Create a granular access token at npmjs.com, scoped to
@masterplaycoding/eventlabonly, with write permission and a short expiry. - Add it as the
NPM_TOKENsecret in anpm-publishenvironment (Settings → Environments → New environment), not as a plain repository secret. An environment can require your approval before the job runs and keeps the token out of every other workflow. - Publish
0.2.0. - Then configure the trusted publisher: npmjs.com → the package → Settings →
Trusted Publisher → GitHub Actions, repository
MasterplaYCoding/EventLab, workflowrelease.yml, environmentnpm-publish. - Delete the token and remove
NODE_AUTH_TOKENfromrelease.yml.
Provenance works either way — it comes from id-token: write and the
workflow's OIDC claims, not from how the publish authenticated.
-
Set the version in
packages/core/package.json. -
Add a
## [0.2.0] - YYYY-MM-DDsection toCHANGELOG.md. The release workflow refuses to publish without one. -
Verify locally, exactly as CI will:
npm run typecheck && npm test && npm run verify:packaged
-
Check what will actually ship —
filesis an allowlist, and it is easy to publish either too little or anode_modules:npm pack --dry-run --workspace @masterplaycoding/eventlab
-
Commit, tag and push:
git tag v0.2.0 && git push origin main v0.2.0 -
The
Releaseworkflow checks the tag against the package version and the changelog, runs typecheck, tests and the packaged-install verification, then publishes with provenance. -
Confirm it landed, and that the provenance badge shows on the package page:
npm view @masterplaycoding/eventlab
-
Bump
packages/core/package.jsonto the next version and commit.
Remove the "not published yet" note and the install-from-source block from
README.md, and change the roadmap row from in progress to released.
No publish from a branch. Only a v* tag triggers the workflow.
No version bumping in CI. The version is a decision, and a workflow that edits it can publish something nobody chose to publish.
Nothing skips verify:packaged. It is the only check that exercises the
artifact a user actually installs rather than the source tree.