main.yml 10 KB

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