-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.95 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
name: Build and Upload aarch64-musl
on: [push]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: aarch64-unknown-linux-musl
- name: Install cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xzf aarch64-linux-musl-cross.tgz
sudo mv aarch64-linux-musl-cross /opt/
echo "/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
- name: Set default host
run: rustup set default-host aarch64-unknown-linux-musl
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
key: aarch64-unknown-linux-musl
- name: Build project
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-gcc
CC_aarch64_unknown_linux_musl: aarch64-linux-musl-gcc
CXX_aarch64_unknown_linux_musl: aarch64-linux-musl-g++
run: |
cargo build --locked --release --target aarch64-unknown-linux-musl
# - name: Upload to Cloudflare R2
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
# R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
# R2_BUCKET: ${{ secrets.R2_BUCKET }}
# run: |
# aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
# aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
# aws configure set region auto
# aws configure set output json
# aws s3 cp target/aarch64-unknown-linux-musl/release/geph4-binder s3://$R2_BUCKET/aarch64-musl-latest --recursive --endpoint-url=$R2_ENDPOINT