main.yml 6.0 KB

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