mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 07:15:41 -06:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 799d5d85e8 | |||
| 9730d02da5 | |||
| f634beffee |
16
.github/workflows/deploy.yaml
vendored
16
.github/workflows/deploy.yaml
vendored
@@ -10,19 +10,29 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2 # repo checkout
|
||||
|
||||
- uses: mymindstorm/setup-emsdk@v11 # setup emscripten toolchain
|
||||
with:
|
||||
version: 1.39.20
|
||||
|
||||
- uses: actions-rs/toolchain@v1 # get rust toolchain for wasm
|
||||
with:
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-emscripten
|
||||
override: true
|
||||
|
||||
# TODO: Update to v2
|
||||
- name: Rust Cache # cache the rust build artefacts
|
||||
uses: Swatinem/rust-cache@v1
|
||||
|
||||
- name: Build # build
|
||||
run: ./scripts/build-wasm.sh
|
||||
- name: Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
folder: dist
|
||||
path: './dist/'
|
||||
retention-days: 7
|
||||
|
||||
- name: Deploy
|
||||
uses: actions/deploy-pages@v2
|
||||
0
scripts/build-wasm.sh
Normal file → Executable file
0
scripts/build-wasm.sh
Normal file → Executable file
12
src/main.rs
12
src/main.rs
@@ -8,9 +8,6 @@ use tracing::event;
|
||||
use tracing_error::ErrorLayer;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
|
||||
#[cfg(target_os = "emscripten")]
|
||||
pub mod emscripten;
|
||||
|
||||
mod animation;
|
||||
mod constants;
|
||||
mod direction;
|
||||
@@ -149,14 +146,7 @@ pub fn main() {
|
||||
|
||||
true
|
||||
};
|
||||
|
||||
#[cfg(target_os = "emscripten")]
|
||||
use emscripten::emscripten;
|
||||
|
||||
#[cfg(target_os = "emscripten")]
|
||||
emscripten::set_main_loop_callback(main_loop);
|
||||
|
||||
#[cfg(not(target_os = "emscripten"))]
|
||||
|
||||
loop {
|
||||
if !main_loop() {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user