build-linux-arm.yml 3.3 KB

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