action.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. runs:
  12. using: "composite"
  13. steps:
  14. - name: Clone SUSFS Branch
  15. shell: bash
  16. run: |
  17. set -euo pipefail
  18. # Retry transient network errors (up to 5 attempts, 5s backoff).
  19. retry() {
  20. local n=0
  21. until [ "$n" -ge 5 ]; do
  22. "$@" && return 0
  23. n=$((n+1))
  24. echo "retry $n/5 failed for: $*" >&2
  25. sleep 5
  26. done
  27. return 1
  28. }
  29. SUSFS_BRANCH="gki-${{ inputs.version }}"
  30. SUSFS_REPO="https://gitlab.com/simonpunk/susfs4ksu.git"
  31. echo "Preparing SUSFS for branch: $SUSFS_BRANCH"
  32. echo "Cloning latest from $SUSFS_BRANCH..."
  33. retry git clone "$SUSFS_REPO" -b "$SUSFS_BRANCH" susfs4ksu
  34. if [ -n "${{ inputs.susfs_commit }}" ]; then
  35. echo "Checking out SUSFS commit: ${{ inputs.susfs_commit }}"
  36. retry git -C "${{ github.workspace }}/susfs4ksu" checkout "${{ inputs.susfs_commit }}"
  37. fi
  38. cd "${{ github.workspace }}/susfs4ksu"
  39. SUSFS_COMMIT="$(git rev-parse HEAD)"
  40. echo "SUSFS_COMMIT=$SUSFS_COMMIT" >> "$GITHUB_ENV"
  41. echo "Using SUSFS commit: $SUSFS_COMMIT"
  42. patch -p1 < "${{ github.workspace }}/kernel_patches/pershoot/susfs4ksu/0001-pershoot-Allow-core-to-be-built-with-no-features.patch"
  43. patch -p1 < "${{ github.workspace }}/kernel_patches/pershoot/susfs4ksu/0002-pershoot-Implement-SuSFS-and-Toolkit-coexistence.patch"