main.yml 7.9 KB

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