Skip to content

build_generic

build_generic #4

Workflow file for this run

name: build_generic
on:
workflow_dispatch:
inputs:
LLVM_VER:
description: 'LLVM_VER (Specify LLVM Version)'
required: true
default: '19'
KERNEL_VER:
description: 'KERNEL_VER (Specify XANMOD branch to build)'
required: true
default: '6.6'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- config: v1
- config: v2
- config: v3
- config: v4
name: "🚧 Build Xanmod for x86-64-${{matrix.config}}"
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Install packages & setup
run: |
sudo apt update
sudo apt purge firefox -y
sudo apt upgrade
sudo apt install \
wget \
build-essential \
bison \
flex \
pkg-config \
qtcreator \
qtbase5-dev \
qt5-qmake \
qttools5-dev-tools \
libssl-dev \
libncurses-dev \
git \
libelf-dev \
lz4 \
debhelper \
dh-virtualenv \
zstd \
elfutils -y
- name: Setup Clang/LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ github.event.inputs.LLVM_VER }}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
- name: Clone Kernel Source
run: |
git clone --depth=1 https://gitlab.com/xanmod/linux -b ${{ github.event.inputs.KERNEL_VER }} kernel/xanmod
- name: Run Build
run: |
cp config_generic kernel/xanmod/arch/x86/configs/config_generic.config
cd kernel/xanmod
cp CONFIGS/xanmod/gcc/config_x86-64-${{ matrix.config }} arch/x86/configs/${{ matrix.config }}_defconfig
make clean
rm -rf vmlinux-gdb.py
export LLVM_SUFFIX=-${{ github.event.inputs.LLVM_VER }}
ARGS='
CC=clang${LLVM_SUFFIX}
LD=ld.lld${LLVM_SUFFIX}
LLVM=1
LLVM_IAS=1
LLVM_SUFFIX=-${{ github.event.inputs.LLVM_VER }}
LOCALVERSION=-xanmod-${{ github.event.inputs.KERNEL_VER }}-clang-${{ github.event.inputs.LLVM_VER }}
'
make ${ARGS} ${{ matrix.config }}_defconfig config_generic.config
make ${ARGS} deb-pkg -j$(nproc)
cd ..
cp xanmod/.config config
rm -rf xanmod *.gz *.dsc *.buildinfo *.changes
- name: Upload-Kernel
uses: actions/upload-artifact@v4
with:
name: Xanmod-${{ github.event.inputs.KERNEL_VER }}-${{ github.event.inputs.LLVM_VER }}-config_x86-64-${{ matrix.config }}
path: kernel/
compression-level: 9