Skip to content

fix(ci): add build step before publish + pass NPM_TOKEN as NODE_AUTH_TOKEN#49

Merged
sepehr-safari merged 1 commit into
mainfrom
fix/release-npm-token
Jul 8, 2026
Merged

fix(ci): add build step before publish + pass NPM_TOKEN as NODE_AUTH_TOKEN#49
sepehr-safari merged 1 commit into
mainfrom
fix/release-npm-token

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Fixes two issues in the release workflow that prevented npm publishing.

Root Causes

  1. Missing build step — The release workflow ran changeset publish without building first. The CLI's dist/index.js didn't exist, causing No bin file found at dist/index.js warning and the publish failed.

  2. NPM_TOKEN not reaching npm — The changesets action received NPM_TOKEN env var, but npm publish reads NODE_AUTH_TOKEN (set by actions/setup-node with registry-url). The NPM_TOKEN was empty in the logs, and even if set, npm wouldn't read it. Need to pass it as both NPM_TOKEN (for changesets detection) and NODE_AUTH_TOKEN (for npm auth).

Changes

  • Added pnpm build step before the changesets publish action
  • Added NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} to the changesets env

Important: Verify NPM_TOKEN Secret

The user should verify the NPM_TOKEN GitHub secret:

  1. Go to Settings → Secrets and variables → Actions
  2. Verify a secret named exactly NPM_TOKEN exists
  3. The token should be a publish token (not read-only) from npm
  4. The npm user must be a member of the @ocpp-debugkit org with publish permissions

…TOKEN

Two fixes for the release workflow:
1. Add 'pnpm build' step before changesets publish — dist/ must exist
   for npm publish (CLI bin was missing: 'No bin file found at dist/index.js')
2. Pass NPM_TOKEN as NODE_AUTH_TOKEN env var to the changesets action —
   npm reads NODE_AUTH_TOKEN for registry auth, not NPM_TOKEN
@sepehr-safari sepehr-safari added this to the v0.1.0 — Inspector MVP milestone Jul 8, 2026
@sepehr-safari sepehr-safari added type:chore Maintenance, tooling, or infrastructure package:repo Repository-level changes labels Jul 8, 2026
@sepehr-safari sepehr-safari merged commit 9de8ff5 into main Jul 8, 2026
1 check passed
@sepehr-safari sepehr-safari deleted the fix/release-npm-token branch July 8, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:repo Repository-level changes type:chore Maintenance, tooling, or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant