build-kernel-release.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. needs:
  47. - build-kernel-a12
  48. - build-kernel-a13
  49. - build-kernel-a14 # Ensure the release only runs after the build jobs complete or are skipped
  50. if: ${{ github.event.inputs.make_release == 'true' }} # Only run if make_release is true or empty
  51. env:
  52. REPO_OWNER: TheWildJames
  53. REPO_NAME: GKI_KernelSU_SUSFS
  54. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  55. RELEASE_NAME: "*TEST BUILD* GKI Kernels With KernelSU & SUSFS v1.5.3 *TEST BUILD*"
  56. RELEASE_NOTES: |
  57. This release contains KernelSU and SUSFS v1.5.3
  58. Module:
  59. -> https://github.com/sidex15/ksu_module_susfs
  60. Official Manager:
  61. -> https://github.com/tiann/KernelSU
  62. Non-Official Managers:
  63. -> https://github.com/rifsxd/KernelSU-Next
  64. -> https://github.com/backslashxx/KernelSU
  65. -> https://github.com/rsuntk/KernelSU
  66. -> https://github.com/5ec1cff/KernelSU
  67. -> https://github.com/silvzr/KernelSU
  68. -> https://github.com/sidex15/KernelSU
  69. Features:
  70. [+] KernelSU-Next
  71. [+] SUSFS v1.5.3
  72. [+] Wireguard Support
  73. [+] Maphide LineageOS Detections
  74. [+] Futile Maphide for jit-zygote-cache Detections
  75. [+] Magic Mount Support
  76. steps:
  77. # Checkout the code
  78. - name: Checkout code
  79. uses: actions/checkout@v3
  80. # Get the Latest Tag from GitHub
  81. - name: Generate and Create New Tag
  82. run: |
  83. # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API)
  84. LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name')
  85. if [ -z "$LATEST_TAG" ]; then
  86. LATEST_TAG="v1.5.3-0" # Default to v1.5.3-0 if no tag exists
  87. fi
  88. # Increment the suffix (e.g., v1.5.3-0 becomes v1.5.3-1)
  89. NEW_TAG=$(echo "$LATEST_TAG" | awk -F- '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-%d", $1, suffix}')
  90. # Output the new tag to be used
  91. echo "New tag: $NEW_TAG"
  92. # Set the new tag as an environment variable to be used in later steps
  93. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  94. # Create the tag in the repository
  95. git tag $NEW_TAG
  96. git push origin $NEW_TAG
  97. # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty)
  98. - name: Download Artifacts for A12 (Only if A12 Build is successful or skipped)
  99. if: ${{ (needs.build-kernel-a12.result == 'success' || needs.build-kernel-a12.result == 'skipped') && (github.event.inputs.build_a12 == 'true' || github.event.inputs.build_a12 == '') }}
  100. uses: actions/download-artifact@v3
  101. with:
  102. name: kernel-artifacts-a12
  103. path: ./downloaded-artifacts
  104. # Download Artifacts for A13 (Only if A13 Build is successful or input is true or empty)
  105. - name: Download Artifacts for A13 (Only if A13 Build is successful or skipped)
  106. if: ${{ (needs.build-kernel-a13.result == 'success' || needs.build-kernel-a13.result == 'skipped') && (github.event.inputs.build_a13 == 'true' || github.event.inputs.build_a13 == '') }}
  107. uses: actions/download-artifact@v3
  108. with:
  109. name: kernel-artifacts-a13
  110. path: ./downloaded-artifacts
  111. # Download Artifacts for A14 (Only if A14 Build is successful or input is true or empty)
  112. - name: Download Artifacts for A14 (Only if A14 Build is successful or skipped)
  113. if: ${{ (needs.build-kernel-a14.result == 'success' || needs.build-kernel-a14.result == 'skipped') && (github.event.inputs.build_a14 == 'true' || github.event.inputs.build_a14 == '') }}
  114. uses: actions/download-artifact@v3
  115. with:
  116. name: kernel-artifacts-a14
  117. path: ./downloaded-artifacts
  118. # Create GitHub Release and upload files if make_release is true
  119. - name: Create GitHub Release
  120. if: ${{ github.event.inputs.make_release == 'true' }}
  121. uses: softprops/action-gh-release@v1
  122. with:
  123. files: ./downloaded-artifacts/*
  124. tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release
  125. prerelease: true # Mark the release as a pre-release
  126. env:
  127. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  128. RELEASE_NAME: ${{ env.RELEASE_NAME }}
  129. RELEASE_NOTES: ${{ env.RELEASE_NOTES }}
  130. # Display Files Uploaded
  131. - name: Display Files Uploaded
  132. run: |
  133. echo "GitHub release created with the following files:"
  134. ls ./downloaded-artifacts