main.yml 8.7 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, RKSU]
  17. default: Next
  18. ksu_commit:
  19. description: "KSU Commit (optional)"
  20. type: string
  21. required: false
  22. # Build Selection
  23. build_check:
  24. description: "Build Check"
  25. type: boolean
  26. default: false
  27. build_a12_5_10:
  28. description: "Android 12 - 5.10"
  29. type: boolean
  30. default: false
  31. build_a13_5_10:
  32. description: "Android 13 - 5.10"
  33. type: boolean
  34. default: false
  35. build_a13_5_15:
  36. description: "Android 13 - 5.15"
  37. type: boolean
  38. default: false
  39. build_a14_5_15:
  40. description: "Android 14 - 5.15"
  41. type: boolean
  42. default: false
  43. build_a14_6_1:
  44. description: "Android 14 - 6.1"
  45. type: boolean
  46. default: false
  47. build_a15_6_6:
  48. description: "Android 15 - 6.6"
  49. type: boolean
  50. default: false
  51. build_a16_6_12:
  52. description: "Android 16 - 6.12"
  53. type: boolean
  54. default: false
  55. build_custom:
  56. description: "Custom Builds"
  57. type: boolean
  58. default: true
  59. jobs:
  60. build-check:
  61. if: inputs.build_check
  62. uses: ./.github/workflows/check-builds.yml
  63. secrets: inherit
  64. with:
  65. ksu_variant: ${{ inputs.ksu_variant }}
  66. ksu_commit: ${{ inputs.ksu_commit }}
  67. build-a12-5-10:
  68. if: inputs.build_a12_5_10
  69. uses: ./.github/workflows/kernel-a12-5-10.yml
  70. secrets: inherit
  71. with:
  72. ksu_variant: ${{ inputs.ksu_variant }}
  73. ksu_commit: ${{ inputs.ksu_commit }}
  74. build-a13-5-10:
  75. if: inputs.build_a13_5_10
  76. uses: ./.github/workflows/kernel-a13-5-10.yml
  77. secrets: inherit
  78. with:
  79. ksu_variant: ${{ inputs.ksu_variant }}
  80. ksu_commit: ${{ inputs.ksu_commit }}
  81. build-a13-5-15:
  82. if: inputs.build_a13_5_15
  83. uses: ./.github/workflows/kernel-a13-5-15.yml
  84. secrets: inherit
  85. with:
  86. ksu_variant: ${{ inputs.ksu_variant }}
  87. ksu_commit: ${{ inputs.ksu_commit }}
  88. build-a14-5-15:
  89. if: inputs.build_a14_5_15
  90. uses: ./.github/workflows/kernel-a14-5-15.yml
  91. secrets: inherit
  92. with:
  93. ksu_variant: ${{ inputs.ksu_variant }}
  94. ksu_commit: ${{ inputs.ksu_commit }}
  95. build-a14-6-1:
  96. if: inputs.build_a14_6_1
  97. uses: ./.github/workflows/kernel-a14-6-1.yml
  98. secrets: inherit
  99. with:
  100. ksu_variant: ${{ inputs.ksu_variant }}
  101. ksu_commit: ${{ inputs.ksu_commit }}
  102. build-a15-6-6:
  103. if: inputs.build_a15_6_6
  104. uses: ./.github/workflows/kernel-a15-6-6.yml
  105. secrets: inherit
  106. with:
  107. ksu_variant: ${{ inputs.ksu_variant }}
  108. ksu_commit: ${{ inputs.ksu_commit }}
  109. build-a16-6-12:
  110. if: inputs.build_a16_6_12
  111. uses: ./.github/workflows/kernel-a16-612.yml
  112. secrets: inherit
  113. with:
  114. ksu_variant: ${{ inputs.ksu_variant }}
  115. ksu_commit: ${{ inputs.ksu_commit }}
  116. build-custom:
  117. if: inputs.build_custom
  118. uses: ./.github/workflows/kernel-custom.yml
  119. secrets: inherit
  120. with:
  121. ksu_variant: ${{ inputs.ksu_variant }}
  122. ksu_commit: ${{ inputs.ksu_commit }}
  123. release:
  124. runs-on: ubuntu-latest
  125. if: inputs.release_type != 'Actions'
  126. needs:
  127. - build-a12-5-10
  128. - build-a13-5-10
  129. - build-a13-5-15
  130. - build-a14-5-15
  131. - build-a14-6-1
  132. - build-a15-6-6
  133. - build-a16-6-12
  134. - build-custom
  135. - build-check
  136. env:
  137. GH_TOKEN: ${{ github.token }}
  138. RELEASE_NAME: "GKI Kernels With KernelSU-Next & SUSFS v2.0.0"
  139. RELEASE_BODY: ""
  140. steps:
  141. - name: Checkout code
  142. uses: actions/checkout@v4
  143. - name: Generate New Tag
  144. if: inputs.release_type != 'Actions'
  145. run: |
  146. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  147. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  148. echo "New tag: $NEW_TAG"
  149. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  150. - name: Set release body
  151. run: |
  152. cat << 'EOF' > release_body.md
  153. **IMPORTANT DISCLAIMER**
  154. This software is provided for testing and educational purposes only. Use at your own risk.
  155. The developers are not responsible for any damage, data loss, or issues that may occur.
  156. Please ensure you have proper backups before installation.
  157. 🔹 Normal
  158. - Default kernel configuration
  159. - Standard kernel module loading behavior
  160. - Recommended for most users
  161. 🔹 Bypass
  162. - Includes module check bypass modifications
  163. - 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.
  164. - 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.
  165. - 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.
  166. Features:
  167. -> KernelSU-Next
  168. -> SUSFS ඞ v2.0.0
  169. -> Inline Root Hooks
  170. -> Ptrace Patch Support for Older Kernels (<5.16)
  171. -> IPSet Support for Advanced Network Filtering
  172. -> Wireguard Support
  173. -> BBR v1 Support
  174. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  175. 🔹 BBG (Baseband-guard)
  176. - A lightweight LSM (Linux Security Module) for Android kernel
  177. - Blocks unauthorized writes to critical partitions/device nodes
  178. - Prevents malicious tampering with baseband and boot chain
  179. - Kernel-level protection via LSM hooks
  180. - Reduces risk of soft-brick/hard-brick issues
  181. Kernel Flasher:
  182. -> https://github.com/fatalcoder524/KernelFlasher/
  183. Manager:
  184. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  185. Module:
  186. -> https://github.com/sidex15/ksu_module_susfs
  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"