action.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: Set up KernelSU-Next
  2. description: download and set up KSUN into the kernel source
  3. inputs:
  4. susfs:
  5. description: 'susfs'
  6. required: true
  7. runs:
  8. using: composite
  9. steps:
  10. - name: Setup KSUN with no susfs
  11. if: inputs.susfs == 'false'
  12. shell: bash
  13. run: |
  14. cd "$COMMON"
  15. curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev
  16. #cd KernelSU-Next
  17. #git checkout c2013a15ae1eaca69032fa6016ffefb70adf6146
  18. cd KernelSU-Next/kernel
  19. COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
  20. BASE_VERSION=30000
  21. KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
  22. sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  23. KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
  24. sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  25. cd "$GITHUB_WORKSPACE"
  26. cat >> "$GKI_DEFCONFIG" << 'EOF'
  27. # KernelSU Configuration
  28. CONFIG_KSU=y
  29. EOF
  30. - name: Setup pershoot KSUN with susfs
  31. if: inputs.susfs == 'true'
  32. shell: bash
  33. run: |
  34. cd "$COMMON"
  35. curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/dev-susfs/kernel/setup.sh" | bash -s dev-susfs
  36. #cd KernelSU-Next
  37. #git checkout c2013a15ae1eaca69032fa6016ffefb70adf6146
  38. cd KernelSU-Next/kernel
  39. COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
  40. BASE_VERSION=30000
  41. KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
  42. sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  43. KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
  44. sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  45. cd "$GITHUB_WORKSPACE"
  46. cat >> "$GKI_DEFCONFIG" << 'EOF'
  47. # KernelSU Configuration
  48. CONFIG_KSU=y
  49. EOF
  50. - name: Extract KSU Version Info
  51. id: ksu-version
  52. shell: bash
  53. run: |
  54. cd "$COMMON/KernelSU-Next"
  55. # Extract and export KSU version info
  56. KSU_GIT_VERSION=$(git rev-list --count HEAD 2>/dev/null)
  57. KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
  58. KSU_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
  59. KSU_VERSION=$((30000 + KSU_GIT_VERSION))
  60. echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
  61. echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
  62. echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV
  63. # - name: 'Fix KernelSU-Next'
  64. # shell: bash
  65. # run: |
  66. # set -euo pipefail
  67. # cd "$COMMON/KernelSU-Next"
  68. # cp ${{ github.action_path }}/patches/static.patch ./
  69. # patch -p1 < static.patch