Update blank.yml #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release Kernel | |
on: | |
push: | |
branches: | |
- main # Trigger the workflow on pushes to the main branch | |
env: | |
ROOT_DIR_PREFIX: "OP12-A15" | |
BRANCH: "android14-6.1" | |
REPO_NAME: "cabagekiller/KSUNext-SUSFS" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 # Fetch only the latest commit | |
- name: Free disk space | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qq curl | |
curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash | |
- name: Add 16GB Swap Space | |
run: | | |
sudo fallocate -l 16G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
free -h | |
- name: Install bpftool and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git build-essential libelf-dev clang llvm linux-headers-$(uname -r) | |
git clone --depth=1 https://github.com/torvalds/linux.git | |
cd linux/tools/bpf/bpftool | |
make | |
sudo cp bpftool /usr/local/bin/ | |
bpftool version | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y zip bc bison flex g++-multilib \ | |
gcc-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev \ | |
libx11-dev lib32z1-dev libgl1-mesa-glx libxml2-utils xsltproc unzip \ | |
dwarves curl pahole make bc libncurses5-dev ccache | |
- name: Install required libraries for pahole | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libdw-dev \ | |
libelf-dev \ | |
zlib1g-dev \ | |
cmake | |
- name: Install Latest Pahole | |
run: | | |
sudo apt-get remove --purge -y dwarves | |
git clone --recurse-submodules https://git.kernel.org/pub/scm/devel/pahole/pahole.git | |
cd pahole | |
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local | |
make | |
sudo make install | |
sudo ldconfig | |
pahole --version | |
shell: bash | |
- name: Validate Kernel Configuration | |
run: | | |
echo "ROOT_DIR_PREFIX is: $ROOT_DIR_PREFIX" # Debug the environment variable | |
cd ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform || { echo "Directory not found! Exiting."; exit 1; } | |
grep CONFIG_DEBUG_INFO_BTF=y ./common/arch/arm64/configs/gki_defconfig || echo "CONFIG_DEBUG_INFO_BTF=y" >> ./common/arch/arm64/configs/gki_defconfig | |
grep CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y ./common/arch/arm64/configs/gki_defconfig || echo "CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
- name: Clean and Prepare Environment | |
run: | | |
cd ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform || { echo "Directory not found! Exiting."; exit 1; } | |
make clean | |
make mrproper | |
- name: Build Kernel | |
run: | | |
cd ./builds/${ROOT_DIR_PREFIX}/oneplus12_v || { echo "Directory not found! Exiting."; exit 1; } | |
export PATH="/usr/lib/ccache:$PATH" | |
./kernel_platform/build_with_bazel.py -t pineapple gki | tee build.log | |
- name: Debug vmlinux BTF | |
run: | | |
if [ -f ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform/out/dist/vmlinux ]; then | |
file ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform/out/dist/vmlinux | |
readelf -a ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform/out/dist/vmlinux | |
else | |
echo "Error: vmlinux file not found!" | |
exit 1 | |
fi | |
- name: Upload Build Logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-logs | |
path: ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/build.log | |
- name: Copy Kernel Image | |
run: | | |
cp ./builds/${ROOT_DIR_PREFIX}/oneplus12_v/kernel_platform/out/dist/Image ./builds/${ROOT_DIR_PREFIX}/AnyKernel3/Image | |
- name: Create ZIP Package | |
run: | | |
cd ./builds/${ROOT_DIR_PREFIX}/AnyKernel3 || { echo "Directory not found! Exiting."; exit 1; } | |
ZIP_NAME="Anykernel3-OP-A15-${BRANCH}-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip" | |
zip -r "../$ZIP_NAME" ./ | |
ls -lh "../$ZIP_NAME" | |
echo "zip_name=$ZIP_NAME" >> $GITHUB_OUTPUT | |
- name: Publish Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./builds/${ROOT_DIR_PREFIX}/$ZIP_NAME | |
tag_name: "v$(date +'%Y.%m.%d-%H%M%S')" | |
name: "OP12 A15 $BRANCH With KernelSUnext & SUSFS" | |
body: "Kernel release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |