-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6200945
commit 21b310e
Showing
3 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+++ | ||
title = "The Merp Experiment" | ||
description = "Game" | ||
weight = 1 | ||
+++ | ||
|
||
[Play here](/the-merp-experiment/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -ex | ||
|
||
HERE="$(dirname "${BASH_SOURCE[0]}")" | ||
cd "$HERE" | ||
REPO_DIR="$(git rev-parse --show-toplevel)" | ||
|
||
ASTEROIDS="$(mktemp -d -t asteroids-3d.XXX)" | ||
echo "Building subproject [directory=$ASTEROIDS]" | ||
git clone https://github.com/elihunter173/asteroids-3d.git "$ASTEROIDS" | ||
cd "$ASTEROIDS" | ||
subproject() { | ||
proj="$1" | ||
dir="$(mktemp -d -t "$proj".XXX)" | ||
echo "Building subproject [directory=$dir]" | ||
git clone "https://github.com/elihunter173/$proj.git" "$dir" | ||
cd "$dir" | ||
} | ||
|
||
subproject asteroids-3d | ||
npm install --production | ||
npm run build | ||
cp -r "$ASTEROIDS/dist" "$REPO_DIR/static/asteroids" | ||
cp -r ./dist "$REPO_DIR/static/asteroids" | ||
|
||
eval `ssh-agent -s` | ||
ssh-add - <<< '${{ secrets.CITY_GAME_PRIVATE_DEPLOY_KEY }}' | ||
subproject city-game | ||
cargo build --release --target wasm32-unknown-unknown | ||
wasm-bindgen --no-typescript --target web \ | ||
--out-dir ./out/ \ | ||
--out-name "game" \ | ||
./target/wasm32-unknown-unknown/web/game.wasm | ||
cat << EOF > ./out/index.html | ||
<!doctype html> | ||
<html lang="en"> | ||
<body style="margin: 0px;"> | ||
<script type="module"> | ||
import init from './game.js' | ||
init().catch((error) => { | ||
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) { | ||
throw error; | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
EOF | ||
cp -r ./assets ./out/. | ||
cp -r ./out "$REPO_DIR/static/the-merp-experiment" |