build_slim_packages.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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_labels:
  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_labels:
  28. required: false
  29. type: string
  30. default: '["self-hosted","ephemeral"]'
  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: ${{ fromJSON(inputs.runner_labels) }}
  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: actions/checkout@v3
  61. with:
  62. fetch-depth: 0
  63. - name: Work around https://github.com/actions/checkout/issues/766
  64. run: |
  65. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  66. echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
  67. - name: build and test tgz package
  68. if: matrix.profile[3] == 'erlang'
  69. run: |
  70. make ${EMQX_NAME}-tgz
  71. ./scripts/pkg-tests.sh ${EMQX_NAME}-tgz
  72. - name: build and test deb/rpm packages
  73. if: matrix.profile[3] == 'erlang'
  74. run: |
  75. make ${EMQX_NAME}-pkg
  76. ./scripts/pkg-tests.sh ${EMQX_NAME}-pkg
  77. - name: build and test tgz package (Elixir)
  78. if: matrix.profile[3] == 'elixir'
  79. run: |
  80. make ${EMQX_NAME}-elixir-tgz
  81. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-tgz
  82. - name: build and test deb/rpm packages (Elixir)
  83. if: matrix.profile[3] == 'elixir'
  84. run: |
  85. make ${EMQX_NAME}-elixir-pkg
  86. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-pkg
  87. - uses: actions/upload-artifact@v3
  88. with:
  89. name: "${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
  90. path: _packages/${{ matrix.profile[0] }}/*
  91. retention-days: 7
  92. - uses: actions/upload-artifact@v3
  93. with:
  94. name: "${{ matrix.profile[0] }}_schema_dump"
  95. path: |
  96. scripts/spellcheck
  97. _build/docgen/${{ matrix.profile[0] }}/schema-en.json
  98. retention-days: 7
  99. mac:
  100. strategy:
  101. fail-fast: false
  102. matrix:
  103. profile:
  104. - emqx
  105. otp:
  106. - ${{ inputs.otp_vsn }}
  107. os:
  108. - macos-11
  109. - macos-12-arm64
  110. runs-on: ${{ matrix.os }}
  111. env:
  112. EMQX_NAME: ${{ matrix.profile }}
  113. steps:
  114. - uses: actions/checkout@v3
  115. - uses: ./.github/actions/package-macos
  116. with:
  117. profile: ${{ matrix.profile }}
  118. otp: ${{ matrix.otp }}
  119. os: ${{ matrix.os }}
  120. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  121. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  122. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  123. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  124. - uses: actions/upload-artifact@v3
  125. with:
  126. name: ${{ matrix.os }}
  127. path: _packages/**/*
  128. retention-days: 7