-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.61 KB
/
build-for-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
name: Build for release
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-upload:
name: Build and archive the artifacts
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
cross: true
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cross: false
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
cross: true
- os: windows-latest
target: x86_64-pc-windows-msvc
cross: false
- os: macos-latest
target: x86_64-apple-darwin
cross: false
- os: macos-latest
target: aarch64-apple-darwin
cross: false
runs-on: ${{matrix.os}}
steps:
- name: Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{matrix.os}}
shared-key: release
- uses: actions-rs/toolchain@v1
if: ${{!matrix.cross}}
with:
toolchain: stable
target: ${{matrix.target}}
- uses: actions/checkout@v3
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{matrix.cross}}
command: build
args: --target ${{matrix.target}} --release
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: elv-${{github.ref_name}}-${{matrix.target}}
path: |
target/${{matrix.target}}/release/elv
target/${{matrix.target}}/release/elv.exe