-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.43 KB
/
build_binary.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
name: build_binary
on:
push:
branches:
- main
paths:
- "src/**"
- "tests/**"
- "Cargo.**"
workflow_dispatch: {}
jobs:
build-yevis:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: "Cache builder image"
id: cache-builder-image
uses: actions/cache@v3
with:
path: musl-builder-image
key: musl-builder-image
- name: "Pull and save builder image"
if: steps.cache-builder-image.outputs.cache-hit != 'true'
run: |
docker pull ekidd/rust-musl-builder:stable
docker save ekidd/rust-musl-builder:stable -o musl-builder-image
- name: "Load builder image"
run: docker load -i musl-builder-image
- name: "Cache Rust"
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: "Build yevis binary"
run: docker run --rm -u root -v `pwd`:/home/rust/src ekidd/rust-musl-builder:stable cargo build --release
- name: "Upload yevis binary"
uses: actions/upload-artifact@v3
with:
name: yevis
path: target/x86_64-unknown-linux-musl/release/yevis