Fix npm publish auth in CI workflow

Write .npmrc with auth token before publishing — NODE_AUTH_TOKEN alone
is not picked up by npm without a registry-scoped config entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-24 00:09:07 +00:00
parent ee6516be88
commit 9764e96ed6

View File

@@ -3,7 +3,7 @@ name: Publish to npm
on: on:
push: push:
tags: tags:
- "v*" - 'v*'
jobs: jobs:
publish: publish:
@@ -17,6 +17,8 @@ jobs:
- run: bun install - run: bun install
- run: npm publish - run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish