main.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_dispatch:
  7. inputs:
  8. release_type:
  9. description: "Choose Release Type"
  10. required: true
  11. type: choice
  12. options:
  13. - Actions
  14. - Pre-Release
  15. - Release
  16. default: Actions
  17. jobs:
  18. build-a12-5-10:
  19. uses: ./.github/workflows/kernel-a12-5-10.yml
  20. secrets: inherit
  21. build-a13-5-10:
  22. uses: ./.github/workflows/kernel-a13-5-10.yml
  23. secrets: inherit
  24. build-a13-5-15:
  25. uses: ./.github/workflows/kernel-a13-5-15.yml
  26. secrets: inherit
  27. build-a14-5-15:
  28. uses: ./.github/workflows/kernel-a14-5-15.yml
  29. secrets: inherit
  30. build-a14-6-1:
  31. uses: ./.github/workflows/kernel-a14-6-1.yml
  32. secrets: inherit
  33. build-a15-6-6:
  34. uses: ./.github/workflows/kernel-a15-6-6.yml
  35. secrets: inherit
  36. release:
  37. runs-on: ubuntu-latest
  38. needs:
  39. - build-a12-5-10
  40. - build-a13-5-10
  41. - build-a13-5-15
  42. - build-a14-5-15
  43. - build-a14-6-1
  44. - build-a15-6-6
  45. env:
  46. GH_TOKEN: ${{ github.token }}
  47. RELEASE_NAME: "!!TESTING!! GKI Kernels With WKSU & SUSFS v1.5.11 !!!TESTING!!!"
  48. RELEASE_BODY:
  49. steps:
  50. - name: Maximize build space
  51. uses: easimon/maximize-build-space@master
  52. with:
  53. root-reserve-mb: 8192
  54. temp-reserve-mb: 2048
  55. remove-dotnet: 'true'
  56. remove-android: 'true'
  57. remove-haskell: 'true'
  58. remove-codeql: 'true'
  59. - name: Checkout code
  60. uses: actions/checkout@v4
  61. - name: Get commit hashes and generate commit URLs
  62. run: |
  63. GITLAB_OWNER="simonpunk"
  64. GITLAB_REPO="susfs4ksu"
  65. declare -A BRANCH_MAP=(
  66. ["gki_android12_5_10"]="gki-android12-5.10"
  67. ["gki_android13_5_10"]="gki-android13-5.10"
  68. ["gki_android13_5_15"]="gki-android13-5.15"
  69. ["gki_android14_5_15"]="gki-android14-5.15"
  70. ["gki_android14_6_1"]="gki-android14-6.1"
  71. ["gki_android15_6_6"]="gki-android15-6.6"
  72. )
  73. for var_name in "${!BRANCH_MAP[@]}"; do
  74. branch_name="${BRANCH_MAP[$var_name]}"
  75. COMMIT_HASH=$(git ls-remote https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO.git refs/heads/$branch_name | awk '{ print $1 }')
  76. if [[ -n "$COMMIT_HASH" ]]; then
  77. COMMIT_URL="https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO/-/commit/$COMMIT_HASH"
  78. echo "$branch_name Commit: $COMMIT_HASH"
  79. echo "$branch_name Commit URL: $COMMIT_URL"
  80. echo "COMMIT_HASH_${var_name}=$COMMIT_HASH" >> "$GITHUB_ENV"
  81. echo "COMMIT_URL_${var_name}=$COMMIT_URL" >> "$GITHUB_ENV"
  82. fi
  83. done
  84. - name: Get KernelSU variant refs and links
  85. run: |
  86. # Get WKSU latest commit from wild branch
  87. WKSU_REF=$(git ls-remote "https://github.com/WildKernels/Wild_KSU.git" refs/heads/wild | awk '{print $1}')
  88. WKSU_URL="https://github.com/WildKernels/Wild_KSU/commit/$WKSU_REF"
  89. echo "WKSU_REF=$WKSU_REF" >> $GITHUB_ENV
  90. echo "WKSU_URL=$WKSU_URL" >> $GITHUB_ENV
  91. # Get Baseband-guard latest commit from main branch
  92. BBG_REF=$(git ls-remote "https://github.com/vc-teahouse/Baseband-guard.git" refs/heads/main | awk '{print $1}')
  93. BBG_URL="https://github.com/vc-teahouse/Baseband-guard/commit/$BBG_REF"
  94. echo "BBG_REF=$BBG_REF" >> $GITHUB_ENV
  95. echo "BBG_URL=$BBG_URL" >> $GITHUB_ENV
  96. - name: Generate and Create New Tag
  97. if: inputs.release_type != 'Actions'
  98. run: |
  99. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name')
  100. if [ -z "$LATEST_TAG" ]; then
  101. LATEST_TAG="v1.5.11-r0"
  102. fi
  103. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  104. echo "New tag: $NEW_TAG"
  105. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  106. git tag $NEW_TAG
  107. git push origin $NEW_TAG
  108. - name: Set tag for Actions only
  109. if: inputs.release_type == 'Actions'
  110. run: |
  111. echo "NEW_TAG=actions-$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV
  112. - name: Download Artifacts
  113. uses: actions/download-artifact@v5
  114. with:
  115. path: ./downloaded-artifacts
  116. pattern: 'WKSU-*-AnyKernel3'
  117. - name: Set release body
  118. run: |
  119. cat << 'EOF' > release_body.md
  120. **IMPORTANT DISCLAIMER**
  121. This software is provided for testing and educational purposes only. Use at your own risk.
  122. The developers are not responsible for any damage, data loss, or issues that may occur.
  123. Please ensure you have proper backups before installation.
  124. NEW:
  125. -> **Module Check Bypass Variant**: Normal build with additional hack for compatibility, if you encounter any issues with the normal build try this!
  126. Features:
  127. -> Wild KSU
  128. -> 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)
  129. -> SUSFS ඞ v1.5.11
  130. -> Scope-Minimized Manual hooks v1.4
  131. -> Ptrace Patch Support for Older Kernels (<5.16)
  132. -> IPSet Support for Advanced Network Filtering
  133. -> Wireguard Support
  134. -> BBR v1 Support
  135. -> Added BBG support to prevent unauthorised writes to certain partitions: https://github.com/vc-teahouse/Baseband-guard
  136. Notes:
  137. -> SUS SU Mode 2 will show as disabled or not compatble 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 Android 16 devices
  141. Module:
  142. -> https://github.com/sidex15/ksu_module_susfs
  143. Managers:
  144. -> WKSU: https://github.com/WildKernels/Wild_KSU
  145. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  146. Commit Hashes (at the time of release):
  147. -> WKSU: [${{ env.WKSU_REF }}](${{ env.WKSU_URL }})
  148. -> Baseband-guard: [${{ env.BBG_REF }}](${{ env.BBG_URL }})
  149. -> SUSFS4KSU:
  150. -> gki-android12-5.10: [${{ env.COMMIT_HASH_gki_android12_5_10 }}](${{ env.COMMIT_URL_gki_android12_5_10 }})
  151. -> gki-android13-5.10: [${{ env.COMMIT_HASH_gki_android13_5_10 }}](${{ env.COMMIT_URL_gki_android13_5_10 }})
  152. -> gki-android13-5.15: [${{ env.COMMIT_HASH_gki_android13_5_15 }}](${{ env.COMMIT_URL_gki_android13_5_15 }})
  153. -> gki-android14-5.15: [${{ env.COMMIT_HASH_gki_android14_5_15 }}](${{ env.COMMIT_URL_gki_android14_5_15 }})
  154. -> gki-android14-6.1: [${{ env.COMMIT_HASH_gki_android14_6_1 }}](${{ env.COMMIT_URL_gki_android14_6_1 }})
  155. -> gki-android15-6.6: [${{ env.COMMIT_HASH_gki_android15_6_6 }}](${{ env.COMMIT_URL_gki_android15_6_6 }})
  156. EOF
  157. - name: Create GitHub Release
  158. if: inputs.release_type != 'Actions'
  159. uses: softprops/action-gh-release@v2
  160. with:
  161. tag_name: ${{ env.NEW_TAG }}
  162. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  163. files: ""
  164. name: ${{ env.RELEASE_NAME }}
  165. body_path: release_body.md
  166. - name: Upload Release Assets
  167. if: inputs.release_type != 'Actions'
  168. run: |
  169. for file in ./downloaded-artifacts/*/*; do
  170. if [ -d "$file" ]; then
  171. continue
  172. fi
  173. echo "Uploading $file..."
  174. gh release upload ${{ env.NEW_TAG }} "$file"
  175. done
  176. - name: Display Files Uploaded
  177. if: inputs.release_type != 'Actions'
  178. run: |
  179. echo "GitHub release created with the following files:"
  180. ls ./downloaded-artifacts/**/*
  181. - name: Send Telegram Notification
  182. if: inputs.release_type != 'Actions'
  183. run: |
  184. RELEASE_TYPE_TEXT=""
  185. if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  186. RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  187. else
  188. RELEASE_TYPE_TEXT="🚀 *Release*"
  189. fi
  190. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  191. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  192. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  193. -F text="
  194. 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  195. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  196. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  197. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  198. -F parse_mode="Markdown"