Adapting workflows/build/release setup etc from bevy_game_template.
Featuring out of the box builds for Windows, Linux, macOS, and Web (Wasm). It also includes the setup for android support.
- workflow for GitHub actions creating releases for Windows, Linux, macOS, and Web (Wasm) ready for distribution
- push a tag in the form of
v[0-9]+.[0-9]+.[0-9]+*
(e.g.v1.1.42
) to trigger the flow - WARNING: if you work in a private repository, please be aware that macOS and Windows runners cost more build minutes. You might want to consider running the workflow less often or removing some builds from it. For public repositories the builds are free!
- push a tag in the form of
- Look for
ToDo
to use your own game name everywhere - Update the icons as described below
- Start coding 🎉
- Start the native app:
cargo run
- Start the web build:
trunk serve
- requires trunk:
cargo install --locked trunk
- requires
wasm32-unknown-unknown
target:rustup target add wasm32-unknown-unknown
- this will serve your app on
8080
and automatically rebuild + reload it after code changes
- requires trunk:
- Start the android app:
cargo apk run -p mobile
(update the library name if you changed it)- requires following the instructions in the bevy example readme for android setup instructions
- Start the iOS app
- Install Xcode through the app store
- Launch Xcode and install the iOS simulator (check the box upon first start, or install it through
Preferences > Platforms
later) - Install the iOS and iOS simulator Rust targets with
rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
(see the bevy example readme for ios setup instructions) - run
make run
inside the/mobile
directory
- Start the native app:
You should keep the credits
directory up to date. The release workflow automatically includes the directory in every build.
- Replace
build/macos/icon_1024x1024.png
with a1024
times1024
pixel png icon and runcreate_icns.sh
(make sure to run the script inside thebuild/macos
directory) - Note: this requires a mac - Replace
build/windows/icon.ico
(used for windows executable and as favicon for the web-builds)- You can create an
.ico
file for windows by following these steps:- Open
macos/AppIcon.iconset/icon_256x256.png
in Gimp - Select the
File > Export As
menu item. - Change the file extension to
.ico
(or clickSelect File Type (By Extension)
and selectMicrosoft Windows Icon
) - Save as
build/windows/icon.ico
- Open
- You can create an
- Replace
build/android/res/mipmap-mdpi/icon.png
withmacos/AppIcon.iconset/icon_256x256.png
, but rename it toicon.png
- Trigger the
deploy-github-page
workflow - Activate GitHub pages for your repository
- Source from the
gh-pages
branch (created by the just executed action)
- Source from the
- After a few minutes your game is live at
http://username.github.io/repository
To deploy newer versions, just run the deploy-github-page
workflow again.
Note that this does a cargo build
and thus does not work with local dependencies. Consider pushing your "custom Bevy fork" to GitHub and using it as a git dependency.
If you don't want to target Android or iOS, you can just delete the /mobile
, /build/android
, and /build/ios
directories.
Then delete the [workspace]
section from Cargo.toml
.
Audio in web-builds can have issues in some browsers. This seems to be a general performance issue and not due to the audio itself (see bevy_kira_audio/#9).