Skip to content

Commit 95794e0

Browse files
authored
Publish to npm via OIDC trusted publishing (#148)
1 parent b233a7a commit 95794e0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ jobs:
2121
- name: Setup Node.js
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: '20'
24+
node-version: '22'
2525
cache: 'pnpm'
2626
registry-url: 'https://registry.npmjs.org'
2727

28+
# Trusted publishing (OIDC) needs npm >= 11.5.1; the version bundled with
29+
# Node does not satisfy this yet.
30+
- name: Update npm for trusted publishing
31+
run: npm install -g npm@latest
32+
2833
- name: Install dependencies
2934
run: pnpm install --frozen-lockfile
3035

3136
- name: Build package
3237
run: pnpm run build
3338

39+
# Authenticates via OIDC against the npm trusted publisher configured for
40+
# this repo + workflow — no NPM_TOKEN needed. Provenance is automatic.
3441
- name: Publish to npm
35-
run: pnpm publish --access public --no-git-checks
36-
env:
37-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
42+
run: npm publish --access public

0 commit comments

Comments
 (0)