main.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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: false
  27. # Build Selection
  28. build_a12_5_10:
  29. description: "Android 12 - 5.10"
  30. type: boolean
  31. default: true
  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: true
  40. build_a14_5_15:
  41. description: "Android 14 - 5.15"
  42. type: boolean
  43. default: true
  44. build_a14_6_1:
  45. description: "Android 14 - 6.1"
  46. type: boolean
  47. default: true
  48. build_a15_6_6:
  49. description: "Android 15 - 6.6"
  50. type: boolean
  51. default: true
  52. build_a16_6_12:
  53. description: "Android 16 - 6.12"
  54. type: boolean
  55. default: true
  56. build_custom:
  57. description: "Custom Builds"
  58. type: boolean
  59. default: true
  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. if: always()
  127. runs-on: ubuntu-latest
  128. needs:
  129. - build-a12-5-10
  130. - build-a13-5-10
  131. - build-a13-5-15
  132. - build-a14-5-15
  133. - build-a14-6-1
  134. - build-a15-6-6
  135. - build-a16-6-12
  136. - build-custom
  137. steps:
  138. - name: Download Misc Artifacts
  139. uses: actions/download-artifact@v5
  140. with:
  141. path: ./downloaded-artifacts
  142. pattern: '*-Normal-Misc'
  143. - name: Process Reject Artifacts
  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. else
  170. echo "No rejects found to upload."
  171. fi
  172. - name: Upload AIO-REJ Artifact
  173. uses: actions/upload-artifact@v4
  174. with:
  175. name: AIO-REJ
  176. path: AIO-REJ.zip
  177. if-no-files-found: ignore
  178. release:
  179. runs-on: ubuntu-latest
  180. if: inputs.release_type != 'Actions'
  181. needs:
  182. - build-a12-5-10
  183. - build-a13-5-10
  184. - build-a13-5-15
  185. - build-a14-5-15
  186. - build-a14-6-1
  187. - build-a15-6-6
  188. - build-a16-6-12
  189. - build-custom
  190. env:
  191. GH_TOKEN: ${{ github.token }}
  192. RELEASE_NAME: "GKI Kernels With KernelSU-Next & SUSFS v2.0.0"
  193. RELEASE_BODY: ""
  194. steps:
  195. - name: Checkout code
  196. uses: actions/checkout@v4
  197. - name: Generate New Tag
  198. if: inputs.release_type != 'Actions'
  199. run: |
  200. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  201. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  202. echo "New tag: $NEW_TAG"
  203. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  204. - name: Set release body
  205. run: |
  206. cat << 'EOF' > release_body.md
  207. **IMPORTANT DISCLAIMER**
  208. This software is provided for testing and educational purposes only. Use at your own risk.
  209. The developers are not responsible for any damage, data loss, or issues that may occur.
  210. Please ensure you have proper backups before installation.
  211. 🔹 Normal
  212. - Default kernel configuration
  213. - Standard kernel module loading behavior
  214. - Recommended for most users
  215. 🔹 Bypass
  216. - Includes module check bypass modifications
  217. - 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.
  218. - 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.
  219. - 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.
  220. Features:
  221. -> KernelSU-Next
  222. -> SUSFS ඞ v2.0.0
  223. -> Inline Root Hooks
  224. -> Ptrace Patch Support for Older Kernels (<5.16)
  225. -> IPSet Support for Advanced Network Filtering
  226. -> Wireguard Support
  227. -> BBR v1 Support
  228. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  229. 🔹 BBG (Baseband-guard)
  230. - A lightweight LSM (Linux Security Module) for Android kernel
  231. - Blocks unauthorized writes to critical partitions/device nodes
  232. - Prevents malicious tampering with baseband and boot chain
  233. - Kernel-level protection via LSM hooks
  234. - Reduces risk of soft-brick/hard-brick issues
  235. Kernel Flasher:
  236. -> https://github.com/fatalcoder524/KernelFlasher/
  237. Manager:
  238. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  239. Module:
  240. -> https://github.com/sidex15/ksu_module_susfs
  241. EOF
  242. - name: Create GitHub Release
  243. uses: softprops/action-gh-release@v2
  244. with:
  245. tag_name: ${{ env.NEW_TAG }}
  246. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  247. files: ""
  248. name: ${{ env.RELEASE_NAME }}
  249. body_path: release_body.md
  250. - name: Download Artifacts
  251. uses: actions/download-artifact@v5
  252. with:
  253. path: ./downloaded-artifacts
  254. pattern: '*-AnyKernel3'
  255. - name: Upload Release Assets
  256. run: |+
  257. shopt -s nullglob
  258. anykernel_dirs=(./downloaded-artifacts/*-AnyKernel3/)
  259. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  260. echo "No AnyKernel3 artifact directories found; skipping upload."
  261. exit 0
  262. fi
  263. echo "Found ${#anykernel_dirs[@]} artifacts to process"
  264. # Create all ZIPs in parallel
  265. for dir in "${anykernel_dirs[@]}"; do
  266. artifact_name=$(basename "$dir")
  267. echo "Creating ZIP for $artifact_name..."
  268. (cd "$dir" && zip -r -q -9 "$GITHUB_WORKSPACE/${artifact_name}.zip" ./*) &
  269. done
  270. wait
  271. # Upload all ZIPs
  272. for dir in "${anykernel_dirs[@]}"; do
  273. artifact_name=$(basename "$dir")
  274. echo "Uploading ${artifact_name}.zip..."
  275. gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
  276. done
  277. - name: Send Telegram Notification
  278. if: inputs.release_type != 'Actions'
  279. run: |
  280. RELEASE_TYPE_TEXT=""
  281. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  282. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  283. else
  284. RELEASE_TYPE_TEXT="🚀 *Release*"
  285. fi
  286. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  287. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  288. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  289. -F text="
  290. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  291. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  292. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  293. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  294. -F parse_mode="Markdown"