prepare.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Prepare and Build
  2. on:
  3. workflow_call:
  4. inputs:
  5. config_file:
  6. description: "Path to the JSON config file"
  7. required: true
  8. type: string
  9. ksu_commit:
  10. description: "KSU Commit"
  11. required: false
  12. type: string
  13. anykernel_commit:
  14. description: "AnyKernel3 Commit"
  15. required: false
  16. type: string
  17. patches_commit:
  18. description: "Kernel Patches Commit"
  19. required: false
  20. type: string
  21. susfs_commit:
  22. description: "SUSFS Commit"
  23. required: false
  24. type: string
  25. feature_set:
  26. description: "Feature Set"
  27. required: false
  28. type: string
  29. jobs:
  30. generate-matrix:
  31. runs-on: ubuntu-latest
  32. outputs:
  33. matrix: ${{ steps.set-matrix.outputs.matrix }}
  34. steps:
  35. - name: Checkout Repository
  36. uses: actions/checkout@v5
  37. - name: Read Config and Generate Matrix
  38. id: set-matrix
  39. run: |
  40. echo "Reading config from ${{ inputs.config_file }}"
  41. if [ ! -f "${{ inputs.config_file }}" ]; then
  42. echo "Error: Config file not found: ${{ inputs.config_file }}"
  43. exit 1
  44. fi
  45. # Read the file content
  46. MATRIX_JSON=$(cat "${{ inputs.config_file }}")
  47. # Compact the JSON to a single line to avoid issues
  48. # If jq is not available, we might need another way, but ubuntu-latest usually has it.
  49. if command -v jq &> /dev/null; then
  50. MATRIX_JSON=$(echo "$MATRIX_JSON" | jq -c .)
  51. else
  52. # Fallback for simple minification if jq missing (unlikely on runner)
  53. MATRIX_JSON=$(echo "$MATRIX_JSON" | tr -d '\n' | tr -d ' ')
  54. fi
  55. echo "Matrix content: $MATRIX_JSON"
  56. echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
  57. build:
  58. needs: generate-matrix
  59. strategy:
  60. fail-fast: false
  61. matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
  62. uses: ./.github/workflows/build.yml
  63. with:
  64. kernel_version: ${{ matrix.kernel_version }}
  65. variant: ${{ matrix.variant }}
  66. ksu_commit: ${{ inputs.ksu_commit }}
  67. anykernel_commit: ${{ inputs.anykernel_commit }}
  68. patches_commit: ${{ inputs.patches_commit }}
  69. susfs_commit: ${{ inputs.susfs_commit }}
  70. feature_set: ${{ inputs.feature_set }}
  71. secrets: inherit