Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually build and deploy wasm examples page #226

Merged
merged 2 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions generate-wasm-examples/generate_wasm_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"
Expand Down Expand Up @@ -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