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