Skip to content

Commit 027a73e

Browse files
committed
Add wasm-bindgen and separation of actions.
1 parent caea731 commit 027a73e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/rust.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@ jobs:
2424
target/
2525
key: ${{ github.ref || github.run_id }}
2626
- uses: dtolnay/rust-toolchain@stable
27+
- uses: jetli/[email protected]
28+
with:
29+
version: 'latest'
2730
- name: Install wasm target
2831
run: rustup target install wasm32-unknown-unknown
2932
- name: Build
30-
run: cargo build --release --target wasm32-unknown-unknown && wasm-bindgen --no-typescript --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_wasm_ci_example.wasm --out-name "tabletop" && wasm-strip ./out/tabletop_bg.wasm && wasm-opt -Oz --enable-bulk-memory --enable-nontrapping-float-to-int --enable-reference-types -o ./out/tabletop_bg.wasm ./out/tabletop_bg.wasm && gzip -f ./out/tabletop_bg.wasm
33+
run: cargo build --release --target wasm32-unknown-unknown
34+
- name: wasm-bindgen:
35+
run: wasm-bindgen --no-typescript --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_wasm_ci_example.wasm --out-name "tabletop"
36+
- name: wasm-strip
37+
run: wasm-strip ./out/tabletop_bg.wasm
38+
- name: wasm-opt
39+
run: wasm-opt -Oz --enable-bulk-memory --enable-nontrapping-float-to-int --enable-reference-types -o ./out/tabletop_bg.wasm ./out/tabletop_bg.wasm
40+
- name: gzip
41+
run: gzip -f ./out/tabletop_bg.wasm
3142
- name: Copy
3243
run: cp -R assets out/ && cp www/index.html out/index.html
3344
- name: Push

0 commit comments

Comments
 (0)