action.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: 'Apply Kernel Branding & Timestamp'
  2. description: 'Apply 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. brand_name:
  20. description: 'Branding text appended to the version (e.g., Wild)'
  21. required: false
  22. default: Wild
  23. runs:
  24. using: "composite"
  25. steps:
  26. - name: Apply Kernel Name Branding
  27. shell: bash
  28. working-directory: ${{ github.workspace }}/kernel/common
  29. run: |
  30. VERSION="${{ inputs.version }}"
  31. ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
  32. KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
  33. BRAND="${{ inputs.brand_name }}"
  34. if [[ ${{ inputs.version }} == "android15-6.6" || ${{ inputs.version }} == "android16-6.12" ]]; then
  35. KERNEL_STRING="$KERNEL_PART.${{ inputs.sublevel }}-$ANDROID_PART"
  36. sed -i '$d' scripts/setlocalversion && echo "echo \"$KERNEL_STRING-$BRAND\"" >> scripts/setlocalversion
  37. else
  38. sed -i '$d' scripts/setlocalversion && echo "echo \"-$ANDROID_PART-$BRAND\"" >> scripts/setlocalversion
  39. fi
  40. chmod +x scripts/setlocalversion