-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (48 loc) · 1.75 KB
/
rust_build.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
name: Build binaries (rust)
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Prepare
run: >
sudo apt-get install -y musl musl-tools
- name: Checkout
uses: actions/checkout@v1
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
default: true
override: true
- name: Build
run: >
cargo build --locked --bins --release --target=x86_64-unknown-linux-musl --features openssl/vendored &&
strip target/x86_64-unknown-linux-musl/release/agnos &&
strip target/x86_64-unknown-linux-musl/release/agnos-generate-accounts-keys &&
mv target/x86_64-unknown-linux-musl/release/agnos target/x86_64-unknown-linux-musl/release/agnos_amd64 &&
mv target/x86_64-unknown-linux-musl/release/agnos-generate-accounts-keys target/x86_64-unknown-linux-musl/release/agnos-generate-accounts-keys_amd64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/x86_64-unknown-linux-musl/release/agnos_amd64
target/x86_64-unknown-linux-musl/release/agnos-generate-accounts-keys_amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}