build-kernel-release.yml 5.5 KB

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