-
Notifications
You must be signed in to change notification settings - Fork 30
66 lines (54 loc) · 1.95 KB
/
build-linux.yml
File metadata and controls
66 lines (54 loc) · 1.95 KB
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
name: "Build Linux"
on:
workflow_call:
jobs:
build:
name: "Build Linux (${{ matrix.this.target }})"
runs-on: ${{ matrix.this.runner }}
timeout-minutes: 30
# Lock Linux to minimum supported version (Ubuntu 18.04 / RHEL 8, glibc
# 2.28) via a Docker container. PyPa is the Python Packaging Authority, they
# manage old Linux variants for building Python wheels.
container: ${{ matrix.this.container }}
strategy:
matrix:
this:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
container: quay.io/pypa/manylinux_2_28_aarch64
steps:
- uses: actions/checkout@v4
# Docker container doesn't come with rustup
- name: "Install rustup"
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: "Install rust toolchain (rust-toolchain.toml)"
run: |
rustup toolchain install
rustup show
- name: "Install rust target"
run: |
rustup target add ${{ matrix.this.target }}
rustup target list --installed
- name: "Build"
run: cargo build --release --locked --target ${{ matrix.this.target }} -p air
- name: "Archive"
run: |
TARGET=${{ matrix.this.target }}
ARCHIVE_NAME=air-$TARGET
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
mkdir -p $ARCHIVE_NAME
cp target/$TARGET/release/air $ARCHIVE_NAME/air
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
- name: "Upload"
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.this.target }}
path: |
*.tar.gz
*.sha256