main.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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: Download Apache Arrow's util_free_space.sh
  32. run: |
  33. curl -L -o util_free_space.sh https://raw.githubusercontent.com/apache/arrow/main/ci/scripts/util_free_space.sh
  34. chmod +x util_free_space.sh
  35. ./util_free_space.sh
  36. - name: Checkout code
  37. uses: actions/checkout@v4
  38. - name: Generate New Tag
  39. if: inputs.release_type != 'Actions'
  40. run: |
  41. LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
  42. if [ -z "$LATEST_TAG" ]; then
  43. LATEST_TAG="v2.0.0-r0"
  44. fi
  45. NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
  46. echo "New tag: $NEW_TAG"
  47. echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
  48. - name: Download Artifacts
  49. uses: actions/download-artifact@v5
  50. with:
  51. path: ./downloaded-artifacts
  52. pattern: '*-AnyKernel3'
  53. - name: Set release body
  54. run: |
  55. cat << 'EOF' > release_body.md
  56. **IMPORTANT DISCLAIMER**
  57. This software is provided for testing and educational purposes only. Use at your own risk.
  58. The developers are not responsible for any damage, data loss, or issues that may occur.
  59. Please ensure you have proper backups before installation.
  60. Features:
  61. -> Wild KSU Manager Support, Also Compatible with KernelSU-Next Manager
  62. -> SUSFS ඞ v2.0.0
  63. -> SUSFS Inline hooks
  64. -> BBG: https://github.com/vc-teahouse/Baseband-guard
  65. -> KPN: Added support for KernelPatch-Next.
  66. 🔹 BBG (Baseband-guard)
  67. - A lightweight LSM (Linux Security Module) for Android kernel
  68. - Blocks unauthorized writes to critical partitions/device nodes
  69. - Prevents malicious tampering with baseband and boot chain
  70. - Kernel-level protection via LSM hooks
  71. - Reduces risk of soft-brick/hard-brick issues
  72. Notes:
  73. - The only modifications to Samsung Kernels at this time are WKSU and SUSFS. Everything else is left at default settings.
  74. Module:
  75. -> https://github.com/sidex15/ksu_module_susfs
  76. Managers:
  77. -> WKSU: https://github.com/WildKernels/Wild_KSU
  78. -> Next: https://github.com/KernelSU-Next/KernelSU-Next
  79. EOF
  80. - name: Create GitHub Release
  81. uses: softprops/action-gh-release@v2
  82. with:
  83. tag_name: ${{ env.NEW_TAG }}
  84. prerelease: ${{ inputs.release_type == 'Pre-Release' }}
  85. files: ""
  86. name: ${{ env.RELEASE_NAME }}
  87. body_path: release_body.md
  88. - name: Upload Release Assets
  89. run: |
  90. shopt -s nullglob
  91. anykernel_dirs=(./downloaded-artifacts/*/)
  92. if [ ${#anykernel_dirs[@]} -eq 0 ]; then
  93. echo "No artifact directories found under ./downloaded-artifacts; skipping upload."
  94. else
  95. for dir in "${anykernel_dirs[@]}"; do
  96. # Check if this is an AnyKernel3 artifact directory
  97. if [[ "$(basename "$dir")" == *"-AnyKernel3" ]]; then
  98. artifact_name=$(basename "$dir")
  99. echo "Creating ZIP for $artifact_name..."
  100. # Navigate into the directory and zip its contents directly
  101. cd "$dir"
  102. zip -r -9 "../../${artifact_name}.zip" ./*
  103. cd - > /dev/null
  104. echo "Uploading ${artifact_name}.zip..."
  105. gh release upload ${{ env.NEW_TAG }} "${artifact_name}.zip"
  106. fi
  107. done
  108. fi
  109. # - name: Send Telegram Notification
  110. # if: inputs.release_type != 'Actions'
  111. # run: |
  112. # RELEASE_TYPE_TEXT=""
  113. # if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
  114. # RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
  115. # else
  116. # RELEASE_TYPE_TEXT="🚀 *Release*"
  117. # fi
  118. #
  119. # curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
  120. # -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
  121. # -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
  122. # -F text="
  123. # 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
  124. # 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
  125. # ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
  126. # [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
  127. # -F parse_mode="Markdown"