main.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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: Free Disk Space
  152. if: true
  153. uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
  154. with:
  155. remove_android: true
  156. remove_dotnet: true
  157. remove_haskell: true
  158. remove_tool_cache: true
  159. remove_swap: true
  160. remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
  161. remove_packages_one_command: true
  162. remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
  163. rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
  164. rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
  165. testing: false
  166. - name: Download Misc Artifacts
  167. uses: actions/download-artifact@v5
  168. with:
  169. path: ./downloaded-artifacts
  170. pattern: '*-Normal-Misc'
  171. - name: Process Reject Artifacts
  172. run: |
  173. mkdir -p aio-rejects
  174. # Iterate over Misc artifacts in downloaded-artifacts
  175. for dir in ./downloaded-artifacts/*-Normal-Misc; do
  176. # Ensure it is a directory
  177. [ -d "$dir" ] || continue
  178. dirname=$(basename "$dir")
  179. echo "Processing $dirname..."
  180. # Check for patch-rejects folder
  181. if [ -d "$dir/patch-rejects" ]; then
  182. echo "Found patch-rejects in $dirname"
  183. # Get original name (remove -Misc suffix)
  184. original_name=${dirname%-Misc}
  185. # Move and rename patch-rejects to aio-rejects/original_name
  186. mv "$dir/patch-rejects" "aio-rejects/$original_name"
  187. else
  188. echo "No patch-rejects found in $dirname"
  189. fi
  190. done
  191. # Zip and upload if we found anything
  192. if [ "$(ls -A aio-rejects)" ]; then
  193. echo "Creating AIO-REJ.zip..."
  194. cd aio-rejects
  195. zip -r -q -9 ../AIO-REJ.zip .
  196. cd ..
  197. else
  198. echo "No rejects found to upload."
  199. fi
  200. - name: Upload AIO-REJ Artifact
  201. uses: actions/upload-artifact@v4
  202. with:
  203. name: AIO-REJ
  204. path: AIO-REJ.zip
  205. if-no-files-found: ignore
  206. release:
  207. runs-on: ubuntu-latest
  208. if: inputs.release_type != 'Actions'
  209. needs:
  210. - build-a12-5-10
  211. - build-a13-5-10
  212. - build-a13-5-15
  213. - build-a14-5-15
  214. - build-a14-6-1
  215. - build-a15-6-6
  216. - build-a16-6-12
  217. - build-custom
  218. env:
  219. GH_TOKEN: ${{ github.token }}
  220. RELEASE_NAME: "!!TESTING!! GKI Kernels With KernelSU-Next & SUSFS v2.0.0 !!TESTING!!"
  221. RELEASE_BODY: ""
  222. steps:
  223. - name: Free Disk Space
  224. if: true
  225. uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
  226. with:
  227. remove_android: true
  228. remove_dotnet: true
  229. remove_haskell: true
  230. remove_tool_cache: true
  231. remove_swap: true
  232. remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
  233. remove_packages_one_command: true
  234. remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
  235. rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
  236. rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
  237. testing: false
  238. - name: Checkout code
  239. uses: actions/checkout@v4
  240. - name: Generate New Tag
  241. if: inputs.release_type != 'Actions'
  242. run: |
  243. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  244. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  245. echo "New tag: $NEW_TAG"
  246. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  247. - name: Set release body
  248. run: |
  249. cat << 'EOF' > release_body.md
  250. !!THIS RELEASE IS A TESTING RELEASE!!
  251. **IMPORTANT DISCLAIMER**
  252. This software is provided for testing and educational purposes only. Use at your own risk.
  253. The developers are not responsible for any damage, data loss, or issues that may occur.
  254. Please ensure you have proper backups before installation.
  255. 🔹 Normal
  256. - Default kernel configuration
  257. - Standard kernel module loading behavior
  258. - Recommended for most users
  259. 🔹 Bypass
  260. - Includes module check bypass modifications
  261. - 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.
  262. - 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.
  263. - 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.
  264. Features:
  265. -> KernelSU-Next
  266. -> SUSFS ඞ v2.0.0
  267. -> Inline Root Hooks
  268. -> Ptrace Patch Support for Older Kernels (<5.16)
  269. -> IPSet Support for Advanced Network Filtering
  270. -> Wireguard Support
  271. -> BBR v1 Support
  272. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  273. 🔹 BBG (Baseband-guard)
  274. - A lightweight LSM (Linux Security Module) for Android kernel
  275. - Blocks unauthorized writes to critical partitions/device nodes
  276. - Prevents malicious tampering with baseband and boot chain
  277. - Kernel-level protection via LSM hooks
  278. - Reduces risk of soft-brick/hard-brick issues
  279. Kernel Flasher:
  280. -> https://github.com/fatalcoder524/KernelFlasher/
  281. Manager:
  282. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  283. Module:
  284. -> https://github.com/sidex15/ksu_module_susfs
  285. !!THIS RELEASE IS A TESTING RELEASE!!
  286. EOF
  287. - name: Create GitHub Release
  288. uses: softprops/action-gh-release@v2
  289. with:
  290. tag_name: ${{ env.NEW_TAG }}
  291. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  292. files: ""
  293. name: ${{ env.RELEASE_NAME }}
  294. body_path: release_body.md
  295. - name: Download Artifacts
  296. uses: actions/download-artifact@v5
  297. with:
  298. path: ./downloaded-artifacts
  299. pattern: '*-AnyKernel3'
  300. - name: Upload Release Assets
  301. run: |+
  302. shopt -s nullglob
  303. anykernel_dirs=(./downloaded-artifacts/*-AnyKernel3/)
  304. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  305. echo "No AnyKernel3 artifact directories found; skipping upload."
  306. exit 0
  307. fi
  308. echo "Found ${#anykernel_dirs[@]} artifacts to process"
  309. # Create all ZIPs in parallel
  310. for dir in "${anykernel_dirs[@]}"; do
  311. artifact_name=$(basename "$dir")
  312. echo "Creating ZIP for $artifact_name..."
  313. (cd "$dir" && zip -r -q -9 "$GITHUB_WORKSPACE/${artifact_name}.zip" ./*) &
  314. done
  315. wait
  316. # Upload all ZIPs
  317. for dir in "${anykernel_dirs[@]}"; do
  318. artifact_name=$(basename "$dir")
  319. echo "Uploading ${artifact_name}.zip..."
  320. gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
  321. done
  322. - name: Send Telegram Notification
  323. if: inputs.release_type != 'Actions'
  324. run: |
  325. RELEASE_TYPE_TEXT=""
  326. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  327. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  328. else
  329. RELEASE_TYPE_TEXT="🚀 *Release*"
  330. fi
  331. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  332. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  333. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  334. -F text="
  335. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  336. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  337. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  338. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  339. -F parse_mode="Markdown"