action.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Set up KernelSU-Next
  2. description: download and set up KSUN into the kernel source
  3. runs:
  4. using: composite
  5. steps:
  6. - name: Setup KSUN
  7. shell: bash
  8. run: |
  9. cd "$COMMON"
  10. curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev
  11. cd KernelSU-Next
  12. git checkout 5a4a71874caaad06aa126f761c93391de1d32361
  13. cd kernel
  14. COMMITS_COUNT=$(/usr/bin/git rev-list --count HEAD)
  15. BASE_VERSION=30000
  16. KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
  17. sed -i "s/^KSU_VERSION_FALLBACK := 1$/KSU_VERSION_FALLBACK := ${KSU_VERSION}/" Kbuild
  18. KSU_GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.1")"
  19. sed -i "s/^KSU_VERSION_TAG_FALLBACK := v0.0.1$/KSU_VERSION_TAG_FALLBACK := ${KSU_GIT_TAG}/" Kbuild
  20. cd "$GITHUB_WORKSPACE"
  21. cat >> "$GKI_DEFCONFIG" << 'EOF'
  22. # KernelSU Configuration
  23. CONFIG_KSU=y
  24. EOF
  25. - name: Extract KSU Version Info
  26. id: ksu-version
  27. shell: bash
  28. run: |
  29. cd "$COMMON/KernelSU-Next"
  30. # Extract and export KSU version info
  31. KSU_GIT_VERSION=$(git rev-list --count HEAD 2>/dev/null)
  32. KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
  33. KSU_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
  34. KSU_VERSION=$((30000 + KSU_GIT_VERSION))
  35. echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
  36. echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
  37. echo "KSU_COMMIT=$KSU_COMMIT" >> $GITHUB_ENV