main.yml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. name: Build GKI
  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. - Pre-Release
  20. - Release
  21. default: Pre-Release
  22. kernel_variant:
  23. description: 'Choose Kernel Variant'
  24. required: true
  25. type: choice
  26. options:
  27. - WKSU
  28. - KSU
  29. - NEXT
  30. default: WKSU
  31. kernelsu_branch:
  32. description: "Choose ksu branch"
  33. required: true
  34. type: choice
  35. options:
  36. - Stable
  37. - Dev
  38. - Other
  39. default: Dev
  40. kernelsu_branch_other:
  41. description: "If 'Other' is selected, specify your custom branch"
  42. required: false
  43. type: string
  44. default: ""
  45. jobs:
  46. build-kernels-a12-5-10:
  47. uses: ./.github/workflows/kernel-a12-5-10.yml
  48. secrets: inherit
  49. with:
  50. kernelsu_variant: ${{ inputs.kernel_variant }}
  51. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  52. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  53. use_make: ${{ inputs.use_make }}
  54. build-kernels-a13-5-10:
  55. uses: ./.github/workflows/kernel-a13-5-10.yml
  56. secrets: inherit
  57. with:
  58. kernelsu_variant: ${{ inputs.kernel_variant }}
  59. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  60. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  61. use_make: ${{ inputs.use_make }}
  62. build-kernels-a13-5-15:
  63. uses: ./.github/workflows/kernel-a13-5-15.yml
  64. secrets: inherit
  65. with:
  66. kernelsu_variant: ${{ inputs.kernel_variant }}
  67. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  68. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  69. use_make: ${{ inputs.use_make }}
  70. build-kernels-a14-5-15:
  71. uses: ./.github/workflows/kernel-a14-5-15.yml
  72. secrets: inherit
  73. with:
  74. kernelsu_variant: ${{ inputs.kernel_variant }}
  75. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  76. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  77. use_make: ${{ inputs.use_make }}
  78. build-kernels-a14-6-1:
  79. uses: ./.github/workflows/kernel-a14-6-1.yml
  80. secrets: inherit
  81. with:
  82. kernelsu_variant: ${{ inputs.kernel_variant }}
  83. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  84. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  85. use_make: ${{ inputs.use_make }}
  86. build-kernels-a15-6-6:
  87. uses: ./.github/workflows/kernel-a15-6-6.yml
  88. secrets: inherit
  89. with:
  90. kernelsu_variant: ${{ inputs.kernel_variant }}
  91. kernelsu_branch: ${{ inputs.kernelsu_branch }}
  92. kernelsu_branch_other: ${{ inputs.kernelsu_branch_other }}
  93. use_make: ${{ inputs.use_make }}
  94. release:
  95. if: ${{ inputs.release_type == 'Release' || inputs.release_type == 'Pre-Release' }}
  96. runs-on: ubuntu-latest
  97. needs:
  98. - build-kernels-a12-5-10
  99. - build-kernels-a13-5-10
  100. - build-kernels-a13-5-15
  101. - build-kernels-a14-5-15
  102. - build-kernels-a14-6-1
  103. - build-kernels-a15-6-6
  104. env:
  105. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  106. RELEASE_NAME: "GKI Kernels With WKSU & SUSFS v1.5.9"
  107. RELEASE_BODY:
  108. steps:
  109. - name: Checkout code
  110. uses: actions/checkout@v4
  111. - name: Get commit hashes and generate commit URLs
  112. run: |
  113. GITLAB_OWNER="simonpunk"
  114. GITLAB_REPO="susfs4ksu"
  115. declare -A BRANCH_MAP=(
  116. ["gki_android12_5_10"]="gki-android12-5.10"
  117. ["gki_android13_5_10"]="gki-android13-5.10"
  118. ["gki_android13_5_15"]="gki-android13-5.15"
  119. ["gki_android14_5_15"]="gki-android14-5.15"
  120. ["gki_android14_6_1"]="gki-android14-6.1"
  121. ["gki_android15_6_6"]="gki-android15-6.6"
  122. )
  123. for var_name in "${!BRANCH_MAP[@]}"; do
  124. branch_name="${BRANCH_MAP[$var_name]}"
  125. COMMIT_HASH=$(git ls-remote https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO.git refs/heads/$branch_name | awk '{ print $1 }')
  126. if [[ -n "$COMMIT_HASH" ]]; then
  127. COMMIT_URL="https://gitlab.com/$GITLAB_OWNER/$GITLAB_REPO/-/commit/$COMMIT_HASH"
  128. echo "$branch_name Commit: $COMMIT_HASH"
  129. echo "$branch_name Commit URL: $COMMIT_URL"
  130. echo "COMMIT_HASH_${var_name}=$COMMIT_HASH" >> "$GITHUB_ENV"
  131. echo "COMMIT_URL_${var_name}=$COMMIT_URL" >> "$GITHUB_ENV"
  132. fi
  133. done
  134. - name: Get KernelSU variant refs and links
  135. run: |
  136. BRANCH="${{ inputs.kernelsu_branch }}"
  137. get_ref() {
  138. local name="$1" repo="$2" path="$3" mode="$4"
  139. if [[ "$mode" == "tag" ]]; then
  140. ref=$(git ls-remote --tags --sort=-v:refname "$repo" | grep -o 'refs/tags/.*' | cut -d/ -f3 | head -n1)
  141. url="https://github.com/$path/releases/tag/$ref"
  142. else
  143. ref=$(git ls-remote "$repo" HEAD | awk '{print $1}')
  144. url="https://github.com/$path/commit/$ref"
  145. fi
  146. echo "${name}_REF=$ref" >> $GITHUB_ENV
  147. echo "${name}_URL=$url" >> $GITHUB_ENV
  148. }
  149. [[ "$BRANCH" == "Stable" ]] && MODE="tag" || MODE="commit"
  150. get_ref "WKSU" "https://github.com/WildKernels/Wild_KSU.git" "WildKernels/Wild_KSU" "$MODE"
  151. get_ref "KSU" "https://github.com/tiann/KernelSU.git" "tiann/KernelSU" "$MODE"
  152. get_ref "NEXT" "https://github.com/KernelSU-Next/KernelSU-Next.git" "KernelSU-Next/KernelSU-Next" "$MODE"
  153. - name: Generate and Create New Tag
  154. run: |
  155. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name')
  156. if [ -z "$LATEST_TAG" ]; then
  157. LATEST_TAG="v1.5.9-r0"
  158. fi
  159. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  160. echo "New tag: $NEW_TAG"
  161. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  162. git tag $NEW_TAG
  163. git push origin $NEW_TAG
  164. - name: Download Artifacts
  165. uses: actions/download-artifact@v4
  166. with:
  167. path: ./downloaded-artifacts
  168. - name: Set release body
  169. run: |
  170. cat << 'EOF' > release_body.md
  171. Features:
  172. -> WKSU Kernels & Others
  173. -> Multi Manager Support for WKSU Manager & KernelSU Next Manager (Only Install One)
  174. -> SUSFS ඞ v1.5.9
  175. -> Scope-Minimized Manual hooks v1.4
  176. -> Magic Mount Support
  177. -> Simple Maphide for LineageOS Detections
  178. -> Futile Maphide for jit-zygote-cache Detections
  179. -> Wireguard Support
  180. -> BBR Support
  181. Notes:
  182. -> WKSU & KernelSU Next, SUS SU Mode 2 will show as disabled or not compatble due to non-kprobe hooks and is not needed anymore!
  183. -> Official Kernel Flasher is broken with latest susfs, try https://github.com/fatalcoder524/KernelFlasher/ or https://github.com/libxzr/HorizonKernelFlasher!
  184. Module:
  185. -> https://github.com/sidex15/ksu_module_susfs
  186. Managers:
  187. -> WKSU: https://github.com/WildKernels/Wild_KSU
  188. -> KernelSU: https://github.com/tiann/KernelSU
  189. -> KernelSU-Next: https://github.com/KernelSU-Next/KernelSU-Next
  190. Commit Hashes (at the time of release):
  191. -> WKSU: [${{ env.WKSU_REF }}](${{ env.WKSU_URL }})
  192. -> KernelSU: [${{ env.KSU_REF }}](${{ env.KSU_URL }})
  193. -> KernelSU Next: [${{ env.NEXT_REF }}](${{ env.NEXT_URL }})
  194. -> SUSFS4KSU:
  195. -> gki-android12-5.10: [${{ env.COMMIT_HASH_gki_android12_5_10 }}](${{ env.COMMIT_URL_gki_android12_5_10 }})
  196. -> gki-android13-5.10: [${{ env.COMMIT_HASH_gki_android13_5_10 }}](${{ env.COMMIT_URL_gki_android13_5_10 }})
  197. -> gki-android13-5.15: [${{ env.COMMIT_HASH_gki_android13_5_15 }}](${{ env.COMMIT_URL_gki_android13_5_15 }})
  198. -> gki-android14-5.15: [${{ env.COMMIT_HASH_gki_android14_5_15 }}](${{ env.COMMIT_URL_gki_android14_5_15 }})
  199. -> gki-android14-6.1: [${{ env.COMMIT_HASH_gki_android14_6_1 }}](${{ env.COMMIT_URL_gki_android14_6_1 }})
  200. -> gki-android15-6.6: [${{ env.COMMIT_HASH_gki_android15_6_6 }}](${{ env.COMMIT_URL_gki_android15_6_6 }})
  201. EOF
  202. - name: Create GitHub Release
  203. uses: softprops/action-gh-release@v2
  204. with:
  205. tag_name: ${{ env.NEW_TAG }}
  206. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  207. files: ""
  208. name: ${{ env.RELEASE_NAME }}
  209. body_path: release_body.md
  210. - name: Upload Release Assets
  211. run: |
  212. for file in ./downloaded-artifacts/*-kernel-*/*; do
  213. if [ -d "$file" ]; then
  214. continue
  215. fi
  216. echo "Uploading $file..."
  217. gh release upload ${{ env.NEW_TAG }} "$file"
  218. done
  219. - name: Display Files Uploaded
  220. run: |
  221. echo "GitHub release created with the following files:"
  222. ls ./downloaded-artifacts/**/*
  223. - name: Send Telegram Notification
  224. run: |
  225. curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  226. -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  227. -F message_thread_id="${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}" \
  228. -F text="
  229. 🌽 *New Kernel Release Uploaded*
  230. 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  231. 🗂️ *Branch:* ${{ github.ref_name }}
  232. ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  233. [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  234. -F parse_mode="Markdown"