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