build-kernel-release.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. name: Build and Release GKI Kernels
  2. permissions:
  3. contents: write # Allow writing to repository contents (for pushing tags)
  4. actions: write # Allows triggering actions
  5. on:
  6. workflow_dispatch:
  7. inputs:
  8. runner:
  9. description: "Choose the runner"
  10. required: true
  11. default: "ubuntu-22.04"
  12. type: choice
  13. options:
  14. - ubuntu-22.04
  15. - ubuntu-22.04-local
  16. build_a12_5_10:
  17. description: 'Build Android 12 5.10 kernel?'
  18. required: true
  19. type: boolean
  20. default: true
  21. build_a13_5_10:
  22. description: 'Build Android 13 5.10 kernel?'
  23. required: true
  24. type: boolean
  25. default: true
  26. build_a13_5_15:
  27. description: 'Build Android 13 5.15 kernel?'
  28. required: true
  29. type: boolean
  30. default: true
  31. build_a14_5_15:
  32. description: 'Build Android 14 5.15 kernel?'
  33. required: true
  34. type: boolean
  35. default: true
  36. build_a14_6_1:
  37. description: 'Build Android 14 6.1 kernel?'
  38. required: true
  39. type: boolean
  40. default: true
  41. make_release:
  42. description: 'Do you want to create a release?'
  43. required: true
  44. type: boolean
  45. default: false
  46. lto_type:
  47. description: "Choose the lto type"
  48. required: true
  49. type: choice
  50. options:
  51. - none
  52. - thin
  53. - full
  54. default: thin
  55. next_branch:
  56. description: "Choose next branch"
  57. required: true
  58. type: choice
  59. options:
  60. - Stable
  61. - Dev
  62. - Other
  63. default: Stable
  64. next_branch_other:
  65. description: "If 'Other' is selected, specify your custom branch"
  66. required: false
  67. type: string # This input is required if 'Other' is chosen
  68. default: "" # Default is empty, but can be filled in if 'Other' is selected
  69. jobs:
  70. build-kernel-a12-5-10:
  71. uses: ./.github/workflows/build-kernel-a12-5.10.yml
  72. secrets: inherit
  73. if: ${{ inputs.build_a12_5_10 }}
  74. with:
  75. lto_type: ${{ inputs.lto_type }}
  76. next_branch: ${{ inputs.next_branch }}
  77. next_branch_other: ${{ inputs.next_branch_other }}
  78. runner: ${{ inputs.runner }}
  79. build-kernel-a13-5-10:
  80. uses: ./.github/workflows/build-kernel-a13-5.10.yml
  81. secrets: inherit
  82. if: ${{ inputs.build_a13_5_10 }}
  83. with:
  84. lto_type: ${{ inputs.lto_type }}
  85. next_branch: ${{ inputs.next_branch }}
  86. next_branch_other: ${{ inputs.next_branch_other }}
  87. runner: ${{ inputs.runner }}
  88. build-kernel-a13-5-15:
  89. uses: ./.github/workflows/build-kernel-a13-5.15.yml
  90. secrets: inherit
  91. if: ${{ inputs.build_a13_5_15 }}
  92. with:
  93. lto_type: ${{ inputs.lto_type }}
  94. next_branch: ${{ inputs.next_branch }}
  95. next_branch_other: ${{ inputs.next_branch_other }}
  96. runner: ${{ inputs.runner }}
  97. build-kernel-a14-5-15:
  98. uses: ./.github/workflows/build-kernel-a14-5.15.yml
  99. secrets: inherit
  100. if: ${{ inputs.build_a14_5_15 }}
  101. with:
  102. lto_type: ${{ inputs.lto_type }}
  103. next_branch: ${{ inputs.next_branch }}
  104. next_branch_other: ${{ inputs.next_branch_other }}
  105. runner: ${{ inputs.runner }}
  106. build-kernel-a14-6-1:
  107. uses: ./.github/workflows/build-kernel-a14-6.1.yml
  108. secrets: inherit
  109. if: ${{ inputs.build_a14_6_1 }}
  110. with:
  111. lto_type: ${{ inputs.lto_type }}
  112. next_branch: ${{ inputs.next_branch }}
  113. next_branch_other: ${{ inputs.next_branch_other }}
  114. runner: ${{ inputs.runner }}
  115. trigger-release:
  116. runs-on: ubuntu-latest
  117. needs:
  118. - build-kernel-a12-5-10
  119. - build-kernel-a13-5-10
  120. - build-kernel-a13-5-15
  121. - build-kernel-a14-5-15
  122. - build-kernel-a14-6-1
  123. if: ${{ inputs.make_release }}
  124. env:
  125. REPO_OWNER: TheWildJames
  126. REPO_NAME: GKI_KernelSU_SUSFS
  127. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  128. RELEASE_NAME: "*TEST BUILD* GKI Kernels With KernelSU Next & SUSFS v1.5.4 *TEST BUILD*"
  129. RELEASE_NOTES: |
  130. This release contains KernelSU Next and SUSFS v1.5.4
  131. Module:
  132. -> https://github.com/sidex15/ksu_module_susfs
  133. Official Manager:
  134. -> https://github.com/tiann/KernelSU
  135. Non-Official Managers:
  136. -> https://github.com/rifsxd/KernelSU-Next
  137. -> https://github.com/backslashxx/KernelSU
  138. -> https://github.com/rsuntk/KernelSU
  139. -> https://github.com/5ec1cff/KernelSU
  140. -> https://github.com/silvzr/KernelSU
  141. -> https://github.com/sidex15/KernelSU
  142. Features:
  143. [+] KernelSU-Next
  144. [+] SUSFS v1.5.4
  145. [+] Wireguard Support
  146. [+] Maphide LineageOS Detections
  147. [+] Futile Maphide for jit-zygote-cache Detections
  148. [+] Magic Mount Support
  149. Special thanks to the following people for their contributions!
  150. This helps me alot! <3
  151. simonpunk - Created SUSFS!
  152. sidex15 - Created module!
  153. backslashxx - Helped with patches!
  154. 幕落 - Donation!
  155. If you have contributed and are not here please remind me!
  156. steps:
  157. # Checkout the code
  158. - name: Checkout code
  159. uses: actions/checkout@v3
  160. # Get the Latest Tag from GitHub
  161. - name: Generate and Create New Tag
  162. run: |
  163. # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API)
  164. LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name')
  165. if [ -z "$LATEST_TAG" ]; then
  166. LATEST_TAG="v1.5.4-0"
  167. fi
  168. NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}')
  169. # Output the new tag to be used
  170. echo "New tag: $NEW_TAG"
  171. # Set the new tag as an environment variable to be used in later steps
  172. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  173. # Create the tag in the repository
  174. git tag $NEW_TAG
  175. git push origin $NEW_TAG
  176. # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty)
  177. - name: Download Artifacts
  178. uses: actions/download-artifact@v4
  179. with:
  180. path: ./downloaded-artifacts
  181. # Create GitHub Release and upload files if make_release is true
  182. - name: Create GitHub Release
  183. uses: actions/create-release@v1
  184. with:
  185. tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
  186. prerelease: true # Mark the release as a pre-release
  187. release_name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action
  188. body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action
  189. env:
  190. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  191. - name: Upload Release Assets Dynamically
  192. run: |
  193. # Loop through all files in the downloaded-artifacts directory
  194. for file in ./downloaded-artifacts/kernel-*/*; do
  195. # Skip directories
  196. if [ -d "$file" ]; then
  197. continue
  198. fi
  199. # Upload the file to the GitHub release
  200. echo "Uploading $file..."
  201. gh release upload ${{ env.NEW_TAG }} "$file"
  202. done
  203. env:
  204. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  205. NEW_TAG: ${{ env.NEW_TAG }}
  206. # Display Files Uploaded
  207. - name: Display Files Uploaded
  208. run: |
  209. echo "GitHub release created with the following files:"
  210. ls ./downloaded-artifacts/**/*