build-kernel-release.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 Next & SUSFS v1.5.3 *TEST BUILD*"
  57. RELEASE_NOTES: |
  58. This release contains KernelSU Next 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. uses: actions/download-artifact@v4
  108. with:
  109. path: ./downloaded-artifacts
  110. # Create GitHub Release and upload files if make_release is true
  111. - name: Create GitHub Release
  112. 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
  113. uses: softprops/action-gh-release@v1
  114. with:
  115. files: ./downloaded-artifacts/*/*
  116. tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
  117. prerelease: true # Mark the release as a pre-release
  118. name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action
  119. body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action
  120. env:
  121. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  122. # Display Files Uploaded
  123. - name: Display Files Uploaded
  124. run: |
  125. echo "GitHub release created with the following files:"
  126. ls ./downloaded-artifacts