action.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: 'Apply Kernel Branding & Timestamp'
  2. description: 'Apply Wild kernel branding to kernel version string'
  3. inputs:
  4. variant:
  5. description: 'Variant of kernel to apply branding to'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 6.1)'
  9. required: true
  10. android_version:
  11. description: 'Android version (e.g., android14)'
  12. required: true
  13. version:
  14. description: 'Combined version (e.g., android14-6.1)'
  15. required: true
  16. sublevel:
  17. description: 'Sublevel of kernel version (e.g., 1)'
  18. required: true
  19. runs:
  20. using: "composite"
  21. steps:
  22. - name: Apply Kernel Name Branding
  23. shell: bash
  24. if: false
  25. working-directory: ${{ github.workspace }}/kernel/common
  26. run: |
  27. CONFIG_FRAGMENT="${{ github.workspace }}/wild_gki.fragment"
  28. touch "$CONFIG_FRAGMENT"
  29. DEFCONFIG="${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig"
  30. #VERSION="${{ inputs.version }}"
  31. #ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
  32. #KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
  33. #if [ "${{ inputs.variant }}" == "Wild" ]; then
  34. # tac scripts/setlocalversion | awk '!seen && /^echo / {seen=1; next} 1' | tac > scripts/setlocalversion.tmp
  35. # mv scripts/setlocalversion.tmp scripts/setlocalversion
  36. # if [[ "$KERNEL_PART" == "6.6" || "$KERNEL_PART" == "6.12" ]]; then
  37. # KERNEL_STRING="$KERNEL_PART.${{ inputs.sublevel }}-$ANDROID_PART"
  38. # echo "echo \"$KERNEL_STRING-Wild\"" >> scripts/setlocalversion
  39. # else
  40. # echo 'echo "-Wild"' >> scripts/setlocalversion
  41. # fi
  42. # chmod +x scripts/setlocalversion
  43. #else
  44. # if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
  45. # LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
  46. # echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
  47. # else
  48. # echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
  49. # fi
  50. #fi
  51. - name: Apply Kernel Configuration
  52. if: ${{ inputs.variant == 'Wild' }}
  53. shell: bash
  54. run: |
  55. if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
  56. LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
  57. echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
  58. else
  59. echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
  60. fi
  61. cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
  62. CONFIG_LOCALVERSION=""
  63. # CONFIG_LOCALVERSION_AUTO is not set
  64. EOF