build-kernel-release.yml 6.3 KB

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