-
Notifications
You must be signed in to change notification settings - Fork 27
78 lines (72 loc) · 2.37 KB
/
build_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
name: Build release
on:
create:
tags:
- v*
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
raw_name: klipper_estimator.exe
asset_name: klipper_estimator.exe
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
raw_name: klipper_estimator
asset_name: klipper_estimator_linux
- target: x86_64-apple-darwin
os: macos-11
raw_name: klipper_estimator
asset_name: klipper_estimator_osx
- target: armv7-unknown-linux-musleabihf
os: ubuntu-latest
raw_name: klipper_estimator
asset_name: klipper_estimator_rpi
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: full
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER: arm-linux-gnueabihf-ld
CC_armv7_unknown_linux_musleabihf: arm-linux-gnueabihf-gcc
steps:
- uses: actions/checkout@v2
- name: Install Pi cross compiler
if: matrix.target == 'armv7-unknown-linux-musleabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Install musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install musl-tools
- name: Setup mingw cross compiler
if: matrix.target == 'x86_64-pc-windows-gnu'
run: |
sudo apt-get update
sudo apt-get install gcc-mingw-w64-x86-64
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }} --release
- name: Rename asset
run: mv target/${{ matrix.target }}/release/${{ matrix.raw_name }} target/${{ matrix.asset_name }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: target/${{ matrix.asset_name }}