Skip to content

Commit dd27919

Browse files
committed
Use OIDC publishing to npm
1 parent 1c904a8 commit dd27919

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
tags:
77
- 'powersync-v[0-9]+.[0-9]+.[0-9]+'
88

9+
# For trusted npm publishing, see https://docs.npmjs.com/trusted-publishers#github-actions-configuration
10+
permissions:
11+
id-token: write
12+
contents: read
13+
914
jobs:
1015
setup:
1116
uses: ./.github/workflows/prepare_wasm.yml
@@ -17,7 +22,7 @@ jobs:
1722

1823
steps:
1924
- name: Checkout Repository
20-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2126
- uses: ./.github/actions/prepare
2227

2328
- name: Create Draft Release
@@ -34,15 +39,18 @@ jobs:
3439
gh release upload "${{ github.ref_name }}" packages/powersync/assets/powersync_db.worker.js packages/powersync/assets/powersync_sync.worker.js packages/sqlite3_wasm_build/dist/*.wasm
3540
3641
- name: Setup Node.js
37-
uses: actions/setup-node@v4
42+
uses: actions/setup-node@v6
43+
with:
44+
node-version: latest
45+
- name: Update npm
46+
run: |
47+
npm install -g npm@latest
48+
npm --version
3849
- uses: pnpm/action-setup@v2
3950
name: Install pnpm
4051
with:
4152
run_install: false
4253
version: 10
43-
- name: Add NPM auth
44-
run: |
45-
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
4654
- name: Publish npm package with WASM files
4755
working-directory: packages/sqlite3_wasm_build
4856
run: |
@@ -51,4 +59,3 @@ jobs:
5159
pnpm publish --no-git-checks --access public
5260
env:
5361
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)