build-kernel-release.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. Non-Official Managers:
  78. -> https://github.com/rifsxd/KernelSU-Next
  79. Features:
  80. [+] KernelSU-Next
  81. [+] SUSFS v1.5.3
  82. [+] Wireguard Support
  83. [+] Maphide LineageOS Detections
  84. [+] Futile Maphide for jit-zygote-cache Detections
  85. [+] Magic Mount Support
  86. Special thanks to the following people for their contributions!
  87. This helps me alot! <3
  88. simonpunk - Created SUSFS!
  89. sidex15 - Created module!
  90. backslashxx - Helped with patches!
  91. 幕落 - Donation!
  92. If you have contributed and are not here please remind me!
  93. steps:
  94. # Checkout the code
  95. - name: Checkout code
  96. uses: actions/checkout@v3
  97. # Get the Latest Tag from GitHub
  98. - name: Generate and Create New Tag
  99. run: |
  100. # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API)
  101. LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name')
  102. if [ -z "$LATEST_TAG" ]; then
  103. LATEST_TAG="v1.5.3-0" # Default to v1.5.3-0 if no tag exists
  104. fi
  105. # Increment the suffix (e.g., v1.5.3-0 becomes v1.5.3-1)
  106. NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}')
  107. # Output the new tag to be used
  108. echo "New tag: $NEW_TAG"
  109. # Set the new tag as an environment variable to be used in later steps
  110. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  111. # Create the tag in the repository
  112. git tag $NEW_TAG
  113. git push origin $NEW_TAG
  114. # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty)
  115. - name: Download Artifacts
  116. uses: actions/download-artifact@v4
  117. with:
  118. path: ./downloaded-artifacts
  119. # Create GitHub Release and upload files if make_release is true
  120. - name: Create GitHub Release
  121. uses: actions/create-release@v1
  122. with:
  123. tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
  124. prerelease: true # Mark the release as a pre-release
  125. release_name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action
  126. body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action
  127. env:
  128. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  129. - name: Upload Release Assets Dynamically
  130. run: |
  131. # Loop through all files in the downloaded-artifacts directory
  132. for file in ./downloaded-artifacts/kernel-*/*; do
  133. # Skip directories
  134. if [ -d "$file" ]; then
  135. continue
  136. fi
  137. # Upload the file to the GitHub release
  138. echo "Uploading $file..."
  139. gh release upload ${{ env.NEW_TAG }} "$file"
  140. done
  141. env:
  142. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  143. NEW_TAG: ${{ env.NEW_TAG }}
  144. # Display Files Uploaded
  145. - name: Display Files Uploaded
  146. run: |
  147. echo "GitHub release created with the following files:"
  148. ls ./downloaded-artifacts/**/*