-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (59 loc) · 2.19 KB
/
release-linux.yml
File metadata and controls
72 lines (59 loc) · 2.19 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
name: "Build Kallichore Linux Release"
on:
workflow_call:
inputs:
version:
required: false
description: "The Kallichore version"
default: ${{ github.sha }}
type: string
workflow_dispatch:
jobs:
build_linux:
name: Build Linux
runs-on: ${{ matrix.arch == 'x64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm64-4-core' }}
timeout-minutes: 60
env:
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"
strategy:
matrix:
arch: [x64, arm64]
flavor: [debug, release]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Build Environment
run: |
sudo apt-get update
sudo apt-get install -y cargo
- name: Setup Zig Build Environment
run: |
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 Kallichore (${{ matrix.flavor }})
run: |
cargo clean
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/kallichore-${{ inputs.version }}-${{ matrix.flavor }}-linux-${{ matrix.arch }}.zip"
[ -e LICENSE.txt ] || cp "$GITHUB_WORKSPACE/LICENSE.txt" LICENSE.txt
zip -Xry $ARCHIVE kcserver LICENSE.txt
popd
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: kallichore-${{ matrix.flavor }}-linux-${{ matrix.arch }}-archive
path: kallichore-${{ inputs.version }}-${{ matrix.flavor }}-linux-${{ matrix.arch }}.zip