Skip to content

Commit 44e505d

Browse files
refactor: npm trusted publishing (OIDC) — tokenless CI publishing
- Node 22 + latest npm for trusted publishing support - id-token: write permission for OIDC - Remove NODE_AUTH_TOKEN (not needed with trusted publishing) - First publish of each package still needs manual token+OTP
1 parent b4be8d3 commit 44e505d

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- uses: actions/setup-node@v4
8080
with:
81-
node-version: 20
81+
node-version: 22
8282

8383
- uses: dtolnay/rust-toolchain@stable
8484
with:
@@ -174,9 +174,12 @@ jobs:
174174

175175
- uses: actions/setup-node@v4
176176
with:
177-
node-version: 20
177+
node-version: 22
178178
registry-url: https://registry.npmjs.org
179179

180+
- name: Ensure latest npm (for trusted publishing)
181+
run: npm install -g npm@latest
182+
180183
- name: Install @napi-rs/cli
181184
run: npm install -g @napi-rs/cli
182185

@@ -214,35 +217,25 @@ jobs:
214217
npm publish "$dir" --access public --provenance || echo "Skipping $(basename "$dir")"
215218
done
216219
working-directory: packages/codec
217-
env:
218-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
219220

220221
- name: Publish @srcmap/codec
221222
run: npm publish --access public --provenance --ignore-scripts
222223
working-directory: packages/codec
223-
env:
224-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
225224

226225
- name: Publish @srcmap/sourcemap platform packages
227226
run: |
228227
for dir in npm/*/; do
229228
npm publish "$dir" --access public --provenance || echo "Skipping $(basename "$dir")"
230229
done
231230
working-directory: packages/sourcemap
232-
env:
233-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
234231

235232
- name: Publish @srcmap/sourcemap
236233
run: npm publish --access public --provenance --ignore-scripts
237234
working-directory: packages/sourcemap
238-
env:
239-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
240235

241236
- name: Publish @srcmap/sourcemap-wasm
242237
run: npm publish --access public --provenance --ignore-scripts
243238
working-directory: packages/sourcemap-wasm
244-
env:
245-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
246239

247240
create-release:
248241
name: Create GitHub Release

0 commit comments

Comments
 (0)