name: Build GKI permissions: contents: write actions: write on: workflow_dispatch: inputs: use_make: description: 'Build with MAKE?' required: true type: string default: 'true' release_type: description: "Choose Release Type" required: true type: choice options: - Actions - Pre-Release - Release default: Pre-Release kernel_variant: description: 'Choose Kernel Variant' required: true type: choice options: - WKSU - KSU - NEXT default: WKSU kernelsu_branch: description: "Choose ksu branch" required: true type: choice options: - Stable - Dev - Other default: Dev kernelsu_branch_other: description: "If 'Other' is selected, specify your custom branch" required: false type: string default: "" jobs: build-kernels-a12: uses: ./.github/workflows/kernel-a12.yml secrets: inherit with: kernelsu_variant: ${{ github.event.inputs.kernel_variant }} kernelsu_branch: ${{ github.event.inputs.kernelsu_branch }} kernelsu_branch_other: ${{ github.event.inputs.kernelsu_branch_other }} use_make: ${{ github.event.inputs.use_make }} build-kernels-a13: uses: ./.github/workflows/kernel-a13.yml secrets: inherit with: kernelsu_variant: ${{ github.event.inputs.kernel_variant }} kernelsu_branch: ${{ github.event.inputs.kernelsu_branch }} kernelsu_branch_other: ${{ github.event.inputs.kernelsu_branch_other }} use_make: ${{ github.event.inputs.use_make }} build-kernels-a14: uses: ./.github/workflows/kernel-a14.yml secrets: inherit with: kernelsu_variant: ${{ github.event.inputs.kernel_variant }} kernelsu_branch: ${{ github.event.inputs.kernelsu_branch }} kernelsu_branch_other: ${{ github.event.inputs.kernelsu_branch_other }} use_make: ${{ github.event.inputs.use_make }} build-kernels-a15: uses: ./.github/workflows/kernel-a15.yml secrets: inherit with: kernelsu_variant: ${{ github.event.inputs.kernel_variant }} kernelsu_branch: ${{ github.event.inputs.kernelsu_branch }} kernelsu_branch_other: ${{ github.event.inputs.kernelsu_branch_other }} use_make: ${{ github.event.inputs.use_make }} release: if: ${{ github.event.inputs.release_type == 'Release' || github.event.inputs.release_type == 'Pre-Release' }} runs-on: ubuntu-latest needs: - build-kernels-a12 - build-kernels-a13 - build-kernels-a14 - build-kernels-a15 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_NAME: "GKI Kernels With WildKSU & SUSFS v1.5.9" RELEASE_BODY: steps: - name: Checkout code uses: actions/checkout@v4 - name: Get commit hashes and generate commit URLs run: | GITLAB_OWNER="simonpunk" GITLAB_REPO="susfs4ksu" declare -A BRANCH_MAP=( ["gki_android12_5_10"]="gki-android12-5.10" ["gki_android13_5_10"]="gki-android13-5.10" ["gki_android13_5_15"]="gki-android13-5.15" ["gki_android14_5_15"]="gki-android14-5.15" ["gki_android14_6_1"]="gki-android14-6.1" ["gki_android15_6_6"]="gki-android15-6.6" ) for var_name in "${!BRANCH_MAP[@]}"; do branch_name="${BRANCH_MAP[$var_name]}" COMMIT_HASH=$(git ls-remote https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO.git refs/heads/$branch_name | awk '{ print $1 }') if [[ -n "$COMMIT_HASH" ]]; then COMMIT_URL="https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO/-/commit/$COMMIT_HASH" echo "$branch_name Commit: $COMMIT_HASH" echo "$branch_name Commit URL: $COMMIT_URL" echo "COMMIT_HASH_${var_name}=$COMMIT_HASH" >> "$GITHUB_ENV" echo "COMMIT_URL_${var_name}=$COMMIT_URL" >> "$GITHUB_ENV" fi done - name: Get KernelSU variant refs and links run: | BRANCH="${{ inputs.kernelsu_branch }}" get_ref() { local name="$1" repo="$2" path="$3" mode="$4" if [[ "$mode" == "tag" ]]; then ref=$(git ls-remote --tags --sort=-v:refname "$repo" | grep -o 'refs/tags/.*' | cut -d/ -f3 | head -n1) url="https://github.com/$path/releases/tag/$ref" else ref=$(git ls-remote "$repo" HEAD | awk '{print $1}') url="https://github.com/$path/commit/$ref" fi echo "${name}_REF=$ref" >> $GITHUB_ENV echo "${name}_URL=$url" >> $GITHUB_ENV } [[ "$BRANCH" == "Stable" ]] && MODE="tag" || MODE="commit" get_ref "WILD" "https://github.com/WildKernels/Wild_KSU.git" "WildKernels/Wild_KSU" "$MODE" get_ref "KSU" "https://github.com/tiann/KernelSU.git" "tiann/KernelSU" "$MODE" get_ref "NEXT" "https://github.com/KernelSU-Next/KernelSU-Next.git" "KernelSU-Next/KernelSU-Next" "$MODE" - name: Generate and Create New Tag run: | LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name') if [ -z "$LATEST_TAG" ]; then LATEST_TAG="v1.5.9-r0" fi NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}') echo "New tag: $NEW_TAG" echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV git tag $NEW_TAG git push origin $NEW_TAG - name: Download Artifacts uses: actions/download-artifact@v4 with: path: ./downloaded-artifacts - name: Set release body run: | cat << 'EOF' > release_body.md Features: -> Wild KSU Kernels & Others -> Multi Manager Support for Wild KSU Manager & KernelSU Next Manager (Only Install One) -> SUSFS āļž v1.5.9 -> Scope-Minimized Manual hooks v1.4 -> Magic Mount Support -> Simple Maphide for LineageOS Detections -> Futile Maphide for jit-zygote-cache Detections -> Wireguard Support -> BBR Support Notes: -> Wild KSU & KernelSU Next, SUS SU Mode 2 will show as disabled or not compatble due to non-kprobe hooks and is not needed anymore! -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/ or https://github.com/libxzr/HorizonKernelFlasher! Module: -> https://github.com/sidex15/ksu_module_susfs Managers: -> Wild KSU: https://github.com/WildKernels/Wild_KSU -> KernelSU: https://github.com/tiann/KernelSU -> KernelSU-Next: https://github.com/KernelSU-Next/KernelSU-Next Commit Hashes (at the time of release): -> Wild KSU: [${{ env.WILD_REF }}](${{ env.WILD_URL }}) -> KernelSU: [${{ env.KSU_REF }}](${{ env.KSU_URL }}) -> KernelSU Next: [${{ env.NEXT_REF }}](${{ env.NEXT_URL }}) -> SUSFS4KSU: -> gki-android12-5.10: [${{ env.COMMIT_HASH_gki_android12_5_10 }}](${{ env.COMMIT_URL_gki_android12_5_10 }}) -> gki-android13-5.10: [${{ env.COMMIT_HASH_gki_android13_5_10 }}](${{ env.COMMIT_URL_gki_android13_5_10 }}) -> gki-android13-5.15: [${{ env.COMMIT_HASH_gki_android13_5_15 }}](${{ env.COMMIT_URL_gki_android13_5_15 }}) -> gki-android14-5.15: [${{ env.COMMIT_HASH_gki_android14_5_15 }}](${{ env.COMMIT_URL_gki_android14_5_15 }}) -> gki-android14-6.1: [${{ env.COMMIT_HASH_gki_android14_6_1 }}](${{ env.COMMIT_URL_gki_android14_6_1 }}) -> gki-android15-6.6: [${{ env.COMMIT_HASH_gki_android15_6_6 }}](${{ env.COMMIT_URL_gki_android15_6_6 }}) EOF - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.NEW_TAG }} prerelease: ${{ inputs.release_type == 'Pre-Release' }} files: "" name: ${{ env.RELEASE_NAME }} body_path: release_body.md - name: Upload Release Assets run: | for file in ./downloaded-artifacts/*-kernel-*/*; do if [ -d "$file" ]; then continue fi echo "Uploading $file..." gh release upload ${{ env.NEW_TAG }} "$file" done - name: Display Files Uploaded run: | echo "GitHub release created with the following files:" ls ./downloaded-artifacts/**/* - name: Send Telegram Notification run: | curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \ -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ -F message_thread_id="${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}" \ -F text=" đŸŒŊ *New Kernel Release Uploaded* đŸ“Ļ *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }}) đŸ—‚ī¸ *Branch:* ${{ github.ref_name }} âœī¸ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \ -F parse_mode="Markdown"