File tree Expand file tree Collapse file tree 3 files changed +54
-7
lines changed Expand file tree Collapse file tree 3 files changed +54
-7
lines changed Original file line number Diff line number Diff line change 3
3
branches : ["main"]
4
4
5
5
name : Build and deploy on push
6
+
7
+ env :
8
+ RUST_CHANNEL : stable
9
+
6
10
jobs :
7
11
build :
8
12
name : Deploy website
13
17
with :
14
18
node-version : ' 16'
15
19
16
- - name : Install npm
20
+ - name : Install asteroids deps
17
21
uses : actions/setup-node@v2
18
22
23
+ - name : Install city-game deps
24
+ run : |
25
+ rustup update --no-self-update ${{ env.RUST_CHANNEL }}
26
+ rustup default ${{ env.RUST_CHANNEL }}
27
+ rustup target install wasm32-unknown-unknown
28
+ cargo install wasm-bindgen-cli
29
+
19
30
- name : Build website
20
31
run : ./scripts/build.sh
21
32
env :
Original file line number Diff line number Diff line change
1
+ +++
2
+ title = " The Merp Experiment"
3
+ description = " Game"
4
+ weight = 1
5
+ +++
6
+
7
+ [ Play here] ( /the-merp-experiment/ ) .
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -e
3
+ set -ex
4
4
5
5
HERE=" $( dirname " ${BASH_SOURCE[0]} " ) "
6
6
cd " $HERE "
7
7
REPO_DIR=" $( git rev-parse --show-toplevel) "
8
8
9
- ASTEROIDS=" $( mktemp -d -t asteroids-3d.XXX) "
10
- echo " Building subproject [directory=$ASTEROIDS ]"
11
- git clone https://github.com/elihunter173/asteroids-3d.git " $ASTEROIDS "
12
- cd " $ASTEROIDS "
9
+ subproject () {
10
+ proj=" $1 "
11
+ dir=" $( mktemp -d -t " $proj " .XXX) "
12
+ echo " Building subproject [directory=$dir ]"
13
+ git clone " https://github.com/elihunter173/$proj .git" " $dir "
14
+ cd " $dir "
15
+ }
16
+
17
+ subproject asteroids-3d
13
18
npm install --production
14
19
npm run build
15
- cp -r " $ASTEROIDS /dist" " $REPO_DIR /static/asteroids"
20
+ cp -r ./dist " $REPO_DIR /static/asteroids"
21
+
22
+ subproject city-game
23
+ cargo build --release --target wasm32-unknown-unknown
24
+ wasm-bindgen --no-typescript --target web \
25
+ --out-dir ./out/ \
26
+ --out-name " game" \
27
+ ./target/wasm32-unknown-unknown/web/game.wasm
28
+ cat << EOF > ./out/index.html
29
+ <!doctype html>
30
+ <html lang="en">
31
+ <body style="margin: 0px;">
32
+ <script type="module">
33
+ import init from './game.js'
34
+ init().catch((error) => {
35
+ if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
36
+ throw error;
37
+ }
38
+ });
39
+ </script>
40
+ </body>
41
+ </html>
42
+ EOF
43
+ cp -r ./assets ./out/.
44
+ cp -r ./out " $REPO_DIR /static/the-merp-experiment"
You can’t perform that action at this time.
0 commit comments