Skip to content

Commit 6f2b256

Browse files
authored
Merge pull request #15 from phantom/ilan/trustedpublishing
feat: add trusted publishing
2 parents 33b84e2 + a2a15f4 commit 6f2b256

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,35 @@ on:
77

88
concurrency: ${{ github.workflow }}-${{ github.ref }}
99

10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
# OIDC
14+
id-token: write
15+
1016
jobs:
1117
release:
1218
name: Release
1319
runs-on: ubuntu-latest
14-
permissions:
15-
contents: write
16-
pull-requests: write
20+
env:
21+
# Force npm to emit provenance (SLSA) when publishing via OIDC.
22+
NPM_CONFIG_PROVENANCE: true
23+
1724
steps:
1825
- name: Checkout Repo
19-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2027

2128
- name: Enable Corepack
2229
run: corepack enable
2330

2431
- name: Setup Node.js 20.x
25-
uses: actions/setup-node@v3
32+
uses: actions/setup-node@v4
2633
with:
2734
node-version: 20.x
35+
registry-url: "https://registry.npmjs.org"
36+
37+
- name: Ensure npm 11.5.1+ for trusted publishing
38+
run: npm install -g npm@^11.5.1
2839

2940
- name: Install Dependencies
3041
run: yarn
@@ -36,5 +47,4 @@ jobs:
3647
# This expects you to have a script called release which does a build for your packages and calls changeset publish
3748
publish: yarn release
3849
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN_PHANTOM_SECURITY_BOT }}
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)