main.yml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_dispatch:
  7. inputs:
  8. release_type:
  9. description: "Release Type"
  10. type: choice
  11. options: [ Actions, Pre-Release, Release ]
  12. default: Actions
  13. ksu_variant:
  14. description: "KernelSU Variant"
  15. type: choice
  16. options: [ KSU, WKSU, Next ]
  17. default: KSU
  18. ksu_commit:
  19. description: "KSU Commit (optional)"
  20. type: string
  21. required: false
  22. # Build Selection
  23. build_a12_5_10:
  24. description: "Android 12 - 5.10"
  25. type: boolean
  26. default: true
  27. build_a13_5_10:
  28. description: "Android 13 - 5.10"
  29. type: boolean
  30. default: true
  31. build_a13_5_15:
  32. description: "Android 13 - 5.15"
  33. type: boolean
  34. default: true
  35. build_a14_5_15:
  36. description: "Android 14 - 5.15"
  37. type: boolean
  38. default: true
  39. build_a14_6_1:
  40. description: "Android 14 - 6.1"
  41. type: boolean
  42. default: true
  43. build_a15_6_6:
  44. description: "Android 15 - 6.6"
  45. type: boolean
  46. default: true
  47. build_a16_6_12:
  48. description: "Android 16 - 6.12"
  49. type: boolean
  50. default: true
  51. build_custom:
  52. description: "Custom Builds"
  53. type: boolean
  54. default: true
  55. jobs:
  56. build-a12-5-10:
  57. if: inputs.build_a12_5_10
  58. uses: ./.github/workflows/kernel-a12-5-10.yml
  59. secrets: inherit
  60. with:
  61. ksu_variant: ${{ inputs.ksu_variant }}
  62. ksu_commit: ${{ inputs.ksu_commit }}
  63. build-a13-5-10:
  64. if: inputs.build_a13_5_10
  65. uses: ./.github/workflows/kernel-a13-5-10.yml
  66. secrets: inherit
  67. with:
  68. ksu_variant: ${{ inputs.ksu_variant }}
  69. ksu_commit: ${{ inputs.ksu_commit }}
  70. build-a13-5-15:
  71. if: inputs.build_a13_5_15
  72. uses: ./.github/workflows/kernel-a13-5-15.yml
  73. secrets: inherit
  74. with:
  75. ksu_variant: ${{ inputs.ksu_variant }}
  76. ksu_commit: ${{ inputs.ksu_commit }}
  77. build-a14-5-15:
  78. if: inputs.build_a14_5_15
  79. uses: ./.github/workflows/kernel-a14-5-15.yml
  80. secrets: inherit
  81. with:
  82. ksu_variant: ${{ inputs.ksu_variant }}
  83. ksu_commit: ${{ inputs.ksu_commit }}
  84. build-a14-6-1:
  85. if: inputs.build_a14_6_1
  86. uses: ./.github/workflows/kernel-a14-6-1.yml
  87. secrets: inherit
  88. with:
  89. ksu_variant: ${{ inputs.ksu_variant }}
  90. ksu_commit: ${{ inputs.ksu_commit }}
  91. build-a15-6-6:
  92. if: inputs.build_a15_6_6
  93. uses: ./.github/workflows/kernel-a15-6-6.yml
  94. secrets: inherit
  95. with:
  96. ksu_variant: ${{ inputs.ksu_variant }}
  97. ksu_commit: ${{ inputs.ksu_commit }}
  98. build-a16-6-12:
  99. if: inputs.build_a16_6_12
  100. uses: ./.github/workflows/kernel-a16-612.yml
  101. secrets: inherit
  102. with:
  103. ksu_variant: ${{ inputs.ksu_variant }}
  104. ksu_commit: ${{ inputs.ksu_commit }}
  105. build-custom:
  106. if: inputs.build_custom
  107. uses: ./.github/workflows/kernel-custom.yml
  108. secrets: inherit
  109. with:
  110. ksu_variant: ${{ inputs.ksu_variant }}
  111. ksu_commit: ${{ inputs.ksu_commit }}
  112. release:
  113. runs-on: ubuntu-latest
  114. if: inputs.release_type != 'Actions'
  115. needs:
  116. - build-a12-5-10
  117. - build-a13-5-10
  118. - build-a13-5-15
  119. - build-a14-5-15
  120. - build-a14-6-1
  121. - build-a15-6-6
  122. - build-a16-6-12
  123. - build-custom
  124. env:
  125. GH_TOKEN: ${{ github.token }}
  126. RELEASE_NAME: "GKI Kernels With WKSU & SUSFS v1.5.12"
  127. RELEASE_BODY: ""
  128. steps:
  129. - name: Download Apache Arrow's util_free_space.sh
  130. if: false
  131. run: |
  132. curl -L -o util_free_space.sh https://raw.githubusercontent.com/apache/arrow/main/ci/scripts/util_free_space.sh
  133. chmod +x util_free_space.sh
  134. ./util_free_space.sh
  135. - name: Checkout code
  136. uses: actions/checkout@v4
  137. - name: Generate New Tag
  138. if: inputs.release_type != 'Actions'
  139. run: |
  140. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  141. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  142. echo "New tag: $NEW_TAG"
  143. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  144. - name: Set release body
  145. run: |
  146. cat << 'EOF' > release_body.md
  147. **IMPORTANT DISCLAIMER**
  148. This software is provided for testing and educational purposes only. Use at your own risk.
  149. The developers are not responsible for any damage, data loss, or issues that may occur.
  150. Please ensure you have proper backups before installation.
  151. 🔹 Normal
  152. - Default kernel configuration
  153. - Standard kernel module loading behavior
  154. - Recommended for most users
  155. 🔹 Bypass
  156. - Includes module check bypass modifications
  157. - 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.
  158. - 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.
  159. - 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.
  160. Features:
  161. -> Wild KSU
  162. -> 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)
  163. -> SUSFS ඞ v1.5.12
  164. -> Scope-Minimized Manual hooks v1.4
  165. -> Ptrace Patch Support for Older Kernels (<5.16)
  166. -> IPSet Support for Advanced Network Filtering
  167. -> Wireguard Support
  168. -> BBR v1 Support
  169. -> Added BBG support to prevent unauthorised writes to certain partitions: https://github.com/vc-teahouse/Baseband-guard
  170. 🔹 BBG (Baseband-guard)
  171. - A lightweight LSM (Linux Security Module) for Android kernel
  172. - Blocks unauthorized writes to critical partitions/device nodes
  173. - Prevents malicious tampering with baseband and boot chain
  174. - Kernel-level protection via LSM hooks
  175. - Reduces risk of soft-brick/hard-brick issues
  176. Notes:
  177. -> SUS SU Mode 2 will show as disabled or not compatible due to non-kprobe hooks and is not needed anymore!
  178. -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/
  179. -> **boot.img files**: Available as CI artifacts only - download from the Actions tab in the "Misc" Artifact
  180. -> **Warning**: boot.img files may not boot on some devices
  181. -> **Note:** For detailed commit information and component versions, please check the build summary in the "Misc" Artifact
  182. Module:
  183. -> https://github.com/sidex15/ksu_module_susfs
  184. Managers:
  185. -> WKSU: https://github.com/WildKernels/Wild_KSU
  186. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  187. EOF
  188. - name: Create GitHub Release
  189. uses: softprops/action-gh-release@v2
  190. with:
  191. tag_name: ${{ env.NEW_TAG }}
  192. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  193. files: ""
  194. name: ${{ env.RELEASE_NAME }}
  195. body_path: release_body.md
  196. - name: Download Artifacts
  197. uses: actions/download-artifact@v5
  198. with:
  199. path: ./downloaded-artifacts
  200. pattern: '*-AnyKernel3'
  201. - name: Upload Release Assets
  202. run: |+
  203. shopt -s nullglob
  204. anykernel_dirs=(./downloaded-artifacts/*-AnyKernel3/)
  205. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  206. echo "No AnyKernel3 artifact directories found; skipping upload."
  207. exit 0
  208. fi
  209. echo "Found ${#anykernel_dirs[@]} artifacts to process"
  210. # Create all ZIPs in parallel
  211. for dir in "${anykernel_dirs[@]}"; do
  212. artifact_name=$(basename "$dir")
  213. echo "Creating ZIP for $artifact_name..."
  214. (cd "$dir" && zip -r -q -9 "$GITHUB_WORKSPACE/${artifact_name}.zip" ./*) &
  215. done
  216. wait
  217. # Upload all ZIPs
  218. for dir in "${anykernel_dirs[@]}"; do
  219. artifact_name=$(basename "$dir")
  220. echo "Uploading ${artifact_name}.zip..."
  221. gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
  222. done
  223. - name: Send Telegram Notification
  224. if: inputs.release_type != 'Actions'
  225. run: |
  226. RELEASE_TYPE_TEXT=""
  227. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  228. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  229. else
  230. RELEASE_TYPE_TEXT="🚀 *Release*"
  231. fi
  232. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  233. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  234. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  235. -F text="
  236. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  237. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  238. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  239. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  240. -F parse_mode="Markdown"