Skip to content

Commit 53509ae

Browse files
committed
github: Fix npm publishing
Switch to trusted publishing.
1 parent 05a35de commit 53509ae

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ jobs:
1313
name: "Publish new version to NPM"
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 5
16+
permissions:
17+
contents: read
18+
id-token: write
1619
env:
1720
NODE_OPTIONS: "--trace-warnings"
18-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1921
steps:
2022
- name: "Checkout this repo"
2123
uses: actions/checkout@v3
@@ -31,27 +33,26 @@ jobs:
3133

3234
- name: "Publish core (pre-release)"
3335
if: contains(github.ref, '-pre')
34-
run: npm publish --tag next
36+
run: npm publish --tag next --provenance --access public
3537
working-directory: ./packages/libsql-core
3638

3739
- name: "Publish core (latest)"
3840
if: "!contains(github.ref, '-pre')"
39-
run: npm publish
41+
run: npm publish --provenance --access public
4042
working-directory: ./packages/libsql-core
4143

42-
4344
- name: "Install npm dependencies (client)"
4445
run: "npm ci"
4546
working-directory: ./packages/libsql-client
4647

4748
- name: "Publish client (pre-release)"
4849
if: contains(github.ref, '-pre')
49-
run: npm publish --tag next
50+
run: npm publish --tag next --provenance --access public
5051
working-directory: ./packages/libsql-client
5152

5253
- name: "Publish client (latest)"
5354
if: "!contains(github.ref, '-pre')"
54-
run: npm publish
55+
run: npm publish --provenance --access public
5556
working-directory: ./packages/libsql-client
5657

5758

@@ -61,10 +62,10 @@ jobs:
6162

6263
- name: "Publish client-wasm (pre-release)"
6364
if: contains(github.ref, '-pre')
64-
run: npm publish --tag next
65+
run: npm publish --tag next --provenance --access public
6566
working-directory: ./packages/libsql-client-wasm
6667

6768
- name: "Publish client-wasm (latest)"
6869
if: "!contains(github.ref, '-pre')"
69-
run: npm publish
70+
run: npm publish --provenance --access public
7071
working-directory: ./packages/libsql-client-wasm

0 commit comments

Comments
 (0)