name: Build Kernel 5.15 on: push: branches: [ "main" ] paths: - '.github/workflows/build-kernel-5.15.yml' - 'kernel/**' pull_request: branches: [ "main" ] paths: - 'kernel/**' jobs: build: strategy: matrix: include: - version: "android13-5.15-41" tag: "android13-5.15-2022-11" os_version: 13.0.0 os_version_level: "2022-11" - version: "android13-5.15-74" tag: "android13-5.15-2022-12" os_version: 13.0.0 os_version_level: "2022-12" name: Build aarch64-${{ matrix.version }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: path: KernelSU - name: Download Kernel Source run: | cd $GITHUB_WORKSPACE git clone https://gerrit.googlesource.com/git-repo mkdir android-kernel && cd android-kernel ../git-repo/repo init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${{ matrix.tag }} ../git-repo/repo sync -j$(nproc --all) echo "[+] KernelSU setup" GKI_ROOT=$(pwd) echo "[+] GKI_ROOT: $GKI_ROOT" echo "[+] Copy kernel su driver to $GKI_ROOT/common/drivers" ln -sf $GITHUB_WORKSPACE/KernelSU/kernel $GKI_ROOT/common/drivers/kernelsu echo "[+] Add kernel su driver to Makefile" DRIVER_MAKEFILE=$GKI_ROOT/common/drivers/Makefile grep -q "kernelsu" $DRIVER_MAKEFILE || echo "obj-y += kernelsu/" >> $DRIVER_MAKEFILE echo "[+] KernelSU setup Done." - name: Build boot.img working-directory: android-kernel run: BUILD_BOOT_IMG=1 SKIP_VENDOR_BOOT=1 KERNEL_BINARY=Image AVB_SIGN_BOOT_IMG=1 AVB_BOOT_PARTITION_SIZE=$((64*1024*1024)) AVB_BOOT_ALGORITHM=SHA256_RSA2048 AVB_BOOT_KEY=prebuilts/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem BOOT_IMAGE_HEADER_VERSION=4 LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh - name: Upload boot.img uses: actions/upload-artifact@v3 with: name: kernel-aarch64-${{ matrix.version }}-boot.img path: android-kernel/out/*/dist/boot.img - name: Upload to telegram env: CHAT_ID: ${{ secrets.CHAT_ID }} CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }} BOT_TOKEN: ${{ secrets.BOT_TOKEN }} MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }} COMMIT_MESSAGE: ${{ github.event.head_commit.message }} COMMIT_URL: ${{ github.event.head_commit.url }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} TITLE: kernel-aarch64-${{ matrix.version }} run: | if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then OUTDIR=android-kernel/out/android13-5.15/dist BOOT=${{ matrix.version }}-boot.img.zip zip $BOOT -j -r $OUTDIR/boot.img pip3 install python-telegram-bot python3 $GITHUB_WORKSPACE/KernelSU/scripts/ksubot.py $BOOT fi