Unverified Commit 129896c2 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

[ci]: remove publish token in favor of OIDC (#93065)

Switches from a long-lived token to trusted publishing OIDC flow. This requires a bump to Node (for feature support). Otherwise just dropping unnecessary envs.
parent c49ebd2d
...@@ -480,14 +480,13 @@ jobs: ...@@ -480,14 +480,13 @@ jobs:
permissions: permissions:
contents: write contents: write
id-token: write id-token: write
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
steps: steps:
- name: Setup node - name: Setup node
uses: actions/setup-node@v6 uses: actions/setup-node@v6
with: with:
node-version: ${{ env.NODE_LTS_VERSION }} node-version: 24
check-latest: true check-latest: true
registry-url: 'https://registry.npmjs.org'
- name: Setup corepack - name: Setup corepack
run: | run: |
npm i -g corepack@0.31 npm i -g corepack@0.31
...@@ -521,8 +520,6 @@ jobs: ...@@ -521,8 +520,6 @@ jobs:
merge-multiple: true merge-multiple: true
path: crates/wasm path: crates/wasm
- run: npm i -g npm@10.4.0 # need latest version for provenance (pinning to avoid bugs)
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: ./scripts/publish-native.js - run: ./scripts/publish-native.js
- run: ./scripts/publish-release.js - run: ./scripts/publish-release.js
env: env:
......
...@@ -61,9 +61,10 @@ jobs: ...@@ -61,9 +61,10 @@ jobs:
echo " - 📦 This will PUBLISH packages to npm" echo " - 📦 This will PUBLISH packages to npm"
fi fi
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version: '22' node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Enable corepack - name: Enable corepack
run: corepack enable run: corepack enable
...@@ -113,12 +114,6 @@ jobs: ...@@ -113,12 +114,6 @@ jobs:
run: ls -R npm run: ls -R npm
working-directory: ${{ steps.napi-info.outputs.binding-directory }} working-directory: ${{ steps.napi-info.outputs.binding-directory }}
- name: Create npm token
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
- name: Release npm binding packages - name: Release npm binding packages
run: | run: |
npm config set access public npm config set access public
......
...@@ -71,11 +71,6 @@ const cwd = process.cwd() ...@@ -71,11 +71,6 @@ const cwd = process.cwd()
console.log(`Publishing as "${tag}" dist tag...`) console.log(`Publishing as "${tag}" dist tag...`)
if (!process.env.NPM_TOKEN) {
console.log('No NPM_TOKEN, exiting...')
return
}
const packagesDir = path.join(cwd, 'packages') const packagesDir = path.join(cwd, 'packages')
const packageDirs = fs.readdirSync(packagesDir) const packageDirs = fs.readdirSync(packagesDir)
const publishSema = new Sema(2) const publishSema = new Sema(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment