Skip to content

Commit d1fc637

Browse files
committed
feat: add wasm bindings
1 parent 4e379a9 commit d1fc637

File tree

19 files changed

+6032
-133
lines changed

19 files changed

+6032
-133
lines changed

.github/workflows/ci-wasm.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI wasm
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
paths:
7+
- "bindings/wasm/**"
8+
- ".github/workflows/**"
9+
tags:
10+
- "node*"
11+
pull_request:
12+
branches: ["master"]
13+
paths:
14+
- "bindings/wasm/**"
15+
- ".github/workflows/**"
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
20+
jobs:
21+
check:
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions-rs/toolchain@v1
26+
with:
27+
profile: minimal
28+
toolchain: stable
29+
override: true
30+
- uses: actions-rs/cargo@v1
31+
with:
32+
command: check
33+
args: --all-features --verbose --manifest-path bindings/wasm/Cargo.toml
34+
35+
publish-npm:
36+
runs-on: ubuntu-24.04
37+
if: startsWith(github.ref, 'refs/tags/')
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions-rs/toolchain@v1
41+
with:
42+
profile: minimal
43+
toolchain: stable
44+
override: true
45+
target: wasm32-unknown-unknown
46+
- name: Install wasm-bindgen-cli
47+
run: cargo install wasm-bindgen-cli --version 0.2.92
48+
- name: Build wasm
49+
working-directory: js/wasm
50+
run: wasm-pack build --target web --release --out-dir pkg
51+
- uses: actions/setup-node@v2
52+
with:
53+
node-version: "20.x"
54+
registry-url: "https://registry.npmjs.org"
55+
- working-directory: bindings/wasm/pkg
56+
run: npm install
57+
- working-directory: bindings/wasm/pkg
58+
run: npm publish
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)