-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (50 loc) · 1.86 KB
/
build-release-binaries.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
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Attach Binaries to Release
on:
release:
types:
- created
jobs:
build_and_upload:
strategy:
matrix:
platform:
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: macos-latest, target: x86_64-apple-darwin }
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "23.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Add apple target
if: matrix.platform.os == 'macos-latest'
run: rustup target add x86_64-apple-darwin
- name: Add musl target
if: matrix.platform.os == 'ubuntu-latest'
run: rustup target add x86_64-unknown-linux-musl
- name: Install deps for musl build
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools clang build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++
- name: Build Rust project
run: cargo build --release --target ${{ matrix.platform.target }}
- name: Upload Binary to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/${{ matrix.platform.target }}/release/try-runtime
asset_name: try-runtime-${{ matrix.platform.target }}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}