action.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. name: 'Apply Kernel Branding'
  2. description: 'Apply Wild kernel branding to kernel version string'
  3. inputs:
  4. build_type:
  5. description: 'Build type (Normal, Bypass, MarionKernel, Hakan, etc.)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 5.10, 6.1, 6.6)'
  9. required: true
  10. runs:
  11. using: "composite"
  12. steps:
  13. - name: Apply Kernel Name Branding
  14. shell: bash
  15. working-directory: ${{ github.workspace }}/kernel/common
  16. run: |
  17. # Apply kernel branding based on version and variant
  18. if [[ "${{ inputs.kernel_version }}" == "5."* ]] || [[ "${{ inputs.kernel_version }}" == "6.1" ]]; then
  19. perl -i -0777 -pe 's/(.*)echo "\$res"/$1echo "\$res-Wild"/s' scripts/setlocalversion
  20. else
  21. perl -i -0777 -pe 's/(.*)echo "\$\{KERNELVERSION\}\$\{file_localversion\}\$\{config_localversion\}\$\{LOCALVERSION\}\$\{scm_version\}"/$1echo "\${KERNELVERSION}\${file_localversion}\${config_localversion}\${LOCALVERSION}-Wild\${scm_version}"/s' scripts/setlocalversion
  22. fi
  23. : > .scmversion
  24. echo "Getting last commit timestamp from kernel source..."
  25. COMMIT_TIMESTAMP=$(git log -1 --format=%ct 2>/dev/null || echo "$(date +%s)")
  26. KERNEL_BUILD_DATE=$(date -u)
  27. export SOURCE_DATE_EPOCH=$COMMIT_TIMESTAMP
  28. echo "SOURCE_DATE_EPOCH=$COMMIT_TIMESTAMP" >> $GITHUB_ENV
  29. export KBUILD_BUILD_TIMESTAMP="$KERNEL_BUILD_DATE"
  30. echo "KBUILD_BUILD_TIMESTAMP=$KERNEL_BUILD_DATE" >> $GITHUB_ENV