Skip to content

Commit f8c4644

Browse files
committed
ci: write npmrc manually, upgrade to npm latest for OIDC
1 parent 644e5da commit f8c4644

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '18'
26-
registry-url: 'https://registry.npmjs.org'
25+
node-version: '20'
26+
27+
- name: Upgrade npm
28+
run: npm install -g npm@latest
2729

2830
- name: Install dependencies
2931
run: yarn install --frozen-lockfile
@@ -46,7 +48,11 @@ jobs:
4648
4749
- name: Publish to npm
4850
if: steps.version_check.outputs.changed == 'true'
49-
run: npm publish --provenance --access public
51+
run: |
52+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
53+
npm publish --provenance --access public
54+
env:
55+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5056

5157
- name: Create GitHub release
5258
if: steps.version_check.outputs.changed == 'true'

0 commit comments

Comments
 (0)