Skip to content

Commit f115dde

Browse files
committed
ci: Migrate to npmjs trusted-publishers OIDC
1 parent ba84786 commit f115dde

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/deploy-package.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ on:
88
default: "1.0.0"
99
required: true
1010

11+
permissions:
12+
id-token: write # Required for OIDC
13+
contents: read
14+
1115
jobs:
1216
publish:
1317
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
id-token: write # Required for npm OIDC trusted publishing
1421

1522
steps:
1623
- uses: actions/checkout@v4
@@ -27,6 +34,10 @@ jobs:
2734
with:
2835
node-version: lts/Iron
2936
cache: "pnpm"
37+
registry-url: "https://registry.npmjs.org"
38+
39+
- name: Upgrade npm for OIDC support
40+
run: npm install -g npm@11.7.0
3041

3142
- name: Setup Rust
3243
uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -70,9 +81,6 @@ jobs:
7081
env:
7182
INPUT_VERSION: ${{ github.event.inputs.version }}
7283

73-
- name: Create .npmrc for NPM
74-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_NPM_MATTERLABS_AUTOMATION_TOKEN }}" > ~/.npmrc
75-
7684
- name: Determine npm publish tag
7785
id: npm_tag
7886
run: |
@@ -86,11 +94,11 @@ jobs:
8694
8795
- name: Publish SDK to NPM
8896
working-directory: packages/sdk-4337
89-
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
97+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }} --provenance
9098

9199
- name: Publish web SDK to NPM
92100
working-directory: packages/sdk-platforms/web
93-
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
101+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }} --provenance
94102

95103
- name: Create .npmrc for GitHub Packages
96104
run: |

0 commit comments

Comments
 (0)