action.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: 'Prepare AnyKernel3'
  2. description: 'Copies built Image into AnyKernel3 folder'
  3. inputs:
  4. android_version:
  5. description: 'Android version (e.g., android13)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 5.15)'
  9. required: true
  10. runs:
  11. using: composite
  12. steps:
  13. - shell: bash
  14. run: |
  15. set -euo pipefail
  16. if [ -f "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" ]; then
  17. if [[ ${{ inputs.bypass }} == "true" ]]; then
  18. cp "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" "${{ github.workspace }}/AnyKernel3/Bypass-Image"
  19. else
  20. cp "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" "${{ github.workspace }}/AnyKernel3/Image"
  21. fi
  22. exit 0
  23. fi
  24. if [ -f "${{ github.workspace }}/kernel/bazel-bin/common/kernel_aarch64/Image" ]; then
  25. if [[ ${{ inputs.bypass }} == "true" ]]; then
  26. cp "${{ github.workspace }}/kernel/bazel-bin/common/kernel_aarch64/Image" "${{ github.workspace }}/AnyKernel3/Bypass-Image"
  27. else
  28. cp "${{ github.workspace }}/kernel/bazel-bin/common/kernel_aarch64/Image" "${{ github.workspace }}/AnyKernel3/Image"
  29. fi
  30. exit 0
  31. fi
  32. exit 1
  33. - shell: bash
  34. run: |
  35. # Inject bypass toggle code into anykernel.sh
  36. sed -i '/^# boot install$/i\
  37. # Handle bypass image toggle\
  38. if [ -f "ENABLE_BYPASS" ]; then\
  39. if [ -f "Bypass-Image" ]; then\
  40. mv Bypass-Image Image\
  41. ui_print " " " -> Using Bypass kernel image"\
  42. else\
  43. ui_print " " " -> Bypass enabled but no Bypass-Image found, using regular Image if available"\
  44. fi\
  45. fi\
  46. ' "${{ github.workspace }}/AnyKernel3/anykernel.sh"