Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bevy-tools
CI/CD templates for Bevy (Rust) game projects, in the same spirit as ebitengine-tools and godot-tools.
example-makefile.make— project Makefile: local dev targets (build,run,wasm,export,watch,clean) plus the Woodpecker pipeline targets (ci-version,ci-export,ci-upload,ci-update).example-woodpecker.yaml— Woodpecker pipeline: version → build (Rust,wasm32-unknown-unknowntarget +wasm-bindgenin thegit.teletypegames.org/internal/bevy-builderimage) → upload (scp to the droparea) → update (calls the teletypegames/updateendpoint withplatform=bevy).builder.Dockerfile— the CI builder image:rust:1-alpinewith the wasm target, the wasm-bindgen CLI and make/zip/curl baked in.example-tasks.json— VS Code.vscode/tasks.jsonwith the common dev tasks: Run (cargo run, default build task,Cmd+Shift+B), Build & Run, Build WASM and Make build.web/index.html— the HTML shell downloaded bymake exportand packaged next to thewasm-bindgenoutput (game.js+game_bg.wasm).
Usage in a game repo
-
Copy
example-makefile.maketoMakefileand setPROJECT(must match the crate name inCargo.toml; the native binary is built tobin/$(PROJECT)). -
Pin the
wasm-bindgencrate inCargo.tomlto the exact version inWASM_BINDGEN_VERSION:[target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen = "=0.2.100"The
wasm-bindgenCLI and the crate must be the same version, otherwise the generated JS glue refuses to load. The builder image ships the CLI — when bumping the version, rebuild the image with the matching--build-arg WASM_BINDGEN_VERSION. -
Copy
example-woodpecker.yamlto.woodpecker.yamland add thedroparea_ssh_password/update_secret_keysecrets in Woodpecker. -
Copy
example-tasks.jsonto.vscode/tasks.jsonand replace the binary name (bevydemo) with$(PROJECT).
Local WASM builds additionally need
rustup target add wasm32-unknown-unknown and the wasm-bindgen CLI
(cargo install wasm-bindgen-cli --version 0.2.100).
The pipeline uploads $(PROJECT)-$(VERSION).html.zip to the droparea,
then triggers
/update?platform=bevy&name=$(PROJECT)&version=$(VERSION).
Builder image
docker build --platform linux/amd64 -f builder.Dockerfile \
--build-arg WASM_BINDGEN_VERSION=0.2.100 \
-t git.teletypegames.org/internal/bevy-builder:latest .
docker push git.teletypegames.org/internal/bevy-builder:latest
Detailed documentation lives on the wiki: /development/bevy.