-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (105 loc) · 3.58 KB
/
build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Auto Build
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux]
arch: [x86_64, aarch64]
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Default to latest Rust
run: |
rustup install nightly
rustup default nightly
- name: Install aarch64 GCC
if: matrix.arch == 'aarch64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Update rustup
run: rustup update nightly
- name: Get Nightly toolchain
run: rustup toolchain add nightly-x86_64-unknown-linux-gnu
- name: Add Nightly rust-src
run: rustup component add rust-src --toolchain nightly
- name: Add aarch64 target
if: matrix.arch == 'aarch64'
run: rustup target add aarch64-unknown-linux-gnu
- name: (Debug) Print Cargo version
run: cargo --version
- name: Run tests
run: cargo test --verbose
- name: Run build
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
run: RUSTFLAGS="-Zlocation-detail=none -C target-feature=+crt-static" cargo +nightly build --verbose -Z build-std=std,panic_abort --target ${{matrix.arch}}-unknown-linux-gnu --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sealupd-${{matrix.os}}-${{matrix.arch}}
path: target/${{matrix.arch}}-unknown-linux-gnu/release/sealupd
build-macos:
runs-on: macos-latest
strategy:
matrix:
os: [darwin]
arch: [x86_64, aarch64]
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Default to latest Rust
run: |
rustup install nightly
rustup default nightly
- name: Get Nightly toolchain
run: rustup toolchain add nightly-aarch64-apple-darwin
- name: Add Nightly rust-src
run: rustup component add rust-src --toolchain nightly
- name: (Debug) Print Cargo version
run: cargo --version
- name: Run tests
run: cargo test --verbose
- name: Run build
run: RUSTFLAGS="-Zlocation-detail=none -C target-feature=+crt-static" cargo +nightly build --verbose -Z build-std=std,panic_abort --target ${{matrix.arch}}-apple-darwin --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sealupd-${{matrix.os}}-${{matrix.arch}}
path: target/${{matrix.arch}}-apple-darwin/release/sealupd
build-windows:
runs-on: windows-latest
strategy:
matrix:
os: [windows]
arch: [x86_64, i686]
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Default to latest Rust
run: |
rustup install stable
rustup default stable
- name: Add target
run: rustup target add ${{matrix.arch}}-pc-windows-msvc
- name: (Debug) Print Cargo version
run: cargo --version
- name: Run tests
run: cargo test --verbose
- name: Run build
run: |
set RUSTFLAGS=-C target-feature=+crt-static
cargo build --verbose --target ${{matrix.arch}}-pc-windows-msvc --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sealupd-${{matrix.os}}-${{matrix.arch}}
path: target/${{matrix.arch}}-pc-windows-msvc/release/sealupd.exe