Skip to content

Commit 7a07261

Browse files
committed
Run publish on push
1 parent 1f7b5b8 commit 7a07261

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
name: Publish WASM Package
22

33
on:
4-
workflow_run:
5-
workflows: ["Build WASM Package"]
6-
types:
7-
- completed
4+
push:
5+
branches: [main]
86

97
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Rust toolchain
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
targets: wasm32-unknown-unknown
18+
19+
- name: Install wasm-pack
20+
run: curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash
21+
22+
- name: Build library
23+
run: wasm-pack build --scope libresplit --target web --release --access public
24+
25+
- name: Upload pkg
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: pkg
29+
path: pkg
30+
1031
publish:
11-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1232
runs-on: ubuntu-latest
33+
needs: build
1334

1435
steps:
15-
- name: Checkout Repository
36+
- name: Checkout
1637
uses: actions/checkout@v4
1738

39+
- name: Download pkg
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: pkg
43+
path: pkg
44+
1845
- name: Set up Node.js
1946
uses: actions/setup-node@v4
2047
with:
@@ -26,4 +53,4 @@ jobs:
2653
cd pkg
2754
npm publish --access public
2855
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)