-
Notifications
You must be signed in to change notification settings - Fork 104
98 lines (83 loc) · 2.91 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_INCREMENTAL: 0
CARGO_TERM_COLOR: always
TERM: xterm-256color
jobs:
generate-changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update config
shell: bash
run: sed -E -i "s/\s+\#\s(.*)\s\#\sreplace issue numbers/\\t\1/g" cliff.toml
- name: Generate a changelog
uses: orhun/git-cliff-action@v2
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
prepare:
needs: generate-changelog
runs-on: ubuntu-latest
steps:
- id: version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Show version
run: echo ${{ steps.version.outputs.VERSION }}
outputs:
version: ${{ steps.version.outputs.VERSION }}
build:
needs: prepare
runs-on: [kuberunner]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set cargo path
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: Install build deps
run: |
sudo apt update -y
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2
- name: Build wasm-proc
run: |
cargo build -p wasm-proc --release
cp -vf target/release/wasm-proc ./
- name: Build binaries
run: >
cargo build -p gear-cli --profile production
- name: Test runtimes
run: |
./wasm-proc --check-runtime-imports target/production/wbuild/gear-runtime/gear_runtime.wasm
./wasm-proc --check-runtime-imports target/production/wbuild/vara-runtime/vara_runtime.wasm
- name: Prepare artifacts
run: |
mkdir -p artifact
cp target/production/wbuild/gear-runtime/gear_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.compact.wasm artifact/
cp target/production/wbuild/gear-runtime/gear_runtime.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.compressed.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.compact.wasm artifact/
cp target/production/wbuild/vara-runtime/vara_runtime.wasm artifact/
cp target/production/gear artifact/
strip artifact/gear || true
- name: Publish
uses: softprops/action-gh-release@v1
with:
body: "${{ needs.generate-changelog.outputs.release_body }}"
files: artifact/*
tag_name: ${{ steps.version.outputs.VERSION }}
draft: true