main.yml 7.4 KB

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