main.yml 8.3 KB

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