build_slim_packages.yaml 4.2 KB

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