main.yml 9.8 KB

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