-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (71 loc) · 1.91 KB
/
build-dev.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Create tagged dev build
on:
push:
branches:
- 'dev'
jobs:
build-wasm:
runs-on: ubuntu-latest
steps:
-
name: Action Checkout
uses: actions/checkout@v3
-
name: Setup Tinygo
uses: acifani/setup-tinygo@v1
with:
tinygo-version: '0.30.0'
-
name: Build wasm
run: |
mkdir output
/usr/bin/env bash ./cmd/mcla_wasm/build.sh -o ./output/mcla.wasm -ldflags="-X 'main.version=hash-${GITHUB_SHA}'"
cp ./cmd/mcla_wasm/wasm_exec.js ./output/wasm_exec.js
-
name: Upload wasm output to artifact
uses: actions/upload-artifact@v2
with:
name: build-wasm-output
path: output/mcla.wasm
-
name: Upload tinygo wasm_exec to artifact
uses: actions/upload-artifact@v2
with:
name: build-wasm-exec-js
path: output/wasm_exec.js
publish-pages:
runs-on: ubuntu-latest
needs:
- build-wasm
steps:
-
name: Action Checkout
uses: actions/checkout@v3
with:
ref: 'pages'
-
name: Download build-wasm output from artifact
uses: actions/download-artifact@v2
with:
name: build-wasm-output
path: .
-
name: Download tinygo wasm_exec from artifact
uses: actions/download-artifact@v2
with:
name: build-wasm-exec-js
path: .
-
name: Good for version control
run: |
export RELEASE_VERSION="${GITHUB_REF#refs/*/}"
mkdir -p "${RELEASE_VERSION}"
cp wasm_exec.js mcla.wasm "${RELEASE_VERSION}"
-
name: Commit and push
run: |
git config user.name github-actions
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git commit -m "published dev"
git push