Release and Publish
This project publishes to npm using GitHub Actions when a semantic tag is pushed.
Requirements
- GitHub secret:
NPM_TOKEN - npm access token with publish permission over
velo-circuit - Node 22+ locally (Node 22/24 are validated in CI)
CI and Publish Flows
CIworkflow runs on pull requests and pushes tomainPublish to npmworkflow runs on tags matchingv*Deploy docsworkflow publishes the VitePress site to GitHub Pages on pushes tomain
Both CI and publish workflows run:
pnpm install --frozen-lockfilepnpm typecheckpnpm testpnpm build
Release sequence (0.4.0 → 1.0.0)
v0.4.0 — If package.json is already at 0.4.0, tag manually (the release script cannot bump to the same version):
bash
git tag v0.4.0
git push origin v0.4.0v1.0.0 — Use the automated script:
bash
pnpm release:prepare -- 1.0.0This command:
- validates typecheck/tests/build
- updates
package.jsonandpackage-lock.jsonto1.0.0 - creates commit
chore(release): v1.0.0 - creates tag
v1.0.0 - pushes branch and tag to GitHub
If you need to test the script without pushing:
bash
pnpm release:prepare -- 1.0.0 --no-pushDocumentation site
Build locally:
bash
pnpm docs:dev # development server
pnpm docs:build # production build
pnpm docs:preview # preview production buildLive site: jigonzalez930209.github.io/velo-circuit
Troubleshooting npm publish (E404)
If CI fails with:
text
npm error 404 Not Found - PUT https://registry.npmjs.org/velo-circuitthe package exists on npm (maintainer: jigonzalez930209), but the NPM_TOKEN secret is invalid, expired, or belongs to a different account.
Fix:
- Log in to npmjs.com as jigonzalez930209
- Create a new Granular Access Token (or classic token) with Read and Write publish permission for
velo-circuit - Update the GitHub secret: repo Settings → Secrets and variables → Actions → NPM_TOKEN
- Re-run the failed Publish to npm workflow from the Actions tab (or push the tag again)
The workflow now runs npm whoami before publish so auth failures show a clear error instead of a misleading 404.
Manual publish (if logged in locally as the package owner):
bash
pnpm build
npm publish --access public