main.yml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. # push:
  7. # branches:
  8. # - main
  9. # paths:
  10. # - '.github/workflows/**'
  11. # pull_request:
  12. # branches:
  13. # - main
  14. # paths:
  15. # - '.github/workflows/**'
  16. workflow_dispatch:
  17. inputs:
  18. release_type:
  19. description: "Choose Release Type"
  20. required: true
  21. type: choice
  22. options:
  23. - Actions
  24. - Pre-Release
  25. - Release
  26. - Release (No Artifacts)
  27. default: Actions
  28. build_selection:
  29. description: "Choose which kernels to build"
  30. required: true
  31. type: choice
  32. options:
  33. - All
  34. - Android12-5.10
  35. - Android13-5.10
  36. - Android13-5.15
  37. - Android14-5.15
  38. - Android14-6.1
  39. - Android15-6.6
  40. - Build Test
  41. default: All
  42. jobs:
  43. build-a12-5-10:
  44. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android12-5.10') && inputs.release_type != 'Release (No Artifacts)'
  45. uses: ./.github/workflows/kernel-a12-5-10.yml
  46. secrets: inherit
  47. build-a13-5-10:
  48. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android13-5.10') && inputs.release_type != 'Release (No Artifacts)'
  49. uses: ./.github/workflows/kernel-a13-5-10.yml
  50. secrets: inherit
  51. build-a13-5-15:
  52. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android13-5.15') && inputs.release_type != 'Release (No Artifacts)'
  53. uses: ./.github/workflows/kernel-a13-5-15.yml
  54. secrets: inherit
  55. build-a14-5-15:
  56. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android14-5.15') && inputs.release_type != 'Release (No Artifacts)'
  57. uses: ./.github/workflows/kernel-a14-5-15.yml
  58. secrets: inherit
  59. build-a14-6-1:
  60. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android14-6.1') && inputs.release_type != 'Release (No Artifacts)'
  61. uses: ./.github/workflows/kernel-a14-6-1.yml
  62. secrets: inherit
  63. build-a15-6-6:
  64. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Android15-6.6') && inputs.release_type != 'Release (No Artifacts)'
  65. uses: ./.github/workflows/kernel-a15-6-6.yml
  66. secrets: inherit
  67. build-test:
  68. if: inputs.build_selection == 'Build Test'
  69. uses: ./.github/workflows/kernel-build-check.yml
  70. secrets: inherit
  71. release:
  72. runs-on: ubuntu-latest
  73. if: (inputs.build_selection == 'All' || inputs.build_selection == 'Build Test') && (inputs.release_type == 'Release (No Artifacts)' || inputs.release_type != 'Actions')
  74. needs:
  75. - build-a12-5-10
  76. - build-a13-5-10
  77. - build-a13-5-15
  78. - build-a14-5-15
  79. - build-a14-6-1
  80. - build-a15-6-6
  81. env:
  82. GH_TOKEN: ${{ github.token }}
  83. RELEASE_NAME: "GKI Kernels With WKSU & SUSFS v1.5.12"
  84. RELEASE_BODY: ""
  85. steps:
  86. - name: Checkout code
  87. uses: actions/checkout@v4
  88. - name: Generate New Tag
  89. if: inputs.release_type != 'Actions'
  90. run: |
  91. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  92. if [ -z "$LATEST_TAG" ]; then
  93. LATEST_TAG="v1.5.12-r0"
  94. fi
  95. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  96. echo "New tag: $NEW_TAG"
  97. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  98. - name: Download Artifacts
  99. if: inputs.release_type != 'Release (No Artifacts)'
  100. uses: actions/download-artifact@v5
  101. with:
  102. path: ./downloaded-artifacts
  103. pattern: 'WKSU-*-AnyKernel3'
  104. - name: Set release body
  105. run: |
  106. cat << 'EOF' > release_body.md
  107. **IMPORTANT DISCLAIMER**
  108. This software is provided for testing and educational purposes only. Use at your own risk.
  109. The developers are not responsible for any damage, data loss, or issues that may occur.
  110. Please ensure you have proper backups before installation.
  111. 🔹 Normal
  112. - Default kernel configuration
  113. - Standard kernel module loading behavior
  114. - Recommended for most users
  115. 🔹 Bypass
  116. - Includes module check bypass modifications
  117. - 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.
  118. - 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.
  119. - 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.
  120. Features:
  121. -> Wild KSU
  122. -> Multi Manager Support for WKSU, KernelSU-Next! Needs Testing: KSU, MKSU RKSU, xxKSU, KowSU and SukiSU (Best compatibility with WKSU, no support will be provided for other managers)
  123. -> SUSFS ඞ v1.5.12
  124. -> Scope-Minimized Manual hooks v1.4
  125. -> Ptrace Patch Support for Older Kernels (<5.16)
  126. -> IPSet Support for Advanced Network Filtering
  127. -> Wireguard Support
  128. -> BBR v1 Support
  129. -> Added BBG support to prevent unauthorised writes to certain partitions: https://github.com/vc-teahouse/Baseband-guard
  130. 🔹 BBG (Baseband-guard)
  131. - A lightweight LSM (Linux Security Module) for Android kernel
  132. - Blocks unauthorized writes to critical partitions/device nodes
  133. - Prevents malicious tampering with baseband and boot chain
  134. - Kernel-level protection via LSM hooks
  135. - Reduces risk of soft-brick/hard-brick issues
  136. Notes:
  137. -> SUS SU Mode 2 will show as disabled or not compatible due to non-kprobe hooks and is not needed anymore!
  138. -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/
  139. -> **boot.img files**: Available as CI artifacts only (not included in releases) - download from the Actions tab
  140. -> **Warning**: boot.img files may not boot on some devices
  141. -> **Note:** For detailed commit information and component versions, please check the [build summary](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) in the GitHub Actions workflow that generated this release.
  142. Module:
  143. -> https://github.com/sidex15/ksu_module_susfs
  144. Managers:
  145. -> WKSU: https://github.com/WildKernels/Wild_KSU
  146. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  147. EOF
  148. - name: Create GitHub Release
  149. uses: softprops/action-gh-release@v2
  150. with:
  151. tag_name: ${{ env.NEW_TAG }}
  152. prerelease: ${{ inputs.release_type == 'Pre-Release' || inputs.build_selection == 'Build Test' }}
  153. files: ""
  154. name: ${{ env.RELEASE_NAME }}
  155. body_path: release_body.md
  156. - name: Upload Release Assets
  157. if: inputs.release_type != 'Release (No Artifacts)'
  158. run: |
  159. for dir in ./downloaded-artifacts/*/; do
  160. # Check if this is an AnyKernel3 artifact directory
  161. if [[ "$(basename "$dir")" == *"-AnyKernel3" ]]; then
  162. artifact_name=$(basename "$dir")
  163. echo "Creating ZIP for $artifact_name..."
  164. # The entire directory IS the AnyKernel3 content, so zip it directly
  165. zip -r -9 "${artifact_name}.zip" "$dir"
  166. echo "Uploading ${artifact_name}.zip..."
  167. gh release upload ${{ env.NEW_TAG }} "${artifact_name}.zip"
  168. fi
  169. done
  170. - name: Display Files Uploaded
  171. if: inputs.release_type != 'Release (No Artifacts)'
  172. run: |
  173. echo "GitHub release created with the following files:"
  174. ls ./downloaded-artifacts/**/*
  175. - name: Send Telegram Notification
  176. if: inputs.release_type != 'Build Test'
  177. run: |
  178. RELEASE_TYPE_TEXT=""
  179. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  180. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  181. elif [ "${{ inputs.build_selection }}" == "Build Test" ]; then
  182. RELEASE_TYPE_TEXT="🔧 *Build Test*"
  183. elif [ "${{ inputs.release_type }}" == "Release (No Artifacts)" ]; then
  184. RELEASE_TYPE_TEXT="🚀 *Release*"
  185. else
  186. RELEASE_TYPE_TEXT="🚀 *Release*"
  187. fi
  188. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  189. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  190. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  191. -F text="
  192. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  193. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  194. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  195. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  196. -F parse_mode="Markdown"