Kernel Builder #14
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: Kernel Builder | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Kernel Builder | |
| runs-on: ubuntu-latest | |
| env: | |
| CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" | |
| CCACHE_NOHASHDIR: "true" | |
| CCACHE_HARDLINK: "true" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup packages | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get -y install \ | |
| repo bc bison build-essential curl ccache coreutils flex g++-multilib gcc-multilib git gnupg \ | |
| gperf libxml2 lib32z1-dev liblz4-tool libncurses-dev libsdl1.2-dev libwxgtk3.2-dev imagemagick \ | |
| lunzip lzop schedtool squashfs-tools xsltproc zip zlib1g-dev perl xmlstarlet virtualenv xz-utils \ | |
| jq pngcrush git-lfs openjdk-11-jdk wget lib32readline-dev libssl-dev libxml2-utils \ | |
| android-sdk-libsparse-utils lld libc6-dev-i386 x11proto-core-dev libx11-dev libgl1-mesa-dev \ | |
| unzip fontconfig ca-certificates cpio bsdmainutils lz4 aria2 rclone ssh-client \ | |
| rsync python-is-python3 libarchive-tools python3 zstd | |
| - name: Set swap to 10G | |
| uses: pierotofy/set-swap-space@master | |
| with: | |
| swap-size-gb: 10 | |
| - name: Clone kernel repo | |
| run: | | |
| git clone https://github.com/Starrykernel/kernel_xiaomi_veux.git -b 16-Q2-KSU kernel --depth=1 | |
| cd kernel | |
| - name: Build | |
| run: | | |
| cd kernel | |
| chmod +x ./build.sh | |
| echo "Building kernel" | |
| ./build.sh | |
| - name: Extract Version Info | |
| id: extract_version_info | |
| run: | | |
| FILE_NAME=$(basename kernel/builds/*.zip) | |
| KERNEL_NAME=$(echo $FILE_NAME | cut -d'-' -f4) | |
| VERSION=$(echo $FILE_NAME | cut -d'-' -f5) | |
| DEVICE=$(echo $FILE_NAME | cut -d'-' -f6) | |
| echo "KERNEL_NAME=${KERNEL_NAME}" >> $GITHUB_ENV | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| echo "DEVICE=${DEVICE}" >> $GITHUB_ENV | |
| - name: Create Release Notes | |
| run: | | |
| touch release_notes.txt | |
| echo "## Release Notes" > release_notes.txt | |
| echo "- Initial Release" >> release_notes.txt | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: kernel/builds/*.zip | |
| tag: "${{ github.run_number }}" | |
| name: "Release ${{ env.VERSION }}" | |
| token: ${{ secrets.PAT_TOKEN }} | |
| bodyFile: release_notes.txt |