Skip to content

Commit 10701c4

Browse files
committed
fix: provide auth tokens for napi prepublish
1 parent 75ce2ce commit 10701c4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,20 @@ jobs:
160160
npm config set provenance true
161161
if [[ "${{ github.ref }}" == *"-beta"* ]]; then
162162
echo "Publishing beta release..."
163+
npx napi prepublish -t npm --tag beta
163164
npm publish --access public --tag beta
164165
elif [[ "${{ github.ref }}" == *"-alpha"* ]]; then
165166
echo "Publishing alpha release..."
167+
npx napi prepublish -t npm --tag alpha
166168
npm publish --access public --tag alpha
167169
else
168170
echo "Publishing stable release..."
171+
npx napi prepublish -t npm
169172
npm publish --access public
170173
fi
171174
env:
172175
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
176+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173177

174178
- name: Create GitHub Release
175179
uses: softprops/action-gh-release@v1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"build:ts": "tsc -p tsconfig.build.json",
8484
"build:native": "napi build --platform --release",
8585
"clean": "rm -rf js/*.js js/*.mjs js/*.d.ts js/*.map",
86-
"prepublishOnly": "npm run clean && npm run build && napi prepublish -t npm",
86+
"prepublishOnly": "npm run clean && npm run build",
8787
"lint": "npm run lint:ts && npm run lint:rust",
8888
"lint:ts": "eslint 'js/**/*.ts' 'tests/**/*.ts' 'benches/**/*.ts'",
8989
"lint:rust": "cargo clippy -- -D warnings",

0 commit comments

Comments
 (0)