-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
49 lines (42 loc) · 1.08 KB
/
Taskfile.yaml
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
43
44
45
46
47
48
49
# https://taskfile.dev
version: "3"
tasks:
install-binaryen:
status:
- test -f ./bin/wasm-opt
cmds:
- wget https://github.com/WebAssembly/binaryen/releases/download/version_108/binaryen-version_108-x86_64-linux.tar.gz
- tar -xf binaryen-version_108-x86_64-linux.tar.gz
- rm binaryen-version_108-x86_64-linux.tar.gz
- mkdir -p bin
- mv binaryen-version_108/bin/* bin/
- rm -rf binaryen-version_108
- ./bin/wasm-opt --version
build-frontend:
env:
GOOS: js
GOARCH: wasm
GOROOT:
sh: go env GOROOT
cmds:
- mkdir -p public
- cp ./frontend/* ./public/
- cp "$GOROOT/misc/wasm/wasm_exec.js" ./public/wasm_exec.js
- go build -o public/frontend.wasm ./wasm/
optimize-wasm:
deps:
- install-binaryen
cmds:
- ./bin/wasm-opt -Oz -o public/frontend.wasm public/frontend.wasm
build-server:
cmds:
- go build -o server.bin ./server/
build:
cmds:
- task: build-frontend
- task: build-server
run:
deps:
- build
cmds:
- ./server.bin