build-linux-arm.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. name: CI on arm linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. operating-system:
  6. required: true
  7. description: Compile target arch (Linux only)
  8. type: choice
  9. options:
  10. - aarch64
  11. version:
  12. required: true
  13. description: php version to compile
  14. default: '8.2'
  15. type: choice
  16. options:
  17. - '8.3'
  18. - '8.2'
  19. - '8.1'
  20. - '8.0'
  21. - '7.4'
  22. build-cli:
  23. description: build cli binary
  24. default: true
  25. type: boolean
  26. build-micro:
  27. description: build phpmicro binary
  28. type: boolean
  29. build-fpm:
  30. description: build fpm binary
  31. type: boolean
  32. extensions:
  33. description: extensions to compile (comma separated)
  34. required: true
  35. type: string
  36. debug:
  37. type: boolean
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. jobs:
  41. build:
  42. name: build ${{ inputs.version }} on ${{ inputs.operating-system }}
  43. runs-on: ubuntu-latest
  44. steps:
  45. - uses: actions/checkout@v3
  46. # Cache downloaded source
  47. - id: cache-download
  48. uses: actions/cache@v3
  49. with:
  50. path: downloads
  51. key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
  52. # With or without debug
  53. - if: inputs.debug == true
  54. run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
  55. # With target select: cli, micro or both
  56. - if: ${{ inputs.build-cli == true }}
  57. run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
  58. - if: ${{ inputs.build-micro == true }}
  59. run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
  60. - if: ${{ inputs.build-fpm == true }}
  61. run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
  62. # If there's no dependencies cache, fetch sources, with or without debug
  63. - if: steps.cache-download.outputs.cache-hit != 'true'
  64. run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }}
  65. # Run build command
  66. - run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
  67. # Upload cli executable
  68. - if: ${{ inputs.build-cli == true }}
  69. uses: actions/upload-artifact@v3
  70. with:
  71. name: php-${{ inputs.version }}-linux-${{ inputs.operating-system }}
  72. path: buildroot/bin/php
  73. # Upload micro self-extracted executable
  74. - if: ${{ inputs.build-micro == true }}
  75. uses: actions/upload-artifact@v3
  76. with:
  77. name: micro-${{ inputs.version }}-linux-${{ inputs.operating-system }}
  78. path: buildroot/bin/micro.sfx
  79. # Upload fpm executable
  80. - if: ${{ inputs.build-fpm == true }}
  81. uses: actions/upload-artifact@v3
  82. with:
  83. name: php-fpm-${{ inputs.version }}-linux-${{ inputs.operating-system }}
  84. path: buildroot/bin/php-fpm
  85. # Upload extensions metadata
  86. - uses: actions/upload-artifact@v3
  87. with:
  88. name: license-files
  89. path: buildroot/license/
  90. - uses: actions/upload-artifact@v3
  91. with:
  92. name: build-meta
  93. path: |
  94. buildroot/build-extensions.json
  95. buildroot/build-libraries.json