-
Notifications
You must be signed in to change notification settings - Fork 105
98 lines (78 loc) · 3.52 KB
/
release.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release
on:
push:
tags: [ "*" ]
env:
CARGO_TERM_COLOR: always
TERM: xterm-256color
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
jobs:
changelog:
name: Generate changelog
runs-on: [ kuberunner ]
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
build:
needs: changelog
runs-on: [ kuberunner ]
steps:
- name: "Actions: Checkout"
uses: actions/checkout@v4
- name: "Environment: Cargo path"
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Environment: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: "Environment: Build dependencies"
run: |
sudo apt update -y
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2
- name: "Environment: Export versions"
run: |
echo "VARA_SPEC=$(cat runtime/vara/src/lib.rs | grep "spec_version: " | awk -F " " '{print substr($2, 1, length($2)-1)}')" >> $GITHUB_ENV
- name: "Environment: Make `artifact` directory"
run: mkdir -p artifact
- name: "Build: `wasm-proc`"
run: |
cargo build -p wasm-proc --release
cp -vf target/release/wasm-proc ./
- name: "Build: Production `vara-runtime`"
run: cargo build -p vara-runtime --profile production --no-default-features --features std
- name: "Test: Production `vara-runtime`"
run: ./wasm-proc --check-runtime-imports --check-runtime-is-dev false target/production/wbuild/vara-runtime/vara_runtime.compact.wasm
- name: "Artifact: Production `vara-runtime` metadata"
run: |
RUNTIME_WASM=target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm PRINT_SCALE=1 cargo run -p gsdk-api-gen --release > "artifact/production_vara_runtime_v${VARA_SPEC}_metadata.scale"
- name: "Artifact: Production `vara-runtime`"
run: cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/production_vara_runtime_v$VARA_SPEC.wasm"
- name: "Build: Production node client and development `vara-runtime`"
run: cargo build -p gear-cli --profile production
- name: "Test: Development `vara-runtime`"
run: ./wasm-proc --check-runtime-imports --check-runtime-is-dev true target/production/wbuild/vara-runtime/vara_runtime.compact.wasm
- name: "Artifact: Development `vara-runtime` metadata"
run: |
RUNTIME_WASM=target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm PRINT_SCALE=1 cargo run -p gsdk-api-gen --release > "artifact/testnet_vara_runtime_v${VARA_SPEC}_metadata.scale"
- name: "Artifact: Production node client and development `vara-runtime`"
run: |
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm "artifact/testnet_vara_runtime_v$VARA_SPEC.wasm"
cp target/production/gear artifact/gear
strip artifact/gear || true
- name: Publish
uses: softprops/action-gh-release@v2
with:
body: ${{ needs.changelog.outputs.release_body }}
files: artifact/*
tag_name: ${{ steps.version.outputs.VERSION }}
draft: true