Skip to content

Build Lineageos Kernel #15

Build Lineageos Kernel

Build Lineageos Kernel #15

name: Build Lineageos Kernel
on:
workflow_dispatch:
jobs:
build:
name: Build Kernel by ${{ github.actor }}
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_HARDLINK: "true"
steps:
- name: Set swap to 10G
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Setup build kernel environment
run: |
df -h
sleep 5
echo "BUILD_TIME=$(TZ=Asia/Shanghai date "+%y%m%d")" >> $GITHUB_ENV
sudo apt-get update
sudo apt-get install git dwarves libelf-dev ccache automake flex lzop bison gperf build-essential zip curl zlib1g-dev g++-multilib libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven libssl-dev pwgen libswitch-perl policycoreutils minicom libxml-sax-base-perl libxml-simple-perl bc libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev libgl1-mesa-dev xsltproc unzip device-tree-compiler python2 python3
mkdir -p $GITHUB_WORKSPACE/kernel_workspace
- name: Initialization environment
run: |
docker rmi `docker images -q`
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc /etc/mysql /etc/php
sudo -E apt-get -y purge azure-cli* docker* ghc* zulu* hhvm* llvm* firefox* google* dotnet* aspnetcore* powershell* openjdk* adoptopenjdk* mysql* php* mongodb* moby* snap* || true
sudo -E apt-get -qq update
sudo -E apt-get -qq install libfuse-dev $(curl -fsSL git.io/depends-ubuntu-2204)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
- name: Download kernel source
run: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.local/bin/repo
chmod a+x ~/.local/bin/repo
cd kernel_workspace
wget https://github.com/kongle233/Kernel-Builder_Action/releases/download/cxk/reposk.tgz
tar zxvf repo*.tgz
rm repo*.tgz
echo success
- name: Setup Debug Session
uses: csexton/debugger-action@master
- name: Make Anykernel3
run: |
cd $GITHUB_WORKSPACE/kernel_workspace
git clone https://github.com/Kernel-SU/AnyKernel3 --depth=1 AnyKernel3
cp out/arch/arm64/boot/Image AnyKernel3/
- name: Upload Image
uses: actions/upload-artifact@v4
with:
name: Image
path: kernel_workspace/out/arch/arm64/boot/Image
- name: Upload Modules
uses: actions/upload-artifact@v4
with:
name: Kmd-${{ env.BUILD_TIME }}
path: kernel_workspace/out/lib/modules/*
- name: Upload AnyKernel3
uses: actions/upload-artifact@v4
with:
name: AK3-OPAce3-A14-${{ env.BUILD_TIME }}
path: kernel_workspace/AnyKernel3/*