From c35b27cc9ddb42858fe62505efb048bac4026630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= <8672791+mockersf@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:38:10 +0100 Subject: [PATCH 1/2] build and deploy wasm examples --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7e59a26c7f..5e0071a5b5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,6 +19,9 @@ jobs: - name: "Build Bevy Error Codes" run: cd generate-errors && ./generate_errors.sh + - name: "Build Bevy Examples" + run: cargo install wasm-bindgen-cli && cd generate-wasm-examples && ./generate_wasm_examples.sh + - name: "Build and deploy website" if: github.repository_owner == 'bevyengine' uses: shalzz/zola-deploy-action@master From 524d288a65ca5dcfa22da761180566b5a8d7e514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= <8672791+mockersf@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:38:25 +0100 Subject: [PATCH 2/2] also add an audio example --- generate-wasm-examples/generate_wasm_examples.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate-wasm-examples/generate_wasm_examples.sh b/generate-wasm-examples/generate_wasm_examples.sh index 5b04070b44..2aa35bcd72 100755 --- a/generate-wasm-examples/generate_wasm_examples.sh +++ b/generate-wasm-examples/generate_wasm_examples.sh @@ -33,8 +33,7 @@ add_category() mkdir ../../content/examples/$category_path/$example cp -r assets ../../content/examples/$category_path/$example cp examples/$category_path/$example.rs ../../content/examples/$category_path/$example/ - # need to disable default features to not have bevy_audio - cargo build --release --target wasm32-unknown-unknown --no-default-features --features "render,bevy_winit,png" --example $example + cargo build --release --target wasm32-unknown-unknown --example $example wasm-bindgen --out-dir ../../content/examples/$category_path/$example --no-typescript --target web target/wasm32-unknown-unknown/release/examples/$example.wasm echo "+++ title = \"$example\" @@ -73,5 +72,6 @@ category_weight=0 add_category 2d rect sprite sprite_flipping sprite_sheet text2d add_category 3d 3d_scene lighting load_gltf orthographic parenting pbr texture update_gltf_scene add_category UI button text text_debug ui +add_category audio audio add_category Game breakout alien_cake_addict add_category Tools bevymark