Skip to content

Commit 080fa8b

Browse files
committed
ci: enable trusted publishing for npm
1 parent 35b212a commit 080fa8b

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- develop
77
types: [closed]
88

9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: write
12+
913
env:
1014
NODE_VERSION: 24.x
1115

@@ -39,6 +43,10 @@ jobs:
3943
cache: "npm"
4044
cache-dependency-path: "**/package-lock.json"
4145

46+
# Ensure npm 11.5.1 or later is installed (for OIDC)
47+
- name: Update npm
48+
run: npm install -g npm@latest
49+
4250
- name: Install dependencies
4351
run: npm ci
4452

@@ -91,12 +99,8 @@ jobs:
9199

92100
- name: Publish SDK to NPM
93101
if: startsWith(github.head_ref, 'releases/sdk-v')
94-
run: |
95-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
96-
npm publish --access=public
97102
working-directory: ./build/sdk
98-
env:
99-
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
103+
run: npm publish --access=public
100104

101105
- name: Create pull request to main (App)
102106
if: startsWith(github.head_ref, 'releases/v')

0 commit comments

Comments
 (0)