-
Notifications
You must be signed in to change notification settings - Fork 29
77 lines (63 loc) · 2.82 KB
/
Copy pathrelease-linux.yml
File metadata and controls
77 lines (63 loc) · 2.82 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
67
68
69
70
71
72
73
74
75
76
77
name: "Build Ark Linux Release"
on:
workflow_call:
inputs:
version:
required: false
description: "The Ark version"
default: ${{ github.sha }}
type: string
workflow_dispatch:
jobs:
build_linux:
name: Build Linux
runs-on: ubuntu-latest
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
TARGET_FLAG: ${{ matrix.flavor == 'release' && '--release' || '' }}
ARCH_FLAG: ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}
GLIBC_MAX_VERSION: '2.26' # Sufficiently old for all our target platforms
strategy:
matrix:
arch: [x64, arm64]
flavor: [debug, release]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Build Environment
run: |
sudo apt-get update
sudo apt-get install -y cargo
# We're linking with zig to select the libc version
cargo install --locked cargo-zigbuild
sudo apt install python3-pip
pip3 install ziglang
- name: Setup Build Environment for arm64
if: matrix.arch == 'arm64'
run: |
rustup target add aarch64-unknown-linux-gnu
- name: Compile ARK (${{ matrix.flavor }})
run: |
cargo clean
# Use the zig linker. This allows linking to a specific version of glibc.
# We use a sufficiently old version that is available on all platforms we target.
# See https://github.com/ziglang/glibc-abi-tool
cargo zigbuild --target ${ARCH_FLAG}-unknown-linux-gnu.$GLIBC_MAX_VERSION $TARGET_FLAG
# Compress kernel to a zip file
- name: Create archive
run: |
# Enter the build directory
pushd target/${ARCH_FLAG}-unknown-linux-gnu/${{ matrix.flavor }}
# Compress the kernel to an archive
ARCHIVE="$GITHUB_WORKSPACE/ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-linux-${{ matrix.arch }}.zip"
[ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE
[ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE
zip -Xry $ARCHIVE ark LICENSE NOTICE
popd
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ark-${{ matrix.flavor }}-linux-${{ matrix.arch }}-archive
path: ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-linux-${{ matrix.arch }}.zip