Skip to content

Commit df16d98

Browse files
committed
fix: set npmrc auth token explicitly instead of relying on setup-node
1 parent 415e740 commit df16d98

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: '20.x'
21-
registry-url: 'https://registry.npmjs.org'
2221
cache: npm
2322

2423
- run: npm ci
@@ -29,23 +28,13 @@ jobs:
2928
- name: Unit tests
3029
run: npx jest --testPathPatterns=spec
3130

32-
- name: Check npm auth
33-
run: npm whoami
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
3731
- name: Publish to npm
38-
id: publish
39-
run: npm publish --ignore-scripts 2>&1 | tee /tmp/npm-publish.log; exit ${PIPESTATUS[0]}
32+
run: |
33+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
34+
npm whoami
35+
npm publish --ignore-scripts
4036
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42-
43-
- name: Upload publish log
44-
if: always()
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: npm-publish-log
48-
path: /tmp/npm-publish.log
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4938

5039
- name: Create GitHub Release
5140
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)