Skip to content

Commit c3da62f

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

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
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

18-
- name: Set up Node.js
19-
uses: actions/setup-node@v4
14+
- name: Set up Rust toolchain
15+
uses: dtolnay/rust-toolchain@stable
2016
with:
21-
node-version: '20'
22-
registry-url: 'https://npm.pkg.github.com'
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
2324

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

0 commit comments

Comments
 (0)