build_slim_packages.yaml 3.7 KB

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