action.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: 'Setup SUSFS Branch'
  2. description: 'Clone SUSFS repo and cherry-pick commits'
  3. inputs:
  4. susfs_commit:
  5. description: 'SUSFS commit hash (empty = latest on auto-derived gki-{version} branch)'
  6. required: false
  7. default: ""
  8. version:
  9. description: 'Kernel config version (e.g., android15-6.6)'
  10. required: true
  11. root_flavor:
  12. description: 'Selected root implementation - pershoot patches only apply to next'
  13. required: false
  14. default: ""
  15. runs:
  16. using: "composite"
  17. steps:
  18. - name: Clone SUSFS Branch
  19. shell: bash
  20. run: |
  21. set -euo pipefail
  22. # Retry transient network errors (up to 5 attempts, 5s backoff).
  23. retry() {
  24. local n=0
  25. until [ "$n" -ge 5 ]; do
  26. "$@" && return 0
  27. n=$((n+1))
  28. echo "retry $n/5 failed for: $*" >&2
  29. sleep 5
  30. done
  31. return 1
  32. }
  33. SUSFS_BRANCH="gki-${{ inputs.version }}"
  34. SUSFS_REPO="https://gitlab.com/simonpunk/susfs4ksu.git"
  35. echo "Preparing SUSFS for branch: $SUSFS_BRANCH"
  36. echo "Cloning latest from $SUSFS_BRANCH..."
  37. retry git clone "$SUSFS_REPO" -b "$SUSFS_BRANCH" susfs4ksu
  38. if [ -n "${{ inputs.susfs_commit }}" ]; then
  39. echo "Checking out SUSFS commit: ${{ inputs.susfs_commit }}"
  40. retry git -C "${{ github.workspace }}/susfs4ksu" checkout "${{ inputs.susfs_commit }}"
  41. fi
  42. cd "${{ github.workspace }}/susfs4ksu"
  43. SUSFS_COMMIT="$(git rev-parse HEAD)"
  44. echo "SUSFS_COMMIT=$SUSFS_COMMIT" >> "$GITHUB_ENV"
  45. echo "Using SUSFS commit: $SUSFS_COMMIT"
  46. # Pershoot's two commits (no-features core build, Toolkit coexistence)
  47. # only apply to KernelSU-Next (dev-susfs fork). Other flavors use the
  48. # simonpunk checkout as-is.
  49. if [ "${{ inputs.root_flavor }}" = "next" ]; then
  50. patch -p1 < "${{ github.workspace }}/kernel_patches/pershoot/susfs4ksu/0001-pershoot-Allow-core-to-be-built-with-no-features.patch"
  51. patch -p1 < "${{ github.workspace }}/kernel_patches/pershoot/susfs4ksu/0002-pershoot-Implement-SuSFS-and-Toolkit-coexistence.patch"
  52. fi