Skip to content

Commit 2ad70b3

Browse files
committed
Publish to npmjs.com
1 parent 2517dc6 commit 2ad70b3

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ name: Publish WASM Package
22

33
on:
44
push:
5-
branches: [main]
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write
10+
contents: read
611

712
jobs:
8-
build-and-publish:
13+
publish:
914
runs-on: ubuntu-latest
15+
1016
steps:
1117
- name: Checkout
1218
uses: actions/checkout@v4
@@ -17,18 +23,17 @@ jobs:
1723
targets: wasm32-unknown-unknown
1824

1925
- name: Install wasm-pack
20-
run: curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash
26+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
2127

22-
- name: Build library
28+
- name: Build WASM library
2329
run: wasm-pack build --scope libresplit --target web --release
2430

2531
- name: Set up Node.js
2632
uses: actions/setup-node@v4
2733
with:
28-
node-version: '20'
29-
registry-url: 'https://npm.pkg.github.com'
34+
node-version: 20
35+
registry-url: "https://registry.npmjs.org"
3036

31-
- name: Build and Publish library
32-
run: wasm-pack publish --target web --access public
33-
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
- name: Publish to npm
38+
run: npm install -g npm@latest
39+
- run: wasm-pack publish --access public

0 commit comments

Comments
 (0)