-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.56 KB
/
deploy.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
name: Build and Precompile Binaries
on:
push:
branches:
- main
- oleander-patch-1
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Set up cross-compilation environment
run: |
sudo apt-get update
sudo apt-get install -y pkg-config-aarch64-linux-gnu
echo 'export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig' >> $GITHUB_ENV
echo 'export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu' >> $GITHUB_ENV
- name: Build for ${{ matrix.target }}
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
- name: Install dependencies
run: sudo apt-get install -y musl-tools
- name: Install cargo-binstall
run: cargo install cargo-binstall
- name: Build for ${{ matrix.target }}
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.target }}
path: target/${{ matrix.target }}/release/