Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit a2be0db

Browse files
committed
b4s4: workflow: introduce auto building for Caelum-b4s4 kernel
Signed-off-by: Onelots <onelots@onelots.fr>
0 parents  commit a2be0db

File tree

3 files changed

+209
-0
lines changed

3 files changed

+209
-0
lines changed

.github/webhook.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import os
2+
import requests
3+
from datetime import datetime
4+
5+
DISCORD_WEBHOOK = os.environ["WEBHOOK"]
6+
release_url = "https://github.com/Oneloutre/kernel_auto_builder/releases/tag/latest"
7+
codename = os.environ["DEVICE_CODENAME"]
8+
kernel_version = os.environ["KERNEL_VERSION"]
9+
zip_name = os.environ["NAME"]
10+
embed_color = 0x2ecc71
11+
12+
embed = {
13+
"type": "rich",
14+
"username": "Kramel Slave",
15+
"embeds": [
16+
{
17+
"title": f"🚀 Build succeeded !",
18+
"url": release_url,
19+
"description": f"The KernelSU-Next build for **{codename}** is done !\n🎯 **Version :** `{kernel_version}`\n💡 **Name :** `{zip_name}`",
20+
"color": f"{embed_color}",
21+
"fields": [
22+
{
23+
"name": "📥 Download",
24+
"value": f"[Click here to go to the download page]({release_url})",
25+
"inline": False
26+
},
27+
{
28+
"name": "📅 Date",
29+
"value": f"{datetime.now().strftime('%d/%m/%Y %H:%M:%S')}",
30+
"inline": True
31+
}
32+
],
33+
"timestamp": datetime.now().isoformat(),
34+
"footer": {
35+
"text": "Automated build • GitHub Actions",
36+
"icon_url": "https://cdn-icons-png.flaticon.com/512/733/733609.png"
37+
}
38+
}
39+
]
40+
}
41+
42+
response = requests.post(DISCORD_WEBHOOK, json=embed)
43+
if response.status_code == 204:
44+
print("✅ Notification sent on Discord !")
45+
else:
46+
print(f"❌ Error ({response.status_code}) : {response.text}")
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: Build KernelSU-Next for B4S4 (Bonito/Sargo)
2+
3+
on:
4+
push:
5+
branches:
6+
- b4s4
7+
pull_request:
8+
branches:
9+
- b4s4
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+
run: |
19+
git clone https://github.com/Evolution-X-Devices/kernel_google_b4s4 -b vic
20+
cd kernel_google_b4s4
21+
22+
- name: 📅 Export date of build
23+
run: |
24+
echo "DATE=$(date +%d%m%Y)" >> $GITHUB_ENV
25+
26+
- name: 🔄 Update KernelSU-Next
27+
run: |
28+
rm -rf KernelSU-Next
29+
git clone https://github.com/KernelSU-Next/KernelSU-Next -b v1.0.5
30+
31+
- name: 📥 Clone AnyKernel3
32+
run: |
33+
git clone -b b4s4 https://github.com/Oneloutre/AnyKernel3.git anykernel
34+
rm -rf anykernel/.git
35+
36+
- name: 📦 Install dépendencies
37+
run: |
38+
sudo apt-get update -y -qq
39+
sudo apt-get install -y --no-install-recommends \
40+
python3-pip \
41+
git \
42+
zip \
43+
unzip \
44+
gcc \
45+
g++ \
46+
make \
47+
ninja-build \
48+
file \
49+
bc \
50+
bison \
51+
flex \
52+
libfl-dev \
53+
libssl-dev \
54+
libelf-dev \
55+
wget \
56+
build-essential \
57+
python3-dev \
58+
python3-setuptools \
59+
rsync \
60+
ccache \
61+
llvm-dev
62+
sudo apt install flex libncurses6 libncurses5 binutils-aarch64-linux-gnu device-tree-compiler \
63+
android-sdk-libsparse-utils
64+
sudo apt install -y gcc-arm-linux-gnueabi
65+
echo "CROSS_COMPILE_ARM32=arm-linux-gnueabi-" >> $GITHUB_ENV
66+
67+
- name: 🔧 Install Clang from a Github action
68+
uses: KyleMayes/install-llvm-action@v2
69+
with:
70+
version: "18.1.8"
71+
directory: ${{ runner.temp }}/llvm
72+
73+
- name: 🔧 Add Clang to the PATH
74+
run: |
75+
echo "${{ runner.temp }}/llvm/bin" >> $GITHUB_PATH
76+
77+
- name: 🛠 Use repo's mkdtimg
78+
run: |
79+
chmod +x tools/mkdtimg
80+
sudo mv tools/mkdtimg /usr/local/bin/mkdtimg
81+
82+
- name: 🔍 Device's codename and kernel's version
83+
run: |
84+
DEVICE_CODENAME=sargo-bonito
85+
KERNEL_VERSION=$(make kernelversion)
86+
87+
echo "Device Codename: $DEVICE_CODENAME"
88+
echo "Kernel Version: $KERNEL_VERSION"
89+
90+
echo "DEVICE_CODENAME=$DEVICE_CODENAME" >> $GITHUB_ENV
91+
echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV
92+
93+
- name: 🚀 Enable ccache to speed the build up
94+
uses: hendrikmuhs/ccache-action@v1.2
95+
with:
96+
max-size: 7G
97+
98+
- name: 🛠️ Build the kramel
99+
run: |
100+
export ARCH=arm64
101+
export SUBARCH=arm64
102+
export KBUILD_COMPILER_STRING=$(clang --version | head -n 1)
103+
export CCACHE_EXEC=$(which ccache)
104+
export KBUILD_BUILD_HOST="Caelum-Github-actions-Onelots"
105+
106+
make O=out ARCH=arm64 bonito_defconfig vendor/kernelsu.config V=1
107+
make O=out ARCH=arm64 olddefconfig
108+
./scripts/config --file out/.config -e CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE
109+
110+
make -j$(nproc --all) O=out \
111+
ARCH=arm64 \
112+
CC="ccache clang" \
113+
LLVM=1 \
114+
LLVM_IAS=1 \
115+
CLANG_TRIPLE=aarch64-linux-gnu- \
116+
CROSS_COMPILE=aarch64-linux-android- \
117+
CROSS_COMPILE_ARM32=arm-linux-androideabi-
118+
119+
- name: 🚀 Copy the compiled kernel to AnyKernel3 then create the zip
120+
run: |
121+
ZIP_NAME="Kernel-Caelum-${DEVICE_CODENAME}-${KERNEL_VERSION}-$(date +%d%m%Y).zip"
122+
123+
cp out/arch/arm64/boot/Image.lz4-dtb anykernel/
124+
125+
cd anykernel && zip -r9 $ZIP_NAME ./*
126+
mv $ZIP_NAME ../
127+
128+
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
129+
130+
- name: 🤌 Copy zip file to get 2 different zip files
131+
run: |
132+
133+
ZIP_ALTERNATIVE="KernelSU-Next-Caelum-${DEVICE_CODENAME}-latest.zip"
134+
cp ${ZIP_NAME} $ZIP_ALTERNATIVE
135+
136+
echo "Copied ${ZIP_NAME} as $ZIP_ALTERNATIVE"
137+
echo "ZIP_ALTERNATIVE=$ZIP_ALTERNATIVE" >> $GITHUB_ENV
138+
139+
- name: 📤 Publish github release
140+
uses: softprops/action-gh-release@v2
141+
with:
142+
files: ${{ env.ZIP_ALTERNATIVE }}
143+
tag_name: "latest"
144+
draft: false
145+
prerelease: false
146+
147+
- name: 📤 Publish with tag associated to the kernel and the date
148+
uses: softprops/action-gh-release@v2
149+
with:
150+
files: ${{ env.ZIP_NAME }}
151+
tag_name: Kernel-Caelum-${{ env.DEVICE_CODENAME }}-${{ env.KERNEL_VERSION }}-${{ env.DATE }}
152+
draft: false
153+
prerelease: false
154+
155+
- name: 🚀 Notify people on Discord
156+
env:
157+
DEVICE_CODENAME: ${{ env.DEVICE_CODENAME }}
158+
KERNEL_VERSION: ${{ env.KERNEL_VERSION }}
159+
WEBHOOK: ${{ secrets.WEBHOOK }}
160+
NAME: ${{ env.ZIP_NAME }}
161+
run: |
162+
python3 .github/webhook.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Caelum Kernel for Google Pixel 3a • 3a XL | b4s4

0 commit comments

Comments
 (0)