build-kernel-release.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. jobs:
  39. build-kernel-a12-5-10:
  40. uses: ./.github/workflows/build-kernel-a12-5.10.yml
  41. secrets: inherit
  42. if: ${{ inputs.build_a12_5_10 }}
  43. build-kernel-a13-5-10:
  44. uses: ./.github/workflows/build-kernel-a13-5.10.yml
  45. secrets: inherit
  46. if: ${{ inputs.build_a13_5_10 }}
  47. build-kernel-a13-5-15:
  48. uses: ./.github/workflows/build-kernel-a13-5.15.yml
  49. secrets: inherit
  50. if: ${{ inputs.build_a13_5_15 }}
  51. build-kernel-a14-5-15:
  52. uses: ./.github/workflows/build-kernel-a14-5.15.yml
  53. secrets: inherit
  54. if: ${{ inputs.build_a14_5_15 }}
  55. build-kernel-a14-6-1:
  56. uses: ./.github/workflows/build-kernel-a14-6.1.yml
  57. secrets: inherit
  58. if: ${{ inputs.build_a14_6_1 }}
  59. trigger-release:
  60. runs-on: ubuntu-latest
  61. needs:
  62. - build-kernel-a12-5-10
  63. - build-kernel-a13-5-10
  64. - build-kernel-a13-5-15
  65. - build-kernel-a14-5-15
  66. - build-kernel-a14-6-1
  67. if: ${{ inputs.make_release }}
  68. env:
  69. REPO_OWNER: TheWildJames
  70. REPO_NAME: GKI_KernelSU_SUSFS
  71. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  72. RELEASE_NAME: "*TEST BUILD* GKI Kernels With KernelSU Next & SUSFS v1.5.3 *TEST BUILD*"
  73. RELEASE_NOTES: |
  74. This release contains KernelSU Next and SUSFS v1.5.3
  75. Module:
  76. -> https://github.com/sidex15/ksu_module_susfs
  77. Official Manager:
  78. -> https://github.com/tiann/KernelSU
  79. Non-Official Managers:
  80. -> https://github.com/rifsxd/KernelSU-Next
  81. -> https://github.com/backslashxx/KernelSU
  82. -> https://github.com/rsuntk/KernelSU
  83. -> https://github.com/5ec1cff/KernelSU
  84. -> https://github.com/silvzr/KernelSU
  85. -> https://github.com/sidex15/KernelSU
  86. Features:
  87. [+] KernelSU-Next
  88. [+] SUSFS v1.5.3
  89. [+] Wireguard Support
  90. [+] Maphide LineageOS Detections
  91. [+] Futile Maphide for jit-zygote-cache Detections
  92. [+] Magic Mount Support
  93. Special thanks to the following people for their contributions!
  94. This helps me alot! <3
  95. simonpunk - Created SUSFS!
  96. sidex15 - Created module!
  97. backslashxx - Helped with patches!
  98. 幕落 - Donation!
  99. If you have contributed and are not here please remind me!
  100. steps:
  101. # Checkout the code
  102. - name: Checkout code
  103. uses: actions/checkout@v3
  104. # Get the Latest Tag from GitHub
  105. - name: Generate and Create New Tag
  106. run: |
  107. # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API)
  108. LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name')
  109. if [ -z "$LATEST_TAG" ]; then
  110. LATEST_TAG="v1.5.3-0" # Default to v1.5.3-0 if no tag exists
  111. fi
  112. # Increment the suffix (e.g., v1.5.3-0 becomes v1.5.3-1)
  113. NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}')
  114. # Output the new tag to be used
  115. echo "New tag: $NEW_TAG"
  116. # Set the new tag as an environment variable to be used in later steps
  117. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  118. # Create the tag in the repository
  119. git tag $NEW_TAG
  120. git push origin $NEW_TAG
  121. # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty)
  122. - name: Download Artifacts
  123. uses: actions/download-artifact@v4
  124. with:
  125. path: ./downloaded-artifacts
  126. # Create GitHub Release and upload files if make_release is true
  127. - name: Create GitHub Release
  128. uses: actions/create-release@v1
  129. with:
  130. tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
  131. prerelease: true # Mark the release as a pre-release
  132. release_name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action
  133. body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action
  134. env:
  135. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  136. - name: Upload Release Assets Dynamically
  137. run: |
  138. # Loop through all files in the downloaded-artifacts directory
  139. for file in ./downloaded-artifacts/kernel-*/*; do
  140. # Skip directories
  141. if [ -d "$file" ]; then
  142. continue
  143. fi
  144. # Upload the file to the GitHub release
  145. echo "Uploading $file..."
  146. gh release upload ${{ env.NEW_TAG }} "$file"
  147. done
  148. env:
  149. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  150. NEW_TAG: ${{ env.NEW_TAG }}
  151. # Display Files Uploaded
  152. - name: Display Files Uploaded
  153. run: |
  154. echo "GitHub release created with the following files:"
  155. ls ./downloaded-artifacts/**/*