Skip to content

Commit bcdf438

Browse files
committed
feat(workflow): switch npmjs to OIDC auth
1 parent a061c89 commit bcdf438

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
permissions:
77
contents: write
8+
id-token: write
89

910
jobs:
1011
build:
@@ -291,10 +292,12 @@ jobs:
291292
node-version: '20'
292293
registry-url: 'https://registry.npmjs.org'
293294

295+
- name: update npm
296+
if: steps.tag.outputs.version != ''
297+
run: npm install -g [email protected]
298+
294299
- name: build and publish npm packages
295300
if: steps.tag.outputs.version != ''
296-
env:
297-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
298301
run: |
299302
cd packages/node
300303
@@ -328,17 +331,15 @@ jobs:
328331
platform_name=$(basename "$platform_dir")
329332
echo " Publishing @sqliteai/sqlite-js-${platform_name}..."
330333
cd "$platform_dir"
331-
npm publish --access public
332-
# TODO: Add --provenance flag after switching to OIDC (requires package to exist first)
334+
npm publish --provenance --access public
333335
cd ..
334336
echo " ✓ Published @sqliteai/sqlite-js-${platform_name}"
335337
done
336338
cd ..
337339
338340
# Publish main package
339341
echo "Publishing main package to npm..."
340-
npm publish --access public
341-
# TODO: Add --provenance flag after switching to OIDC (requires package to exist first)
342+
npm publish --provenance --access public
342343
echo "✓ Published @sqliteai/sqlite-js@${{ steps.tag.outputs.version }}"
343344
344345
echo ""

0 commit comments

Comments
 (0)