-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.32 KB
/
build.yaml
File metadata and controls
42 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
on: [push]
name: CI
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: rustup target add wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: install
args: wasm-snip
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
env:
EXTENDED_DISK_SIZE: "1"
- run: cp target/wasm32-unknown-unknown/release/cart.wasm ./cart.wasm
- run: wasm-snip --snip-rust-panicking-code cart.wasm > cart_snip.wasm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- run: npx wasm-opt -Oz --strip-producers --dce --zero-filled-memory cart_snip.wasm -o cart_snip_opt.wasm
# - run: npm install -g wasm4
- run: wget https://github.com/pashutk/wasm4/releases/download/v0.0.1/w4-linux.zip && 7z x w4-linux.zip && chmod +x ./w4
- run: ./w4 bundle cart_snip_opt.wasm --title "w4tracker" --html index.html
- run: mkdir _build && mv index.html _build/index.html
- name: Deploy 🚀
if: ${{ github.ref_name == 'main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build