Skip to content

Commit 3784d49

Browse files
committed
ci: Update release workflow for npm OIDC authentication and bump up node version
1 parent 2293267 commit 3784d49

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v4
2424
- uses: actions/setup-node@v6.0.0
2525
with:
26-
node-version: 18
26+
node-version: 24
2727
cache: yarn
2828
cache-dependency-path: yarn.lock
2929

@@ -73,7 +73,7 @@ jobs:
7373
uses: actions/checkout@v4
7474
- uses: actions/setup-node@v6.0.0
7575
with:
76-
node-version: 18
76+
node-version: 24
7777
cache: yarn
7878
cache-dependency-path: yarn.lock
7979

@@ -101,7 +101,7 @@ jobs:
101101
uses: actions/checkout@v4
102102
- uses: actions/setup-node@v6.0.0
103103
with:
104-
node-version: 18
104+
node-version: 24
105105
cache: yarn
106106
cache-dependency-path: yarn.lock
107107

.github/workflows/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@v4
2323
- uses: actions/setup-node@v6.0.0
2424
with:
25-
node-version: 18
25+
node-version: 24
2626
cache: yarn
2727
cache-dependency-path: yarn.lock
2828

@@ -47,20 +47,30 @@ jobs:
4747
name: Release and Sync Repos
4848
runs-on: ubuntu-latest
4949
needs: ['android-unit-tests', 'react-tests']
50+
# OIDC permissions for npm trusted publishing
51+
permissions:
52+
contents: write
53+
issues: write
54+
pull-requests: write
55+
id-token: write # Required for OIDC authentication with npm
5056
steps:
5157
- name: Checkout internal/development
5258
uses: actions/checkout@v4
5359

5460
- name: Setup Node.js
5561
uses: actions/setup-node@v6.0.0
5662
with:
57-
node-version: 18
63+
node-version: 24
64+
registry-url: 'https://registry.npmjs.org'
5865

5966
- name: Install node modules
6067
run: yarn install
68+
69+
- name: Ensure npm CLI supports OIDC
70+
run: npm install -g npm@latest
6171

6272
- name: Build SDK
6373
run: yarn build
6474

6575
- name: Release
66-
run: ./release.sh ${{ secrets.NPM_TOKEN}}
76+
run: ./release.sh

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
"app.plugin.js",
3030
"plugin"
3131
],
32+
"publishConfig": {
33+
"access": "public",
34+
"provenance": true,
35+
"registry": "https://registry.npmjs.org"
36+
},
3237
"dependencies": {},
3338
"peerDependencies": {
3439
"react": ">= 16.0.0-alpha.12",

release.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
#!/usr/bin/env bash
2-
: ${1?"NPM Token missing- usage: $0 {MY_NPM_TOKEN}"}
3-
4-
touch .npmrc;
5-
echo "//registry.npmjs.org/:_authToken=$1" > .npmrc;
6-
npm publish;
2+
npm publish --provenance --access public

0 commit comments

Comments
 (0)