main.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. # push:
  7. # branches:
  8. # - main
  9. # paths:
  10. # - '.github/workflows/**'
  11. # pull_request:
  12. # branches:
  13. # - main
  14. # paths:
  15. # - '.github/workflows/**'
  16. workflow_dispatch:
  17. inputs:
  18. release_type:
  19. description: "Choose Release Type"
  20. required: true
  21. type: choice
  22. options:
  23. - Actions
  24. - Pre-Release
  25. - Release
  26. default: Actions
  27. build_selection:
  28. description: "Choose which kernels to build"
  29. required: true
  30. type: choice
  31. options:
  32. - All
  33. - Test Build
  34. - Android12-5.10
  35. - Android13-5.10
  36. - Android13-5.15
  37. - Android14-5.15
  38. - Android14-6.1
  39. - Android15-6.6
  40. - Custom
  41. default: All
  42. jobs:
  43. build-test:
  44. if: inputs.build_selection == 'Test Build'
  45. uses: ./.github/workflows/test-build.yml
  46. secrets: inherit
  47. build-a12-5-10:
  48. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android12-5.10')
  49. uses: ./.github/workflows/kernel-a12-5-10.yml
  50. secrets: inherit
  51. build-a13-5-10:
  52. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android13-5.10')
  53. uses: ./.github/workflows/kernel-a13-5-10.yml
  54. secrets: inherit
  55. build-a13-5-15:
  56. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android13-5.15')
  57. uses: ./.github/workflows/kernel-a13-5-15.yml
  58. secrets: inherit
  59. build-a14-5-15:
  60. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android14-5.15')
  61. uses: ./.github/workflows/kernel-a14-5-15.yml
  62. secrets: inherit
  63. build-a14-6-1:
  64. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android14-6.1')
  65. uses: ./.github/workflows/kernel-a14-6-1.yml
  66. secrets: inherit
  67. build-a15-6-6:
  68. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android15-6.6')
  69. uses: ./.github/workflows/kernel-a15-6-6.yml
  70. secrets: inherit
  71. build-custom:
  72. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Custom')
  73. uses: ./.github/workflows/kernel-custom.yml
  74. secrets: inherit
  75. release:
  76. runs-on: ubuntu-latest
  77. if: inputs.release_type != 'Actions'
  78. needs:
  79. - build-a12-5-10
  80. - build-a13-5-10
  81. - build-a13-5-15
  82. - build-a14-5-15
  83. - build-a14-6-1
  84. - build-a15-6-6
  85. - build-custom
  86. env:
  87. GH_TOKEN: ${{ github.token }}
  88. RELEASE_NAME: "GKI Kernels With WKSU & SUSFS v1.5.12"
  89. RELEASE_BODY: ""
  90. steps:
  91. - name: Download Apache Arrow's util_free_space.sh
  92. run: |
  93. curl -L -o util_free_space.sh https://raw.githubusercontent.com/apache/arrow/main/ci/scripts/util_free_space.sh
  94. chmod +x util_free_space.sh
  95. ./util_free_space.sh
  96. - name: Checkout code
  97. uses: actions/checkout@v4
  98. - name: Generate New Tag
  99. if: inputs.release_type != 'Actions'
  100. run: |
  101. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  102. if [ -z "$LATEST_TAG" ]; then
  103. LATEST_TAG="v1.5.12-r0"
  104. fi
  105. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  106. echo "New tag: $NEW_TAG"
  107. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  108. - name: Download Artifacts
  109. uses: actions/download-artifact@v5
  110. with:
  111. path: ./downloaded-artifacts
  112. pattern: '*-AnyKernel3'
  113. - name: Set release body
  114. run: |
  115. cat << 'EOF' > release_body.md
  116. **IMPORTANT DISCLAIMER**
  117. This software is provided for testing and educational purposes only. Use at your own risk.
  118. The developers are not responsible for any damage, data loss, or issues that may occur.
  119. Please ensure you have proper backups before installation.
  120. 🔹 Normal
  121. - Default kernel configuration
  122. - Standard kernel module loading behavior
  123. - Recommended for most users
  124. 🔹 Bypass
  125. - Includes module check bypass modifications
  126. - What are kernel modules? Kernel modules are pieces of code that can be loaded into the kernel at runtime to extend functionality (like device drivers, filesystem support, etc.). These are different from KernelSU/Magisk modules.
  127. - The Problem: Sometimes when installing a custom kernel, the device tries to load a kernel module that fails due to version mismatches, missing dependencies, or signature verification issues. This can cause boot failures or device instability.
  128. - The Solution: This version changes one line from false to true to force load the kernel module, bypassing the failure check that would normally prevent loading.
  129. Features:
  130. -> Wild KSU
  131. -> Multi Manager Support for WKSU, KernelSU-Next! Needs Testing: KSU, MKSU RKSU, xxKSU, KowSU and SukiSU (Best compatibility with WKSU, no support will be provided for other managers)
  132. -> SUSFS ඞ v1.5.12
  133. -> Scope-Minimized Manual hooks v1.4
  134. -> Ptrace Patch Support for Older Kernels (<5.16)
  135. -> IPSet Support for Advanced Network Filtering
  136. -> Wireguard Support
  137. -> BBR v1 Support
  138. -> Added BBG support to prevent unauthorised writes to certain partitions: https://github.com/vc-teahouse/Baseband-guard
  139. 🔹 BBG (Baseband-guard)
  140. - A lightweight LSM (Linux Security Module) for Android kernel
  141. - Blocks unauthorized writes to critical partitions/device nodes
  142. - Prevents malicious tampering with baseband and boot chain
  143. - Kernel-level protection via LSM hooks
  144. - Reduces risk of soft-brick/hard-brick issues
  145. Notes:
  146. -> SUS SU Mode 2 will show as disabled or not compatible due to non-kprobe hooks and is not needed anymore!
  147. -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/
  148. -> **boot.img files**: Available as CI artifacts only - download from the Actions tab in the "Misc" Artifact
  149. -> **Warning**: boot.img files may not boot on some devices
  150. -> **Note:** For detailed commit information and component versions, please check the build summary in the "Misc" Artifact
  151. Module:
  152. -> https://github.com/sidex15/ksu_module_susfs
  153. Managers:
  154. -> WKSU: https://github.com/WildKernels/Wild_KSU
  155. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  156. EOF
  157. - name: Create GitHub Release
  158. uses: softprops/action-gh-release@v2
  159. with:
  160. tag_name: ${{ env.NEW_TAG }}
  161. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  162. files: ""
  163. name: ${{ env.RELEASE_NAME }}
  164. body_path: release_body.md
  165. - name: Upload Release Assets
  166. run: |
  167. shopt -s nullglob
  168. anykernel_dirs=(./downloaded-artifacts/*/)
  169. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  170. echo "No artifact directories found under ./downloaded-artifacts; skipping upload."
  171. else
  172. for dir in "${anykernel_dirs[@]}"; do
  173. # Check if this is an AnyKernel3 artifact directory
  174. if [[ "$(basename "$dir")" == *"-AnyKernel3" ]]; then
  175. artifact_name=$(basename "$dir")
  176. echo "Creating ZIP for $artifact_name..."
  177. # Navigate into the directory and zip its contents directly
  178. cd "$dir"
  179. zip -r -9 "../../${artifact_name}.zip" ./*
  180. cd - > /dev/null
  181. echo "Uploading ${artifact_name}.zip..."
  182. gh release upload ${{ env.NEW_TAG }} "${artifact_name}.zip"
  183. fi
  184. done
  185. fi
  186. - name: Send Telegram Notification
  187. if: inputs.release_type != 'Actions'
  188. run: |
  189. RELEASE_TYPE_TEXT=""
  190. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  191. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  192. else
  193. RELEASE_TYPE_TEXT="🚀 *Release*"
  194. fi
  195. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  196. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  197. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  198. -F text="
  199. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  200. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  201. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  202. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  203. -F parse_mode="Markdown"