build-kernel-release.yml 6.1 KB

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