Skip to content

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

  • CI workflow runs on pull requests and pushes to main
  • Publish to npm workflow runs on tags matching v*
  • Deploy docs workflow publishes the VitePress site to GitHub Pages on pushes to main

Both CI and publish workflows run:

  1. pnpm install --frozen-lockfile
  2. pnpm typecheck
  3. pnpm test
  4. pnpm 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.0

v1.0.0 — Use the automated script:

bash
pnpm release:prepare -- 1.0.0

This command:

  • validates typecheck/tests/build
  • updates package.json and package-lock.json to 1.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-push

Documentation site

Build locally:

bash
pnpm docs:dev      # development server
pnpm docs:build    # production build
pnpm docs:preview  # preview production build

Live 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-circuit

the package exists on npm (maintainer: jigonzalez930209), but the NPM_TOKEN secret is invalid, expired, or belongs to a different account.

Fix:

  1. Log in to npmjs.com as jigonzalez930209
  2. Create a new Granular Access Token (or classic token) with Read and Write publish permission for velo-circuit
  3. Update the GitHub secret: repo Settings → Secrets and variables → Actions → NPM_TOKEN
  4. 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