Skip to content

Commit 6d3a1ea

Browse files
committed
Switch to trusted publish on npm
1 parent 222c355 commit 6d3a1ea

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

.github/workflows/autopublish.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
id-token: write
1011

1112
jobs:
1213
build:
@@ -24,7 +25,7 @@ jobs:
2425
- name: Use Node.js
2526
uses: actions/setup-node@v4
2627
with:
27-
node-version: 18.x
28+
node-version: 20.x
2829
registry-url: https://registry.npmjs.org
2930

3031
- name: Install dependencies
@@ -45,19 +46,13 @@ jobs:
4546
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
4647
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4748

48-
- name: Authenticate npm
49-
run: |
50-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
51-
env:
52-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53-
5449
- name: Publish new version if required
5550
run: |
5651
yarn lerna version --conventional-commits --allow-branch=master --no-changelog --sign-git-commit --sign-git-tag --no-push --yes
5752
yarn release
5853
env:
59-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
54+
NPM_CONFIG_PROVENANCE: true
55+
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
6156

6257
- name: Push changes
6358
run: |

scripts/release.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
22

3-
printf "//registry.npmjs.org/:_authToken="%s"\n@csssr:registry=https://registry.npmjs.org/\n" "$NPM_TOKEN" >> $HOME/.npmrc 2> /dev/null
43
./node_modules/.bin/lerna publish from-git --yes --registry https://registry.npmjs.org/ --no-push

0 commit comments

Comments
 (0)