Phuc Buiv0.1.0

N-006

Publishing npm Packages on Release

28 Apr 2026 · npm, github-actions

This note as an agent skill: publish-npm in phucbm/skills.

Shell
npx skills@latest add phucbm/skills --skill publish-npm

I publish a package by making a GitHub release. publish-npm-action does the rest: installs, runs the tests if there are any, sets the version from the tag (v1.2.3 becomes 1.2.3), builds, commits package.json and dist/ back to main, and publishes. Since npm's trusted publishing went live in July 2025, the repo doesn't hold an npm token at all: the job gets a short-lived one through OIDC, and the package gets provenance for free. I wrote the action in June 2025.

What broke

npm tokenOIDC
Secret in the repoNPM_TOKENnone
Provenancenoyes
Setup on npmjs.comcreate a tokenadd the repo as a trusted publisher