-
Notifications
You must be signed in to change notification settings - Fork 29
31 lines (28 loc) · 1002 Bytes
/
rust.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
# Workflow from https://reemus.dev/tldr/rust-cross-compilation-github-actions
name: Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- name: linux-amd64
runner: ubuntu-latest
target: aarch64-unknown-linux-musl
command: cargo
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
# Only install cross if we need it
# Install via cargo-binstall which I found faster
- name: Install Cross
if: matrix.command == 'cross'
shell: bash
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
- name: Build Binary
run: ${{ matrix.command }} build --verbose --locked --release --target ${{ matrix.target }}