-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.96 KB
/
cross-compile.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
name: Cross-compilation on Rust stable
on:
push:
branches: [ "main" ]
paths-ignore:
- '**/*.md'
- '**/docs/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**/*.md'
- '**/docs/**'
jobs:
cross-compile:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Install build tools and ALSA dependencies (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update && sudo apt-get install -y build-essential libasound2-dev pkg-config;
- name: Install C compiler (macOS)
if: matrix.os == 'macos-latest'
run: |
xcode-select --install || echo "Xcode already installed";
- name: Install Visual Studio Build Tools (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install visualstudio2022-workload-vctools --yes
- name: Install Rust stable
run: rustup install stable
- name: Cross-compile for ${{ matrix.target }} on Rust stable
run: |
rustup target add ${{ matrix.target }}
cargo build --release --verbose --target ${{ matrix.target }}
- name: Upload compiled binaries
uses: actions/upload-artifact@v3
with:
name: binaries-${{ matrix.target }}
path: target/${{ matrix.target }}/release/