Skip to content

Commit f922cdf

Browse files
committed
Run publish on push
1 parent 1f7b5b8 commit f922cdf

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
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:
10-
publish:
11-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
8+
build-and-publish:
129
runs-on: ubuntu-latest
13-
1410
steps:
15-
- name: Checkout Repository
11+
- name: Checkout
1612
uses: actions/checkout@v4
1713

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
24+
1825
- name: Set up Node.js
1926
uses: actions/setup-node@v4
2027
with:
2128
node-version: '20'
2229
registry-url: 'https://npm.pkg.github.com'
2330

24-
- name: Publish Package
25-
run: |
26-
cd pkg
27-
npm publish --access public
31+
- name: Build and Publish library
32+
run: wasm-pack publish --target web --access public
2833
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)