Test #13
This file contains hidden or 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: Test | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "AzusaHana" | |
| git config --global user.email "chenyue2330@gmail.com" | |
| - name: Clean up disk space | |
| run: | | |
| sudo apt-get clean | |
| sudo rm -rf /usr/share/dotnet /etc/mysql /var/lib/mysql | |
| sudo rm -rf /usr/local/lib/android | |
| df -h | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3 git curl | |
| - name: Install repo tool | |
| run: | | |
| curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo | |
| chmod a+x ~/repo | |
| sudo mv ~/repo /usr/local/bin/repo | |
| - name: Initialize repo and sync | |
| run: | | |
| mkdir kernel_workspace && cd kernel_workspace | |
| repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b refs/heads/oneplus/sm8650 -m oneplus12_v.xml --depth=1 | |
| repo sync | |
| - name: Set up KernelSU | |
| run: | | |
| cd kernel_workspace/kernel_platform | |
| echo "[+] KernelSU setup" | |
| if [ ! -d "$GITHUB_WORKSPACE/KernelSU" ]; then | |
| echo "[+] Cloning KernelSU repository" | |
| git clone https://github.com/tiann/KernelSU.git $GITHUB_WORKSPACE/KernelSU | |
| else | |
| echo "[+] KernelSU repository already cloned" | |
| fi | |
| GKI_ROOT=$(pwd) | |
| echo "[+] GKI_ROOT: $GKI_ROOT" | |
| echo "[+] Copy KernelSU driver to $GKI_ROOT/common/drivers" | |
| ln -sf $GITHUB_WORKSPACE/KernelSU/kernel $GKI_ROOT/common/drivers/kernelsu | |
| echo "[+] Add KernelSU driver to Makefile" | |
| DRIVER_MAKEFILE=$GKI_ROOT/common/drivers/Makefile | |
| DRIVER_KCONFIG=$GKI_ROOT/common/drivers/Kconfig | |
| grep -q "kernelsu" "$DRIVER_MAKEFILE" || printf "\nobj-\$(CONFIG_KSU) += kernelsu/\n" >> "$DRIVER_MAKEFILE" | |
| grep -q "kernelsu" "$DRIVER_KCONFIG" || sed -i "/endmenu/i\\source \"drivers/kernelsu/Kconfig\"" "$DRIVER_KCONFIG" | |
| echo "[+] Apply KernelSU patches" | |
| cd $GKI_ROOT/common/ && git apply $GITHUB_WORKSPACE/KernelSU/.github/patches/$PATCH_PATH/*.patch || echo "[-] No patch found" | |
| if [ "$IS_DEBUG_KERNEL" = "true" ]; then | |
| echo "[+] Enable debug features for kernel" | |
| printf "\nccflags-y += -DCONFIG_KSU_DEBUG\n" >> $GITHUB_WORKSPACE/KernelSU/kernel/Makefile | |
| fi | |
| repo status | |
| echo "[+] KernelSU setup done." | |
| - name: Symbol magic | |
| run: | | |
| echo "[+] Export all symbol from abi_gki_aarch64.xml" | |
| COMMON_ROOT=$GITHUB_WORKSPACE/kernel_platform/common | |
| KSU_ROOT=$GITHUB_WORKSPACE/KernelSU | |
| ABI_XML=$COMMON_ROOT/android/abi_gki_aarch64.xml | |
| SYMBOL_LIST=$COMMON_ROOT/android/abi_gki_aarch64 | |
| # python3 $KSU_ROOT/scripts/abi_gki_all.py $ABI_XML > $SYMBOL_LIST | |
| echo "[+] Add KernelSU symbols" | |
| cat $KSU_ROOT/kernel/export_symbol.txt | awk '{sub("[ \t]+","");print " "$0}' >> $SYMBOL_LIST | |
| - name: Make working directory clean to avoid dirty | |
| working-directory: kernel_platform | |
| run: | | |
| rm common/android/abi_gki_protected_exports_* || echo "No protected exports!" | |
| cd common/ && git add -A && git commit -a -m "Add KernelSU" | |
| repo status | |
| - name: Build kernel | |
| run: | | |
| cd kernel_workspace | |
| ./kernel_platform/oplus/build/oplus_build_kernel.sh pineapple gki | |
| - name: Make AnyKernel3 | |
| run: | | |
| git clone https://github.com/Kernel-SU/AnyKernel3 --depth=1 | |
| rm -rf ./AnyKernel3/.git | |
| cp kernel_workspace/kernel_platform/out/msm-kernel-pineapple-gki/dist/Image ./AnyKernel3/ | |
| - name: Upload AnyKernel3 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AnyKernel3-Test | |
| path: ./AnyKernel3/* | |
| - name: Upload kernel Image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Image | |
| path: kernel_workspace/kernel_platform/out/msm-kernel-pineapple-gki/dist/Image | |
| - name: Upload boot.img | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: boot.img | |
| path: kernel_workspace/kernel_platform/out/msm-kernel-pineapple-gki/dist/boot.img |