An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.

Overview

🕊️ Bevy Shell - Template

An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.

Features

  • Single, monolithic repository for a cross-platform Bevy App
  • Automated CI on pushes and merge requests to main
  • Cross-platform delivery of your Bevy app through GitHub releases
    • Windows, Linux, MacOS, Web (Demo)
  • Options to deploy Web to DockerHub (self-host) or GitHub Pages (free)
  • Settings for automated dependency management through Renovate
  • Best practices in GitOps and IaC

Quickstart

  • Use or Fork this template
  • Setup RenovateBot with permissions to your repository to automatically detect dependency updates
  • Setup your WASM build with one of:
  • Optional: Modify your Bevy App, which is self-contained in src/
    • You can preview your WASM version with trunk serve (Trunk required)
    • You can preview the Native version with cargo run
  • Cut a release to cross-deploy your game across WASM, Windows, Mac, and Linux

💁🏻 Information

Below is detailed information for the features of this template

📦 Multi-platform CI/CD

This template uses GitOps to deploy a multi-platform release. GitHub Actions powers testing pipelines and release deployment to ensure a solid foundation for production release infrastructure.

Automated testing

Pushing to the main branch automatically triggers CI pipelines:

  • Unit Testing - Ubuntu (latest)
  • Build - Ubuntu (latest)
  • Build - Windows (latest)
  • Build - MacOS (latest)
  • Build - WebAssembly

🔸 You can ensure all pull requests must pass CI testing before merging through GitHub's branch protection rules.

Automated dependency management

Renovate is a free open source bot on GitHub for your repositories to automatically create pull requests for dependency updates on your projects. This template's Renovate settings file allows for automatic merging of minor and patch updates, if all CI tests pass. You can change these settings yourself.

🔸 More information is available at renovatebot.com

Release cutting

Creating a release on your template will trigger the release pipeline, which packages download bundles for all 3 major platforms. Additionally, the pipeline will create a branch gh-pages with the WASM bundle to serve by GitHub Pages (demo), or DockerHub image (example), depending on the hosting strategy you choose to setup.

🔥 WARNING: We enforce releases are tagged with a semantic version name, e.g. "v0.1.0", not "v1" This can be modified on the release-* workflow files.

📡 Hosting

There are two ways to host the WASM build of your Bevy game, with Docker or GitHub Pages. You could be creative to adapt this to other hosting platforms, but we will only explain these two. You would likely choose one, not both. If you don't have hosting equipment or know what you're doing, choose GitHub Pages.

GitHub Pages

To automatically serve your WASM bundle like our demo, here are the steps:

  • Modify the GitHub Pages GitHub Action file's variarable PUBLIC_URL with the slug for your GitHub Pages hosting.

    • If the repo name is the same as the repo owner, this should be /, otherwise, it will should be /<repository-name>/ (e.g. /bevy-shell-template/)
  • Optional: Delete the DockerHub GitHub Action, as you probably don't need it.

  • Cut a release and wait for pipeline completion

  • On your GitHub template repo, visit Settings > Pages

  • Select gh-pages branch from the dropdown menu and press "Save".

Docker

To serve your WASM bundle with Docker, here are the steps:

  • Signup to DockerHub
  • Navigate to your project Settings > Secrets > Actions
  • Create two repository GitHub Action secrets:
    • DOCKERHUB_USERNAME Your DockerHub username (e.g. simbleau)
    • DOCKERHUB_TOKEN A DockerHub access token with write privileges
  • Modify the DockerHub GitHub Action file's variable RELEASE_NAME with your desired image name (e.g. my_game)
  • Optional: Delete the GitHub Pages GitHub Action, as you probably don't need it.
  • Cut a release and wait for pipeline completion
  • On your server hardware with Docker installed, run docker run -p 80:80 <DOCKERHUB_USERNAME>/<RELEASE_NAME>:latest, which should pull from DockerHub automatically.
  • Your WASM build should be served via http://localhost:80, where localhost is your server's address

🔸 The Dockerfile uses NGINX, and uses Docker.nginx.conf for configuration.

🚀 Launchers

WASM (Web)

This launcher depends on the trunk crate. To build and run the WASM app locally:

Serve with trunk serve and open http://127.0.0.1:8080 in your browser

  • Assets are streamed through the hosting provider, so that the initial WASM bundle is smaller.
  • We use all the WASM optimizations discussed described here in the Rust and WebAssembly book.
  • There is an initial loading screen provided through Yew while the WASM bundle loads.

Native (Windows, MacOS, Linux)

Run with cargo run

  • Assets are bundled with the release when cut.
  • There is no loading screen.
Comments
An opinionated 2D sparse grid made for use with Bevy. For storing and querying entities

bevy_sparse_grid_2d An opinionated 2D sparse grid made for use with Bevy. For storing and querying entities. Personally, I'm using it for simple stupi

Johan Klokkhammer Helsing 5 Feb 26, 2023
Work-in-Progress, opinionated game framework built on Bevy.

Bones A work-in-progress, opinionated game meta-engine built on Bevy. Under development for future use in the Jumpy game, and possibly other FishFolk

Fish Folk 9 Jan 3, 2023
Neutral cross-platform Rust game template

Rust Game Template Neutral cross-platform Rust game template. Build tool This project uses cargo-make task runner. It's required to build the project.

null 0 Feb 5, 2022
A cross platform (wasm included) networking library!

bootleg_networking A cross platform (wasm included) networking library! A networking plugin for the Bevy game engine that wraps around bevy_networking

William Batista 51 Jan 1, 2023
Cross-platform (including wasm) persistent key value store plugin for rust games/apps

bevy_pkv bevy_pkv is a cross-platform persistent key value store for rust apps. Use it for storing things like settings, save games etc. Currently, it

Johan Klokkhammer Helsing 25 Jan 9, 2023
Adds support for wasm/wat assets in Bevy, and enables easier scripting

bevy_wasm_scripting Adds support for wasm/wat assets in Bevy, and enables easy scripting. This is enabled through the wasmer crate. Prepare for public

null 9 Dec 20, 2022
Discord RIch Presence in Rust, with native Bevy support

Discord Presence The root project for both Bevy Discord Presence and regular Discord Presence, both contained in the crates directory. TODO Allow invi

Juliette Cordor 22 Nov 29, 2022
Template for a Bevy game

A Bevy game template Template for a Game using the awesome Bevy engine featuring (almost) out of the box builds for Windows, Linux and MacOS. What doe

Niklas Eicker 346 Jan 1, 2023
Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust

Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust Slow down, upon the teeth of Orange Heav

Shea Leffler 12 Mar 18, 2022
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
An opinionated 2D game engine for Rust

Coffee An opinionated 2D game engine for Rust focused on simplicity, explicitness, and type-safety. Coffee is in a very early stage of development. Ma

Héctor Ramón 946 Jan 4, 2023
Blossom is an opinionated MUD engine written in Rust.

?? Blossom Blossom is an opinionated MUD engine written in Rust. This is still a VERY early work-in-progress and there will be sweeping, breaking chan

Rob 1 Dec 20, 2022
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

What is this This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within i

null 3 May 8, 2023
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023
rust-browser-game but native and rendered with ncurses in C without the Browser

Spin-off of rust-browser-game-but-sdl but with ncurses Nothing much to say. Just see rust-browser-game-but-sdl and rust-browser-game. Quick Start $ ma

Tsoding 8 Apr 21, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

webview 10.8k Jan 9, 2023
This is a cross-platform tool to historicize different branches/depots/manifests and generating pseudocode for it to compare different game updates

CSHP This is a cross-platform tool to historicize different branches/depots/manifests and generating pseudocode for it to compare different game updat

raizo 6 Jan 28, 2022