main.yml 12 KB

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