Skip to content

Commit 7291c60

Browse files
authored
ci: Support NPM OIDC publishing flow and add provenance (#1932)
1 parent bb67910 commit 7291c60

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
name: Publish
3434
runs-on: ubuntu-22.04
3535
permissions:
36-
contents: write
36+
contents: write # Push version changes
37+
id-token: write # OIDC for NPM publishing
3738
needs:
3839
- validate
3940
steps:
@@ -61,9 +62,8 @@ jobs:
6162
- name: Publish to NPM
6263
working-directory: packages/${{ inputs.package }}
6364
run: |
64-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
65-
pnpm build
66-
pnpm publish
65+
sudo npm i -g npm@latest
66+
npm publish
6767
6868
- name: Create GitHub release
6969
run: pnpm tsx scripts/create-github-release.ts ${{ inputs.package }}

.github/workflows/update-browser-package.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
name: 'Sync with @types/chrome'
1313
runs-on: ubuntu-latest
1414
permissions:
15-
contents: write
15+
contents: write # Push version changes
16+
id-token: write # OIDC for NPM publishing
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
@@ -42,5 +43,5 @@ jobs:
4243
if: steps.commit.outputs.changes_detected == 'true'
4344
working-directory: packages/browser
4445
run: |
45-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
46-
pnpm publish
46+
sudo npm i -g npm@latest
47+
npm publish

0 commit comments

Comments
 (0)