Skip to content

Build release

Build release #55

Workflow file for this run

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 }}