1+ name : Build Android Kernel then ship it in an AnyKernel3 flashable zip
2+
3+ on :
4+ push :
5+ branches :
6+ - laurel_sprout
7+ pull_request :
8+ branches :
9+ - laurel_sprout
10+ workflow_dispatch :
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-22.04
15+
16+ steps :
17+ - name : ⚡ Checkout kernel's sourcecode and clone submodules
18+ uses : actions/checkout@v4
19+
20+ - name : 📅 Export date of build
21+ run : |
22+ echo "DATE=$(date +%d%m%Y)" >> $GITHUB_ENV
23+
24+ - name : 🔄 Update KernelSU-Next
25+ run : |
26+ rm -rf KernelSU-Next
27+ git clone https://github.com/KernelSU-Next/KernelSU-Next
28+
29+ - name : 📥 Clone AnyKernel3
30+ run : |
31+ git clone -b laurel_sprout https://github.com/Oneloutre/AnyKernel3.git anykernel
32+ rm -rf anykernel/.git
33+
34+ - name : 📦 Install dépendencies
35+ run : |
36+ sudo apt-get update -y -qq
37+ sudo apt-get install -y --no-install-recommends \
38+ python3-pip \
39+ git \
40+ zip \
41+ unzip \
42+ gcc \
43+ g++ \
44+ make \
45+ ninja-build \
46+ file \
47+ bc \
48+ bison \
49+ flex \
50+ libfl-dev \
51+ libssl-dev \
52+ libelf-dev \
53+ wget \
54+ build-essential \
55+ python3-dev \
56+ python3-setuptools \
57+ rsync \
58+ ccache \
59+ llvm-dev
60+ sudo apt install flex libncurses6 libncurses5 binutils-aarch64-linux-gnu device-tree-compiler \
61+ android-sdk-libsparse-utils
62+ sudo apt install -y gcc-arm-linux-gnueabi
63+ echo "CROSS_COMPILE_ARM32=arm-linux-gnueabi-" >> $GITHUB_ENV
64+
65+ - name : 🔧 Install Clang from a Github action
66+ uses : KyleMayes/install-llvm-action@v2
67+ with :
68+ version : " 18.1.8"
69+ directory : ${{ runner.temp }}/llvm
70+
71+ - name : 🔧 Add Clang to the PATH
72+ run : |
73+ echo "${{ runner.temp }}/llvm/bin" >> $GITHUB_PATH
74+
75+ - name : 🔍 Device's codename and kernel's version
76+ run : |
77+ DEVICE_CODENAME=laurel_sprout
78+ KERNEL_VERSION=$(make kernelversion)
79+
80+ echo "Device Codename: $DEVICE_CODENAME"
81+ echo "Kernel Version: $KERNEL_VERSION"
82+
83+ echo "DEVICE_CODENAME=$DEVICE_CODENAME" >> $GITHUB_ENV
84+ echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV
85+
86+ - name : 🚀 Enable ccache to speed the build up
87+ uses : hendrikmuhs/ccache-action@v1.2
88+ with :
89+ max-size : 7G
90+
91+ - name : 🛠️ Build the kramel
92+ run : |
93+ export ARCH=arm64
94+ export SUBARCH=arm64
95+ export KBUILD_COMPILER_STRING=$(clang --version | head -n 1)
96+ export CCACHE_EXEC=$(which ccache)
97+ export KBUILD_BUILD_HOST="Github-actions-Onelots"
98+
99+ make O=out ARCH=arm64 vendor/laurel_sprout-perf_defconfig V=1
100+ make O=out ARCH=arm64 olddefconfig
101+ ./scripts/config --file out/.config -e CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE
102+
103+ make -j$(nproc --all) O=out \
104+ ARCH=arm64 \
105+ CC="ccache clang" \
106+ LLVM=1 \
107+ LLVM_IAS=1 \
108+ CLANG_TRIPLE=aarch64-linux-gnu- \
109+ CROSS_COMPILE=aarch64-linux-android- \
110+ CROSS_COMPILE_ARM32=arm-linux-androideabi-
111+
112+ - name : 🚀 Copy the compiled kernel to AnyKernel3 then create the zip
113+ run : |
114+ ZIP_NAME="Kernel-${DEVICE_CODENAME}-${KERNEL_VERSION}-$(date +%d%m%Y).zip"
115+
116+ cp out/arch/arm64/boot/Image.gz-dtb anykernel/
117+
118+ cd anykernel && zip -r9 $ZIP_NAME ./*
119+ mv $ZIP_NAME ../
120+
121+ echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
122+
123+ - name : 📤 Publish github release
124+ uses : softprops/action-gh-release@v2
125+ with :
126+ files : ${{ env.ZIP_NAME }}
127+ tag_name : " latest"
128+ draft : false
129+ prerelease : false
130+
131+ - name : 📤 Publish with tag associated to the kernel
132+ uses : softprops/action-gh-release@v2
133+ with :
134+ files : ${{ env.ZIP_NAME }}
135+ tag_name : Kernel-${{ env.DEVICE_CODENAME }}-${{ env.KERNEL_VERSION }}-${{ env.DATE }}
136+ draft : false
137+ prerelease : false
138+
139+ - name : 🚀 Notify people on Discord
140+ env :
141+ DEVICE_CODENAME : ${{ env.DEVICE_CODENAME }}
142+ KERNEL_VERSION : ${{ env.KERNEL_VERSION }}
143+ WEBHOOK : ${{ secrets.WEBHOOK }}
144+ NAME : ${{ env.ZIP_NAME }}
145+ run : |
146+ python3 .github/webhook.py
0 commit comments