| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- name: Build Kernels
- permissions:
- contents: write
- actions: write
- on:
- workflow_dispatch:
- inputs:
- release_type:
- description: "Choose Release Type"
- required: true
- type: choice
- options:
- - Actions
- - Pre-Release
- - Release
- default: Actions
- lto:
- description: "Choose LTO build"
- required: true
- type: choice
- options:
- - default
- - thin
- - full
- default: default
- ksun:
- description: "KSUN"
- required: false
- default: true
- type: boolean
- susfs:
- description: "SUSFS"
- required: false
- type: boolean
- default: true
- zeromount:
- description: "Zeromount"
- required: false
- type: boolean
- default: false
- nomount:
- description: "NoMount"
- required: false
- type: boolean
- default: true
- bbg:
- description: "BBG"
- required: false
- type: boolean
- default: true
- unicodefix:
- description: "Unicode fix"
- required: false
- type: boolean
- default: true
- droidspace:
- description: "Droidspaces"
- required: false
- type: boolean
- default: true
- ntsync:
- description: "NTsync"
- required: false
- type: boolean
- default: true
-
- bbrv3:
- description: "bbrv3"
- required: false
- type: boolean
- default: true
- cache:
- description: "CCache"
- required: false
- default: true
- type: boolean
- ipv6_nat:
- description: "IPv6_NAT & IP-SET"
- required: false
- default: true
- type: boolean
- optimization:
- description: "optimization patches"
- required: false
- default: true
- type: boolean
- ttl:
- description: "TTL support"
- required: false
- default: true
- type: boolean
- jobs:
- build-samsung:
- uses: ./.github/workflows/kernel-samsung.yml
- secrets: inherit
- with:
- susfs: ${{ inputs.susfs }}
- bbg: ${{ inputs.bbg }}
- unicodefix: ${{ inputs.unicodefix }}
- zeromount: ${{ inputs.zeromount }}
- nomount: ${{ inputs.nomount }}
- ksun: ${{ inputs.ksun }}
- droidspace: ${{ inputs.droidspace }}
- ntsync: ${{ inputs.ntsync }}
- bbrv3: ${{ inputs.bbrv3 }}
- cache: ${{ inputs.cache }}
- ipv6_nat: ${{ inputs.ipv6_nat }}
- optimization: ${{ inputs.optimization }}
- ttl: ${{ inputs.ttl }}
- lto: ${{ inputs.lto }}
- release:
- runs-on: ubuntu-latest
- if: inputs.release_type != 'Actions'
- needs:
- - build-samsung
- env:
- GH_TOKEN: ${{ github.token }}
- RELEASE_NAME: "Samsung GKI Kernels With KSUN v3.3.0 & SUSFS v2.2.0"
- RELEASE_BODY: ""
- steps:
- - name: Free Disk Space
- if: true
- uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
- with:
- remove_android: true
- remove_dotnet: true
- remove_haskell: true
- remove_tool_cache: true
- remove_swap: true
- remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
- remove_packages_one_command: true
- 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"
- rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
- rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
- testing: false
-
- - name: Checkout code
- uses: actions/checkout@v7
- - name: Generate New Tag
- if: inputs.release_type != 'Actions'
- run: |
- LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
- if [ -z "$LATEST_TAG" ]; then
- LATEST_TAG="v2.2.0-r0"
- fi
-
- NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}')
-
- echo "New tag: $NEW_TAG"
- echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
- - name: Download Artifacts
- uses: actions/download-artifact@v8
- with:
- path: ./downloaded-artifacts
- pattern: '*-AnyKernel3'
- - name: get commit hashes
- run: |
- echo "SUSFS_510=$(git ls-remote https://gitlab.com/simonpunk/susfs4ksu.git refs/heads/gki-android12-5.10 | cut -f1)" >> $GITHUB_ENV
- echo "SUSFS_515=$(git ls-remote https://gitlab.com/simonpunk/susfs4ksu.git refs/heads/gki-android13-5.15 | cut -f1)" >> $GITHUB_ENV
- echo "SUSFS_61=$(git ls-remote https://gitlab.com/simonpunk/susfs4ksu.git refs/heads/gki-android14-6.1 | cut -f1)" >> $GITHUB_ENV
- echo "SUSFS_66=$(git ls-remote https://gitlab.com/simonpunk/susfs4ksu.git refs/heads/gki-android15-6.6 | cut -f1)" >> $GITHUB_ENV
- echo "KSUN_HASH=$(git ls-remote https://github.com/pershoot/KernelSU-Next.git refs/heads/dev | cut -f1)" >> $GITHUB_ENV
- echo "BBG_HASH=$(git ls-remote https://github.com/vc-teahouse/Baseband-guard.git refs/heads/main | cut -f1)" >> $GITHUB_ENV
- echo "NM_HASH=$(git ls-remote https://github.com/maxsteeel/nomount.git refs/heads/master | cut -f1)" >> $GITHUB_ENV
- - name: Set release body
- run: |
- cat << 'EOF' > release_body.md
-
- **IMPORTANT DISCLAIMER**
- This software is provided for testing and educational purposes only. Use at your own risk.
- The developers are not responsible for any damage, data loss, or issues that may occur.
- Please ensure you have proper backups before installation.
- Features:
- EOF
- if [ "${{ inputs.ksun }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> KernelSU-Next v3.3.0 - https://github.com/KernelSU-Next/KernelSU-Next
- EOF
- fi
- if [ "${{ inputs.susfs }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> SUSFS ඞ v2.2.0 - https://gitlab.com/simonpunk/susfs4ksu
- -> SUSFS Inline hooks
- EOF
- fi
- if [ "${{ inputs.bbg }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> BBG - https://github.com/vc-teahouse/Baseband-guard
- EOF
- fi
- if [ "${{ inputs.unicodefix }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> unicode fix - Prevent path traversal and other detections using non-printable Unicode codepoints
- EOF
- fi
- if [ "${{ inputs.zeromount }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> Zeromount - https://github.com/Enginex0/zeromount
- EOF
- fi
- if [ "${{ inputs.nomount }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> NoMount - https://github.com/maxsteeel/nomount
- EOF
- fi
- if [ "${{ inputs.droidspace }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> droidspaces support - https://github.com/ravindu644/Droidspaces-OSS
- EOF
- fi
- if [ "${{ inputs.ntsync }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> NTSync - Provide high-performance, low-latency synchronization primitives compatible with the Windows NT kernel API
- EOF
- fi
- if [ "${{ inputs.bbrv3 }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> TCP BBRV3 (better TCP congestion and faster internet)
- -> CAKE and PIE qdisc Support - Better Net Schedulers
- EOF
- fi
- if [ "${{ inputs.ipv6_nat }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> IP Set & IPv6 NAT Support - Advanced firewall capabilities and IPv6 NAT Support
- EOF
- fi
- if [ "${{ inputs.ttl }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> TTL Target Support - Network packet manipulation
- EOF
- fi
- if [ "${{ inputs.optimization }}" = "true" ]; then
- cat <<'EOF' >> release_body.md
- -> Kernel Optimization - Memory, I/O, CPU scheduler, network and other general tunings
- -> Patches for optimizations can be found here - https://github.com/WildKernels/kernel_patches/tree/main/common
- EOF
- fi
- echo "-> Built using LTO: ${{ inputs.lto }}" >> release_body.md
- cat <<'EOF' >> release_body.md
-
- Notes:
- - Currently no support for KernelPatch-Next/KPM for the time being.
-
- Module:
- -> https://github.com/sidex15/ksu_module_susfs
- -> https://github.com/rrr333nnn333/BRENE
- Commit Hashes:
- EOF
- if ${{ inputs.ksun }} == 'true' ]]; then
- cat <<'EOF' >> release_body.md
-
- KSUN: ${{ env.KSUN_HASH }}
-
- EOF
- fi
- if ${{ inputs.susfs }} == 'true' ]]; then
- cat <<'EOF' >> release_body.md
- SUSFS:
- android12-5.10: ${{ env.SUSFS_510 }}
- android13-5.15: ${{ env.SUSFS_515 }}
- android14-6.1: ${{ env.SUSFS_61 }}
- android15-6.6: ${{ env.SUSFS_66 }}
-
- EOF
- fi
-
- if ${{ inputs.bbg }} == 'true' ]]; then
- cat <<'EOF' >> release_body.md
- BBG: ${{ env.BBG_HASH }}
-
- EOF
- fi
-
- if ${{ inputs.nomount }} == 'true' ]]; then
- cat <<'EOF' >> release_body.md
- NoMount: ${{ env.NM_HASH }}
-
- EOF
- fi
- - name: Create GitHub Release
- uses: softprops/action-gh-release@v3
- with:
- tag_name: ${{ env.NEW_TAG }}
- prerelease: ${{ inputs.release_type == 'Pre-Release' }}
- files: ""
- name: ${{ env.RELEASE_NAME }}
- body_path: release_body.md
- - name: Upload Release Assets
- run: |
- shopt -s nullglob
- anykernel_dirs=(./downloaded-artifacts/*/)
- if [ ${#anykernel_dirs[@]} -eq 0 ]; then
- echo "No artifact directories found under ./downloaded-artifacts; skipping upload."
- else
- for dir in "${anykernel_dirs[@]}"; do
- # Check if this is an AnyKernel3 artifact directory
- if [[ "$(basename "$dir")" == *"-AnyKernel3" ]]; then
- artifact_name=$(basename "$dir")
- echo "Creating ZIP for $artifact_name..."
- # Navigate into the directory and zip its contents directly
- cd "$dir"
- zip -r -9 "../../${artifact_name}.zip" ./*
- cd - > /dev/null
- echo "Uploading ${artifact_name}.zip..."
- gh release upload ${{ env.NEW_TAG }} "${artifact_name}.zip"
- fi
- done
- fi
-
- # - name: Send Telegram Notification
- # if: inputs.release_type != 'Actions'
- # run: |
- # RELEASE_TYPE_TEXT=""
- # if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
- # RELEASE_TYPE_TEXT="🧪 *Pre-Release*"
- # else
- # RELEASE_TYPE_TEXT="🚀 *Release*"
- # fi
- #
- # curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
- # -F chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
- # -F message_thread_id="${{ secrets.TELEGRAM_TOPIC_ID_GKI }}" \
- # -F text="
- # 🌽 *New Kernel $RELEASE_TYPE_TEXT Uploaded*
- # 📦 *Repository:* [${{ github.repository }}](https://github.com/${{ github.repository }})
- # ✏️ *Commit:* [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
- # [🔗 View GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})" \
- # -F parse_mode="Markdown"
|