main.yml 7.4 KB

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