main.yml 9.9 KB

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