Skip to content

Commit e7c4c3e

Browse files
authored
chore: update release action with trusted publishing (#64)
1 parent 19a0498 commit e7c4c3e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ jobs:
1212
release:
1313
name: Release
1414
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write
17+
contents: write
1518
steps:
1619
- name: Checkout
1720
uses: actions/checkout@v4
1821

19-
# Needed for lerna version to determine last tag
22+
# Needed for release-it to determine last tag and version history
2023
- name: Fetch
2124
run: git fetch --prune --unshallow --tags
2225

@@ -29,7 +32,12 @@ jobs:
2932
- name: Setup Node
3033
uses: actions/setup-node@v4
3134
with:
32-
node-version: '18'
35+
node-version: '20'
36+
registry-url: 'https://registry.npmjs.org'
37+
38+
- name: Update npm for trusted publishing
39+
run: npm install -g npm@latest
40+
3341

3442
- name: Install
3543
run: yarn install --frozen-lockfile
@@ -45,12 +53,6 @@ jobs:
4553
git config --global user.name amplitude-sdk-bot
4654
git config --global user.email [email protected]
4755
48-
- name: Setup NPM Token
49-
if: ${{ github.event.inputs.dryRun == 'false'}}
50-
env:
51-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52-
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
53-
5456
- name: Release (Dry Run)
5557
if: ${{ github.event.inputs.dryRun == 'true'}}
5658
env:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@
107107
"tagName": "v${version}"
108108
},
109109
"npm": {
110-
"publish": true
110+
"publish": true,
111+
"publishArgs": ["--provenance"]
111112
},
112113
"github": {
113114
"release": true

0 commit comments

Comments
 (0)