main.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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. default: "pershoot"
  22. required: false
  23. build_bypass:
  24. description: "Build Bypass"
  25. type: boolean
  26. default: true
  27. # Build Selection
  28. build_a12_5_10:
  29. description: "Android 12 - 5.10"
  30. type: boolean
  31. default: false
  32. build_a13_5_10:
  33. description: "Android 13 - 5.10"
  34. type: boolean
  35. default: true
  36. build_a13_5_15:
  37. description: "Android 13 - 5.15"
  38. type: boolean
  39. default: false
  40. build_a14_5_15:
  41. description: "Android 14 - 5.15"
  42. type: boolean
  43. default: false
  44. build_a14_6_1:
  45. description: "Android 14 - 6.1"
  46. type: boolean
  47. default: false
  48. build_a15_6_6:
  49. description: "Android 15 - 6.6"
  50. type: boolean
  51. default: false
  52. build_a16_6_12:
  53. description: "Android 16 - 6.12"
  54. type: boolean
  55. default: false
  56. build_custom:
  57. description: "Custom Builds"
  58. type: boolean
  59. default: false
  60. jobs:
  61. build-a12-5-10:
  62. if: inputs.build_a12_5_10
  63. uses: ./.github/workflows/kernel-a12-5-10.yml
  64. secrets: inherit
  65. with:
  66. ksu_variant: ${{ inputs.ksu_variant }}
  67. ksu_commit: ${{ inputs.ksu_commit }}
  68. build_bypass: ${{ inputs.build_bypass }}
  69. build-a13-5-10:
  70. if: inputs.build_a13_5_10
  71. uses: ./.github/workflows/kernel-a13-5-10.yml
  72. secrets: inherit
  73. with:
  74. ksu_variant: ${{ inputs.ksu_variant }}
  75. ksu_commit: ${{ inputs.ksu_commit }}
  76. build_bypass: ${{ inputs.build_bypass }}
  77. build-a13-5-15:
  78. if: inputs.build_a13_5_15
  79. uses: ./.github/workflows/kernel-a13-5-15.yml
  80. secrets: inherit
  81. with:
  82. ksu_variant: ${{ inputs.ksu_variant }}
  83. ksu_commit: ${{ inputs.ksu_commit }}
  84. build_bypass: ${{ inputs.build_bypass }}
  85. build-a14-5-15:
  86. if: inputs.build_a14_5_15
  87. uses: ./.github/workflows/kernel-a14-5-15.yml
  88. secrets: inherit
  89. with:
  90. ksu_variant: ${{ inputs.ksu_variant }}
  91. ksu_commit: ${{ inputs.ksu_commit }}
  92. build_bypass: ${{ inputs.build_bypass }}
  93. build-a14-6-1:
  94. if: inputs.build_a14_6_1
  95. uses: ./.github/workflows/kernel-a14-6-1.yml
  96. secrets: inherit
  97. with:
  98. ksu_variant: ${{ inputs.ksu_variant }}
  99. ksu_commit: ${{ inputs.ksu_commit }}
  100. build_bypass: ${{ inputs.build_bypass }}
  101. build-a15-6-6:
  102. if: inputs.build_a15_6_6
  103. uses: ./.github/workflows/kernel-a15-6-6.yml
  104. secrets: inherit
  105. with:
  106. ksu_variant: ${{ inputs.ksu_variant }}
  107. ksu_commit: ${{ inputs.ksu_commit }}
  108. build_bypass: ${{ inputs.build_bypass }}
  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_bypass: ${{ inputs.build_bypass }}
  117. build-custom:
  118. if: inputs.build_custom
  119. uses: ./.github/workflows/kernel-custom.yml
  120. secrets: inherit
  121. with:
  122. ksu_variant: ${{ inputs.ksu_variant }}
  123. ksu_commit: ${{ inputs.ksu_commit }}
  124. build_bypass: ${{ inputs.build_bypass }}
  125. rej:
  126. runs-on: ubuntu-latest
  127. needs:
  128. - build-a12-5-10
  129. - build-a13-5-10
  130. - build-a13-5-15
  131. - build-a14-5-15
  132. - build-a14-6-1
  133. - build-a15-6-6
  134. - build-a16-6-12
  135. - build-custom
  136. steps:
  137. - name: Download Misc Artifacts
  138. uses: actions/download-artifact@v5
  139. with:
  140. path: ./downloaded-artifacts
  141. pattern: '*-Normal-Misc'
  142. - name: Process Reject Artifacts
  143. if: always()
  144. run: |
  145. mkdir -p aio-rejects
  146. # Iterate over Misc artifacts in downloaded-artifacts
  147. for dir in ./downloaded-artifacts/*-Normal-Misc; do
  148. # Ensure it is a directory
  149. [ -d "$dir" ] || continue
  150. dirname=$(basename "$dir")
  151. echo "Processing $dirname..."
  152. # Check for patch-rejects folder
  153. if [ -d "$dir/patch-rejects" ]; then
  154. echo "Found patch-rejects in $dirname"
  155. # Get original name (remove -Misc suffix)
  156. original_name=${dirname%-Misc}
  157. # Move and rename patch-rejects to aio-rejects/original_name
  158. mv "$dir/patch-rejects" "aio-rejects/$original_name"
  159. else
  160. echo "No patch-rejects found in $dirname"
  161. fi
  162. done
  163. # Zip and upload if we found anything
  164. if [ "$(ls -A aio-rejects)" ]; then
  165. echo "Creating AIO-REJ.zip..."
  166. cd aio-rejects
  167. zip -r -q -9 ../AIO-REJ.zip .
  168. cd ..
  169. echo "Uploading AIO-REJ.zip..."
  170. gh release upload "${{ env.NEW_TAG }}" "AIO-REJ.zip" --clobber
  171. else
  172. echo "No rejects found to upload."
  173. fi
  174. release:
  175. runs-on: ubuntu-latest
  176. if: inputs.release_type != 'Actions'
  177. needs:
  178. - build-a12-5-10
  179. - build-a13-5-10
  180. - build-a13-5-15
  181. - build-a14-5-15
  182. - build-a14-6-1
  183. - build-a15-6-6
  184. - build-a16-6-12
  185. - build-custom
  186. env:
  187. GH_TOKEN: ${{ github.token }}
  188. RELEASE_NAME: "GKI Kernels With KernelSU-Next & SUSFS v2.0.0"
  189. RELEASE_BODY: ""
  190. steps:
  191. - name: Checkout code
  192. uses: actions/checkout@v4
  193. - name: Generate New Tag
  194. if: inputs.release_type != 'Actions'
  195. run: |
  196. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  197. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  198. echo "New tag: $NEW_TAG"
  199. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  200. - name: Set release body
  201. run: |
  202. cat << 'EOF' > release_body.md
  203. **IMPORTANT DISCLAIMER**
  204. This software is provided for testing and educational purposes only. Use at your own risk.
  205. The developers are not responsible for any damage, data loss, or issues that may occur.
  206. Please ensure you have proper backups before installation.
  207. 🔹 Normal
  208. - Default kernel configuration
  209. - Standard kernel module loading behavior
  210. - Recommended for most users
  211. 🔹 Bypass
  212. - Includes module check bypass modifications
  213. - 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.
  214. - 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.
  215. - 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.
  216. Features:
  217. -> KernelSU-Next
  218. -> SUSFS ඞ v2.0.0
  219. -> Inline Root Hooks
  220. -> Ptrace Patch Support for Older Kernels (<5.16)
  221. -> IPSet Support for Advanced Network Filtering
  222. -> Wireguard Support
  223. -> BBR v1 Support
  224. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  225. 🔹 BBG (Baseband-guard)
  226. - A lightweight LSM (Linux Security Module) for Android kernel
  227. - Blocks unauthorized writes to critical partitions/device nodes
  228. - Prevents malicious tampering with baseband and boot chain
  229. - Kernel-level protection via LSM hooks
  230. - Reduces risk of soft-brick/hard-brick issues
  231. Kernel Flasher:
  232. -> https://github.com/fatalcoder524/KernelFlasher/
  233. Manager:
  234. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  235. Module:
  236. -> https://github.com/sidex15/ksu_module_susfs
  237. EOF
  238. - name: Create GitHub Release
  239. uses: softprops/action-gh-release@v2
  240. with:
  241. tag_name: ${{ env.NEW_TAG }}
  242. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  243. files: ""
  244. name: ${{ env.RELEASE_NAME }}
  245. body_path: release_body.md
  246. - name: Download Artifacts
  247. uses: actions/download-artifact@v5
  248. with:
  249. path: ./downloaded-artifacts
  250. pattern: '*-AnyKernel3'
  251. - name: Download Misc Artifacts
  252. uses: actions/download-artifact@v5
  253. with:
  254. path: ./downloaded-artifacts
  255. pattern: '*-Normal-Misc'
  256. - name: Upload Release Assets
  257. run: |+
  258. shopt -s nullglob
  259. anykernel_dirs=(./downloaded-artifacts/*-AnyKernel3/)
  260. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  261. echo "No AnyKernel3 artifact directories found; skipping upload."
  262. exit 0
  263. fi
  264. echo "Found ${#anykernel_dirs[@]} artifacts to process"
  265. # Create all ZIPs in parallel
  266. for dir in "${anykernel_dirs[@]}"; do
  267. artifact_name=$(basename "$dir")
  268. echo "Creating ZIP for $artifact_name..."
  269. (cd "$dir" && zip -r -q -9 "$GITHUB_WORKSPACE/${artifact_name}.zip" ./*) &
  270. done
  271. wait
  272. # Upload all ZIPs
  273. for dir in "${anykernel_dirs[@]}"; do
  274. artifact_name=$(basename "$dir")
  275. echo "Uploading ${artifact_name}.zip..."
  276. gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
  277. done
  278. - name: Send Telegram Notification
  279. if: inputs.release_type != 'Actions'
  280. run: |
  281. RELEASE_TYPE_TEXT=""
  282. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  283. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  284. else
  285. RELEASE_TYPE_TEXT="🚀 *Release*"
  286. fi
  287. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  288. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  289. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  290. -F text="
  291. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  292. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  293. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  294. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  295. -F parse_mode="Markdown"