main.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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: WKSU
  18. ksu_commit:
  19. description: "KSU Commit (optional)"
  20. type: string
  21. default: ""
  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: false
  32. build_a13_5_10:
  33. description: "Android 13 - 5.10"
  34. type: boolean
  35. default: false
  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: 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. permissions:
  195. contents: write
  196. needs:
  197. - build-a12-5-10
  198. - build-a13-5-10
  199. - build-a13-5-15
  200. - build-a14-5-15
  201. - build-a14-6-1
  202. - build-a15-6-6
  203. - build-a16-6-12
  204. - build-custom
  205. env:
  206. GH_TOKEN: ${{ github.token }}
  207. RELEASE_NAME: "!!TESTING!! GKI Kernels With KernelSU-Next & SUSFS v2.0.0 !!TESTING!!"
  208. RELEASE_BODY: ""
  209. steps:
  210. - name: Checkout code
  211. uses: actions/checkout@v4
  212. - name: Generate New Tag
  213. if: inputs.release_type != 'Actions'
  214. run: |
  215. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  216. if [[ "$LATEST_TAG" =~ ^(.*)-r([0-9]+)$ ]]; then
  217. VERSION="${BASH_REMATCH[1]}"
  218. REV="${BASH_REMATCH[2]}"
  219. NEW_REV=$((REV + 1))
  220. NEW_TAG="${VERSION}-r${NEW_REV}"
  221. else
  222. NEW_TAG="${LATEST_TAG}-r1"
  223. fi
  224. echo "New tag: $NEW_TAG"
  225. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  226. - name: Set release body
  227. run: |
  228. cat << 'EOF' > release_body.md
  229. !!THIS RELEASE IS A TESTING RELEASE!!
  230. **IMPORTANT DISCLAIMER**
  231. This software is provided for testing and educational purposes only. Use at your own risk.
  232. The developers are not responsible for any damage, data loss, or issues that may occur.
  233. Please ensure you have proper backups before installation.
  234. 🔹 Normal
  235. - Default kernel configuration
  236. - Standard kernel module loading behavior
  237. - Recommended for most users
  238. 🔹 Bypass
  239. - Includes module check bypass modifications
  240. - 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.
  241. - 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.
  242. - 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.
  243. Features:
  244. -> 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.)
  245. -> SUSFS ඞ v2.0.0
  246. -> Hybrid Root Hooks
  247. -> Ptrace Patch Support for Older Kernels (<5.16)
  248. -> IPSet Support for Advanced Network Filtering
  249. -> Wireguard Support
  250. -> BBR v1 Support
  251. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  252. 🔹 BBG (Baseband-guard)
  253. - A lightweight LSM (Linux Security Module) for Android kernel
  254. - Blocks unauthorized writes to critical partitions/device nodes
  255. - Prevents malicious tampering with baseband and boot chain
  256. - Kernel-level protection via LSM hooks
  257. - Reduces risk of soft-brick/hard-brick issues
  258. Kernel Flasher:
  259. -> https://github.com/fatalcoder524/KernelFlasher/
  260. Manager:
  261. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  262. Module:
  263. -> https://github.com/sidex15/ksu_module_susfs
  264. !!THIS RELEASE IS A TESTING RELEASE!!
  265. EOF
  266. - name: Create GitHub Release
  267. run: |
  268. PRERELEASE_FLAG=""
  269. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  270. PRERELEASE_FLAG="--prerelease"
  271. fi
  272. echo "Creating release ${{ env.NEW_TAG }}..."
  273. gh release create "${{ env.NEW_TAG }}" \
  274. --title "${{ env.RELEASE_NAME }}" \
  275. --notes-file release_body.md \
  276. --target "${{ github.sha }}" \
  277. $PRERELEASE_FLAG
  278. - name: Download Artifacts
  279. uses: actions/download-artifact@v5
  280. with:
  281. path: ./downloaded-artifacts
  282. pattern: '*-AnyKernel3'
  283. - name: Upload Release Assets
  284. run: |+
  285. shopt -s nullglob
  286. anykernel_dirs=(./downloaded-artifacts/*-AnyKernel3/)
  287. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  288. echo "No AnyKernel3 artifact directories found; skipping upload."
  289. exit 0
  290. fi
  291. echo "Found ${#anykernel_dirs[@]} artifacts to process"
  292. # Create all ZIPs in parallel
  293. for dir in "${anykernel_dirs[@]}"; do
  294. artifact_name=$(basename "$dir")
  295. echo "Creating ZIP for $artifact_name..."
  296. (cd "$dir" && zip -r -q -9 "$GITHUB_WORKSPACE/${artifact_name}.zip" ./*) &
  297. done
  298. wait
  299. # Upload all ZIPs
  300. for dir in "${anykernel_dirs[@]}"; do
  301. artifact_name=$(basename "$dir")
  302. echo "Uploading ${artifact_name}.zip..."
  303. gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
  304. done
  305. - name: DM Artifacts
  306. if: always()
  307. run: |
  308. # Check for TheWildJames and Normal artifacts
  309. for file in ./*TheWildJames*.zip ./*Normal*.zip; do
  310. if [ -f "$file" ]; then
  311. echo "Sending $file to Telegram DM..."
  312. curl -F chat_id="${{ secrets.TELEGRAM_USER_ID }}" \
  313. -F document=@"$file" \
  314. -F caption="📦 **Build**: $file" \
  315. -F parse_mode="Markdown" \
  316. https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument
  317. fi
  318. done
  319. - name: Send Telegram Notification
  320. if: inputs.release_type != 'Actions'
  321. run: |
  322. RELEASE_TYPE_TEXT=""
  323. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  324. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  325. else
  326. RELEASE_TYPE_TEXT="🚀 *Release*"
  327. fi
  328. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  329. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  330. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  331. -F text="
  332. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  333. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  334. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  335. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  336. -F parse_mode="Markdown"
  337. notify-actions:
  338. runs-on: ubuntu-latest
  339. if: inputs.release_type == 'Actions'
  340. steps:
  341. - name: Send Telegram Notification
  342. run: |
  343. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  344. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  345. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  346. -F text="
  347. 🌽 *New Kernel Actions Build Finished*
  348. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  349. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  350. [🔗 View Action Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" \
  351. -F parse_mode="Markdown"