main.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. name: Build Kernels
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_dispatch:
  7. inputs:
  8. release_type:
  9. description: "Choose Release Type"
  10. required: true
  11. type: choice
  12. options:
  13. - Actions
  14. - Pre-Release
  15. - Release
  16. default: Actions
  17. susfs:
  18. description: "Build with SUSFS?"
  19. required: true
  20. type: choice
  21. options:
  22. - yes
  23. - no
  24. default: yes
  25. bbg:
  26. description: "Build with BBG?"
  27. required: true
  28. type: choice
  29. options:
  30. - yes
  31. - no
  32. default: yes
  33. zeromount:
  34. description: "Add Zeromount?"
  35. required: true
  36. type: choice
  37. options:
  38. - yes
  39. - no
  40. default: no
  41. bbrv3:
  42. description: "Add BBR?"
  43. required: true
  44. type: choice
  45. options:
  46. - yes
  47. - no
  48. default: no
  49. unicodefix:
  50. description: "Add unicode fix?"
  51. required: true
  52. type: choice
  53. options:
  54. - yes
  55. - no
  56. default: yes
  57. optimizations:
  58. description: "Add kernel optimizations?"
  59. required: true
  60. type: choice
  61. options:
  62. - yes
  63. - no
  64. default: no
  65. jobs:
  66. build-samsung:
  67. uses: ./.github/workflows/kernel-samsung.yml
  68. secrets: inherit
  69. with:
  70. susfs: ${{ inputs.susfs }}
  71. bbg: ${{ inputs.bbg }}
  72. bbrv3: ${{ inputs.bbrv3 }}
  73. unicodefix: ${{ inputs.unicodefix }}
  74. optimizations: ${{ inputs.optimizations }}
  75. zeromount: ${{ inputs.zeromount }}
  76. release:
  77. runs-on: ubuntu-latest
  78. if: inputs.release_type != 'Actions'
  79. needs:
  80. - build-samsung
  81. env:
  82. GH_TOKEN: ${{ github.token }}
  83. RELEASE_NAME: "Samsung GKI Kernels With WKSU v3.0.0 & SUSFS v2.0.0"
  84. RELEASE_BODY: ""
  85. steps:
  86. - name: Free Disk Space
  87. if: true
  88. uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
  89. with:
  90. remove_android: true
  91. remove_dotnet: true
  92. remove_haskell: true
  93. remove_tool_cache: true
  94. remove_swap: true
  95. remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
  96. remove_packages_one_command: true
  97. remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
  98. rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
  99. rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
  100. testing: false
  101. - name: Checkout code
  102. uses: actions/checkout@v4
  103. - name: Generate New Tag
  104. if: inputs.release_type != 'Actions'
  105. run: |
  106. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  107. if [ -z "$LATEST_TAG" ]; then
  108. LATEST_TAG="v2.0.0-r0"
  109. fi
  110. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  111. echo "New tag: $NEW_TAG"
  112. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  113. - name: Download Artifacts
  114. uses: actions/download-artifact@v4
  115. with:
  116. path: ./downloaded-artifacts
  117. pattern: '*-AnyKernel3'
  118. - name: Set release body
  119. run: |
  120. cat << 'EOF' > release_body.md
  121. **IMPORTANT DISCLAIMER**
  122. This software is provided for testing and educational purposes only. Use at your own risk.
  123. The developers are not responsible for any damage, data loss, or issues that may occur.
  124. Please ensure you have proper backups before installation.
  125. Features:
  126. -> Wild KSU Manager Support, Also Compatible with KernelSU-Next Manager
  127. -> SUSFS ඞ v2.0.0
  128. -> SUSFS Inline hooks
  129. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  130. 🔹 BBG (Baseband-guard)
  131. - A lightweight LSM (Linux Security Module) for Android kernel
  132. - Blocks unauthorized writes to critical partitions/device nodes
  133. - Prevents malicious tampering with baseband and boot chain
  134. - Kernel-level protection via LSM hooks
  135. - Reduces risk of soft-brick/hard-brick issues
  136. Notes:
  137. - The only modifications to Samsung Kernels at this time are WKSU and SUSFS. Everything else is left at default settings.
  138. - Currently no support for KernelPatch-Next for the time being.
  139. Module:
  140. -> https://github.com/sidex15/ksu_module_susfs
  141. Managers:
  142. -> WKSU: https://github.com/WildKernels/Wild_KSU
  143. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  144. EOF
  145. - name: Create GitHub Release
  146. uses: softprops/action-gh-release@v2
  147. with:
  148. tag_name: ${{ env.NEW_TAG }}
  149. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  150. files: ""
  151. name: ${{ env.RELEASE_NAME }}
  152. body_path: release_body.md
  153. - name: Upload Release Assets
  154. run: |
  155. shopt -s nullglob
  156. anykernel_dirs=(./downloaded-artifacts/*/)
  157. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  158. echo "No artifact directories found under ./downloaded-artifacts; skipping upload."
  159. else
  160. for dir in "${anykernel_dirs[@]}"; do
  161. # Check if this is an AnyKernel3 artifact directory
  162. if [[ "$(basename "$dir")" == *"-AnyKernel3" ]]; then
  163. artifact_name=$(basename "$dir")
  164. echo "Creating ZIP for $artifact_name..."
  165. # Navigate into the directory and zip its contents directly
  166. cd "$dir"
  167. zip -r -9 "../../${artifact_name}.zip" ./*
  168. cd - > /dev/null
  169. echo "Uploading ${artifact_name}.zip..."
  170. gh release upload ${{ env.NEW_TAG }} "${artifact_name}.zip"
  171. fi
  172. done
  173. fi
  174. # - name: Send Telegram Notification
  175. # if: inputs.release_type != 'Actions'
  176. # run: |
  177. # RELEASE_TYPE_TEXT=""
  178. # if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  179. # RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  180. # else
  181. # RELEASE_TYPE_TEXT="🚀 *Release*"
  182. # fi
  183. #
  184. # curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  185. # -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  186. # -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  187. # -F text="
  188. # 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  189. # 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  190. # ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  191. # [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  192. # -F parse_mode="Markdown"