build_slim_packages.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. name: Build slim packages
  2. concurrency:
  3. group: slim-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. workflow_call:
  7. inputs:
  8. runner:
  9. required: true
  10. type: string
  11. builder:
  12. required: true
  13. type: string
  14. builder_vsn:
  15. required: true
  16. type: string
  17. otp_vsn:
  18. required: true
  19. type: string
  20. elixir_vsn:
  21. required: true
  22. type: string
  23. workflow_dispatch:
  24. inputs:
  25. ref:
  26. required: false
  27. runner:
  28. required: false
  29. type: string
  30. default: 'ubuntu-22.04'
  31. builder:
  32. required: false
  33. type: string
  34. default: 'ghcr.io/emqx/emqx-builder/5.1-4:1.14.5-25.3.2-2-ubuntu22.04'
  35. builder_vsn:
  36. required: false
  37. type: string
  38. default: '5.1-4'
  39. otp_vsn:
  40. required: false
  41. type: string
  42. default: '25.3.2-2'
  43. elixir_vsn:
  44. required: false
  45. type: string
  46. default: '1.14.5'
  47. jobs:
  48. linux:
  49. runs-on: ${{ inputs.runner }}
  50. env:
  51. EMQX_NAME: ${{ matrix.profile[0] }}
  52. strategy:
  53. fail-fast: false
  54. matrix:
  55. profile:
  56. - ["emqx", "25.3.2-2", "ubuntu20.04", "elixir"]
  57. - ["emqx-enterprise", "25.3.2-2", "ubuntu20.04", "erlang"]
  58. container: "ghcr.io/emqx/emqx-builder/${{ inputs.builder_vsn }}:${{ inputs.elixir_vsn }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
  59. steps:
  60. - uses: AutoModality/action-clean@v1
  61. - uses: actions/checkout@v3
  62. with:
  63. fetch-depth: 0
  64. - name: Work around https://github.com/actions/checkout/issues/766
  65. run: |
  66. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  67. echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
  68. - name: build and test tgz package
  69. if: matrix.profile[3] == 'erlang'
  70. run: |
  71. make ${EMQX_NAME}-tgz
  72. ./scripts/pkg-tests.sh ${EMQX_NAME}-tgz
  73. - name: build and test deb/rpm packages
  74. if: matrix.profile[3] == 'erlang'
  75. run: |
  76. make ${EMQX_NAME}-pkg
  77. ./scripts/pkg-tests.sh ${EMQX_NAME}-pkg
  78. - name: build and test tgz package (Elixir)
  79. if: matrix.profile[3] == 'elixir'
  80. run: |
  81. make ${EMQX_NAME}-elixir-tgz
  82. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-tgz
  83. - name: build and test deb/rpm packages (Elixir)
  84. if: matrix.profile[3] == 'elixir'
  85. run: |
  86. make ${EMQX_NAME}-elixir-pkg
  87. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-pkg
  88. - uses: actions/upload-artifact@v3
  89. with:
  90. name: "${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
  91. path: _packages/${{ matrix.profile[0] }}/*
  92. retention-days: 7
  93. - uses: actions/upload-artifact@v3
  94. with:
  95. name: "${{ matrix.profile[0] }}_schema_dump"
  96. path: |
  97. scripts/spellcheck
  98. _build/docgen/${{ matrix.profile[0] }}/schema-en.json
  99. retention-days: 7
  100. mac:
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. profile:
  105. - emqx
  106. otp:
  107. - ${{ inputs.otp_vsn }}
  108. os:
  109. - macos-11
  110. - macos-12-arm64
  111. runs-on: ${{ matrix.os }}
  112. env:
  113. EMQX_NAME: ${{ matrix.profile }}
  114. steps:
  115. - uses: actions/checkout@v3
  116. - uses: ./.github/actions/package-macos
  117. with:
  118. profile: ${{ matrix.profile }}
  119. otp: ${{ matrix.otp }}
  120. os: ${{ matrix.os }}
  121. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  122. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  123. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  124. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  125. - uses: actions/upload-artifact@v3
  126. with:
  127. name: ${{ matrix.os }}
  128. path: _packages/**/*
  129. retention-days: 7