-
Notifications
You must be signed in to change notification settings - Fork 23
71 lines (57 loc) · 2.07 KB
/
build-wasm.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
name: Build Wasm
on:
workflow_dispatch:
inputs:
runtime:
description: 'Runtime'
required: true
type: choice
options:
- alphanet
- mainnet
env:
CARGO_TERM_COLOR: always
Runtime: ${{ github.event.inputs.runtime }}
jobs:
call-start-new-build-machine:
uses: ./.github/workflows/start-new-build-machine.yml
secrets: inherit
build:
runs-on: GP1-M
name: Build WASM
steps:
- uses: actions/checkout@v3
- name: Install Docker
run: apt update -y && snap install docker
- name: Init Submodules
run: git submodule update --init --recursive
- name: Install Dependencies
run: |
apt update -y
apt install build-essential git clang curl libssl-dev llvm libudev-dev make protobuf-compiler -y
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust_install.sh && chmod u+x rust_install.sh && ./rust_install.sh -y
. $HOME/.cargo/env && rustup update && rustup show
- name: Install srtool
run: . $HOME/.cargo/env && cargo install --git https://github.com/chevdor/srtool-cli
- name: Create downloads folder
run: mkdir -p output
- name: Move Pallets Workspace file
run: rm -f ./ternoa-pallets/Cargo.toml
- name: Run Srtool
run: |
export runtime=${{ github.event.inputs.runtime }}
. $HOME/.cargo/env
srtool build -p "$runtime"-runtime -r runtime/$runtime
- name: Move wasm files
run: |
export runtime=${{ github.event.inputs.runtime }}
cp ./runtime/"$runtime"/target/srtool/release/wbuild/"$runtime"-runtime/"$runtime"_runtime.compact.compressed.wasm ./output/
cp ./runtime/"$runtime"/target/srtool/release/wbuild/"$runtime"-runtime/"$runtime"_runtime.compact.wasm ./output/
cp ./runtime/"$runtime"/target/srtool/release/wbuild/"$runtime"-runtime/"$runtime"_runtime.wasm ./output/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: assets-for-download
path: output