trigger-KernelSU-build #123
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: KernelSU Builder | |
| on: | |
| push: | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [trigger-KernelSU-build] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| version: ["LineageOS-20", "Zenitsu", "DivestOS-13", "Sage-Android-14"] | |
| env: | |
| VERSION: ${{ matrix.version }} | |
| ARCH: arm64 | |
| KBUILD_BUILD_HOST: Github-Action | |
| KBUILD_BUILD_USER: "KernelSU_Builder" | |
| CLANG_PATH: ${{ github.workspace }}/kernel/clang/bin | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y python3-pip jq libarchive-tools zip lib32z-dev libghc-bzlib-dev pngcrush ^liblzma.* python-is-python3 libsdl1.2-dev autoconf libxml2-utils wget pkg-config unzip w3m gawk imagemagick libc6-dev gcc-multilib patchelf gzip clang subversion optipng device-tree-compiler ccache gcc ^liblz4-.* lzip rsync automake fastboot python2.7 patch zip pngquant expat lzop libswitch-perl make libcap-dev python2 adb libxml2 bison libxml-simple-perl zlib1g-dev libarchive-tools libtool squashfs-tools gperf ^lzma.* libfl-dev ncurses-dev pwgen flex libtinfo5 minicom liblz4-tool libmpfr-dev libssl-dev lib32ncurses5-dev libbz2-dev lib32z1-dev libgmp-dev git libncurses5-dev dpkg-dev libmpc-dev lftp python2-dev python3 rar git-lfs policycoreutils unrar libncurses5 libbz2-1.0 ncftp tree python-all-dev bzip2 bc ftp software-properties-common tar libgl1-mesa-dev texinfo schedtool curl libexpat1-dev llvm libc6-dev-i386 apt-utils cmake g++-multilib build-essential re2c axel maven xsltproc g++ libx11-dev libxml-sax-base-perl gnupg bash | |
| sudo pip3 install yq | |
| - name: Set up ccache | |
| run: | | |
| echo "/usr/lib/ccache" >> $GITHUB_PATH | |
| echo "USE_CCACHE=1" >> $GITHUB_ENV | |
| - name: Cache ccache | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.ccache | |
| key: ${{ runner.os }}-ccache-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-ccache- | |
| - name: Clone clang and kernel sources | |
| run: | | |
| chmod +x clone.sh | |
| ./clone.sh | |
| - name: Add Clang to PATH | |
| run: | | |
| echo "${CLANG_PATH}" >> $GITHUB_PATH | |
| - name: Compile kernel | |
| run: | | |
| chmod +x build.sh | |
| ./build.sh | |
| - name: Make output directory for kernel | |
| run: | | |
| mkdir outw | |
| mkdir outw/false | |
| mkdir outw/true | |
| - name: Move kernel without KernelSU support to output directory | |
| run: | | |
| chmod +x move.sh | |
| ./move.sh | |
| - name: Clean build environment | |
| run: | | |
| chmod +x clean.sh | |
| ./clean.sh | |
| - name: Set KERNELSU environment variable to true | |
| run: echo "KERNELSU=true" >> $GITHUB_ENV | |
| - name: Set KERNELSU_VERSION environment variable | |
| run: echo "KERNELSU_VERSION=$(cat ksu_version.txt)" >> $GITHUB_ENV | |
| - name: Add KernelSU support to kernel | |
| run: | | |
| chmod +x kernelSU.sh | |
| ./kernelSU.sh | |
| - name: Compile kernel with KernelSU support | |
| run: | | |
| chmod +x build.sh | |
| ./build.sh | |
| - name: Move kernel with KernelSU support to output directory | |
| run: | | |
| chmod +x move.sh | |
| ./move.sh | |
| - name: Clone AnyKernel3 | |
| run: | | |
| chmod +x anykernel.sh | |
| ./anykernel.sh | |
| - name: Set ZIP_NO_KSU and ZIP_KSU environment variables | |
| run: | | |
| echo "ZIP_NO_KSU=${{ env.VERSION }}-NoKernelSU.zip" >> $GITHUB_ENV | |
| echo "ZIP_KSU=${{ env.VERSION }}-KernelSU-$(cat ksu_version.txt).zip" >> $GITHUB_ENV | |
| - name: Make AnyKernel3 zip | |
| run: | | |
| chmod +x makezip.sh | |
| ./makezip.sh | |
| - name: Extract info for release | |
| run: | | |
| chmod +x extract.sh | |
| ./extract.sh | |
| - name: Make a release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| ${{ github.workspace }}/${{ env.ZIP_NO_KSU }} | |
| ${{ github.workspace }}/${{ env.ZIP_KSU }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| name: KernelSU Release - ${{ env.KERNELSU_VERSION }} | |
| tag_name: ${{ github.run_id }} | |
| body: | | |
| **Info:** | |
| - KernelSU Version: ${{ env.KERNELSU_VERSION }}. | |
| **Installation:** | |
| - Download desired zip file. | |
| - Flash the zip file in recovery using sideload or any other method. | |
| <details> | |
| <summary>Build Settings</summary> | |
| ``` | |
| ${{ env.buildsettings }} | |
| ``` | |
| </details> | |
| draft: false | |
| prerelease: false |