main.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_dispatch:
  7. inputs:
  8. use_make:
  9. description: 'Build with MAKE?'
  10. required: true
  11. type: boolean
  12. default: true
  13. release_type:
  14. description: "Choose Release Type"
  15. required: true
  16. type: choice
  17. options:
  18. - Actions
  19. - Release
  20. default: Release
  21. jobs:
  22. build-a12-5-10:
  23. uses: ./.github/workflows/kernel-a12-5-10.yml
  24. secrets: inherit
  25. with:
  26. use_make: ${{ inputs.use_make }}
  27. build-a13-5-10:
  28. uses: ./.github/workflows/kernel-a13-5-10.yml
  29. secrets: inherit
  30. with:
  31. use_make: ${{ inputs.use_make }}
  32. build-a13-5-15:
  33. uses: ./.github/workflows/kernel-a13-5-15.yml
  34. secrets: inherit
  35. with:
  36. use_make: ${{ inputs.use_make }}
  37. build-a14-5-15:
  38. uses: ./.github/workflows/kernel-a14-5-15.yml
  39. secrets: inherit
  40. with:
  41. use_make: ${{ inputs.use_make }}
  42. build-a14-6-1:
  43. uses: ./.github/workflows/kernel-a14-6-1.yml
  44. secrets: inherit
  45. with:
  46. use_make: ${{ inputs.use_make }}
  47. build-a15-6-6:
  48. uses: ./.github/workflows/kernel-a15-6-6.yml
  49. secrets: inherit
  50. with:
  51. use_make: ${{ inputs.use_make }}
  52. release:
  53. runs-on: ubuntu-latest
  54. if: ${{ inputs.release_type == 'Release' }}
  55. needs:
  56. - build-a12-5-10
  57. - build-a13-5-10
  58. - build-a13-5-15
  59. - build-a14-5-15
  60. - build-a14-6-1
  61. - build-a15-6-6
  62. env:
  63. GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
  64. RELEASE_NAME: "GKI Kernels With WKSU & SUSFS v1.5.9"
  65. RELEASE_BODY:
  66. steps:
  67. - name: Maximize Build Space
  68. uses: AdityaGarg8/remove-unwanted-software@v5
  69. with:
  70. # remove-dotnet: 'true' # Frees ~2 GB
  71. # remove-android: 'true' # Frees ~9 GB
  72. # remove-haskell: 'true' # Frees ~5.2 GB
  73. # remove-codeql: 'true' # Frees ~5.4 GB
  74. # remove-docker-images: 'true' # Frees ~3.2 GB
  75. # remove-large-packages: 'true' # Frees ~3.1 GB
  76. remove-swapfile: 'true' # Frees ~4 GB
  77. # remove-cached-tools: 'false' # Avoid unless confirmed safe
  78. verbose: 'true' # Enable detailed logging
  79. - name: Checkout code
  80. uses: actions/checkout@v4
  81. - name: Get commit hashes and generate commit URLs
  82. run: |
  83. GITLAB_OWNER="simonpunk"
  84. GITLAB_REPO="susfs4ksu"
  85. declare -A BRANCH_MAP=(
  86. ["gki_android12_5_10"]="gki-android12-5.10"
  87. ["gki_android13_5_10"]="gki-android13-5.10"
  88. ["gki_android13_5_15"]="gki-android13-5.15"
  89. ["gki_android14_5_15"]="gki-android14-5.15"
  90. ["gki_android14_6_1"]="gki-android14-6.1"
  91. ["gki_android15_6_6"]="gki-android15-6.6"
  92. )
  93. for var_name in "${!BRANCH_MAP[@]}"; do
  94. branch_name="${BRANCH_MAP[$var_name]}"
  95. COMMIT_HASH=$(git ls-remote https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO.git refs/heads/$branch_name | awk '{ print $1 }')
  96. if [[ -n "$COMMIT_HASH" ]]; then
  97. COMMIT_URL="https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO/-/commit/$COMMIT_HASH"
  98. echo "$branch_name Commit: $COMMIT_HASH"
  99. echo "$branch_name Commit URL: $COMMIT_URL"
  100. echo "COMMIT_HASH_${var_name}=$COMMIT_HASH" >> "$GITHUB_ENV"
  101. echo "COMMIT_URL_${var_name}=$COMMIT_URL" >> "$GITHUB_ENV"
  102. fi
  103. done
  104. - name: Get KernelSU variant refs and links
  105. run: |
  106. # Get WKSU latest commit from wild branch
  107. WKSU_REF=$(git ls-remote "https://github.com/WildKernels/Wild_KSU.git" refs/heads/wild | awk '{print $1}')
  108. WKSU_URL="https://github.com/WildKernels/Wild_KSU/commit/$WKSU_REF"
  109. echo "WKSU_REF=$WKSU_REF" >> $GITHUB_ENV
  110. echo "WKSU_URL=$WKSU_URL" >> $GITHUB_ENV
  111. - name: Generate and Create New Tag
  112. run: |
  113. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name')
  114. if [ -z "$LATEST_TAG" ]; then
  115. LATEST_TAG="v1.5.9-r0"
  116. fi
  117. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  118. echo "New tag: $NEW_TAG"
  119. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  120. git tag $NEW_TAG
  121. git push origin $NEW_TAG
  122. - name: Download Artifacts
  123. uses: actions/download-artifact@v4
  124. with:
  125. path: ./downloaded-artifacts
  126. - name: Set release body
  127. run: |
  128. cat << 'EOF' > release_body.md
  129. **IMPORTANT DISCLAIMER**
  130. This software is provided for testing and educational purposes only. Use at your own risk.
  131. The developers are not responsible for any damage, data loss, or issues that may occur.
  132. Please ensure you have proper backups before installation.
  133. Features:
  134. -> Wild KSU
  135. -> Multi Manager Support for WKSU Manager & KernelSU-Next Manager (Only Install One)
  136. -> SUSFS ඞ v1.5.9
  137. -> Scope-Minimized Manual hooks v1.4
  138. -> Magic Mount Support
  139. -> Simple Maphide for LineageOS Detections
  140. -> Futile Maphide for jit-zygote-cache Detections
  141. -> Ptrace Patch Support for Older Kernels (<5.16)
  142. -> IPSet Support for Advanced Network Filtering
  143. -> Wireguard Support
  144. -> BBR v1 Support
  145. Notes:
  146. -> SUS SU Mode 2 will show as disabled or not compatble due to non-kprobe hooks and is not needed anymore!
  147. -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/
  148. Module:
  149. -> https://github.com/sidex15/ksu_module_susfs
  150. Managers:
  151. -> WKSU: https://t.me/Wild_Kernels/26618
  152. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  153. Commit Hashes (at the time of release):
  154. -> WKSU: [${{ env.WKSU_REF }}](${{ env.WKSU_URL }})
  155. -> SUSFS4KSU:
  156. -> gki-android12-5.10: [${{ env.COMMIT_HASH_gki_android12_5_10 }}](${{ env.COMMIT_URL_gki_android12_5_10 }})
  157. -> gki-android13-5.10: [${{ env.COMMIT_HASH_gki_android13_5_10 }}](${{ env.COMMIT_URL_gki_android13_5_10 }})
  158. -> gki-android13-5.15: [${{ env.COMMIT_HASH_gki_android13_5_15 }}](${{ env.COMMIT_URL_gki_android13_5_15 }})
  159. -> gki-android14-5.15: [${{ env.COMMIT_HASH_gki_android14_5_15 }}](${{ env.COMMIT_URL_gki_android14_5_15 }})
  160. -> gki-android14-6.1: [${{ env.COMMIT_HASH_gki_android14_6_1 }}](${{ env.COMMIT_URL_gki_android14_6_1 }})
  161. -> gki-android15-6.6: [${{ env.COMMIT_HASH_gki_android15_6_6 }}](${{ env.COMMIT_URL_gki_android15_6_6 }})
  162. EOF
  163. - name: Create GitHub Release
  164. uses: softprops/action-gh-release@v2
  165. with:
  166. tag_name: ${{ env.NEW_TAG }}
  167. prerelease: false
  168. files: ""
  169. name: ${{ env.RELEASE_NAME }}
  170. body_path: release_body.md
  171. - name: Upload Release Assets
  172. run: |
  173. for file in ./downloaded-artifacts/*/*; do
  174. if [ -d "$file" ]; then
  175. continue
  176. fi
  177. echo "Uploading $file..."
  178. gh release upload ${{ env.NEW_TAG }} "$file"
  179. done
  180. - name: Display Files Uploaded
  181. run: |
  182. echo "GitHub release created with the following files:"
  183. ls ./downloaded-artifacts/**/*
  184. - name: Send Telegram Notification
  185. run: |
  186. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  187. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  188. -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  189. -F text="
  190. 🌽 *New Kernel Release Uploaded*
  191. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  192. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  193. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  194. -F parse_mode="Markdown"