build_packages_cron.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. name: Scheduled build packages
  2. concurrency:
  3. group: build-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. schedule:
  7. - cron: '0 */6 * * *'
  8. jobs:
  9. prepare:
  10. runs-on: aws-amd64
  11. if: github.repository_owner == 'emqx'
  12. container: ghcr.io/emqx/emqx-builder/5.0-34:1.13.4-24.3.4.2-3-ubuntu22.04
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. profile:
  17. - ['emqx', 'master']
  18. - ['emqx-enterprise', 'release-50']
  19. steps:
  20. - uses: actions/checkout@v3
  21. with:
  22. ref: ${{ matrix.profile[1] }}
  23. path: source
  24. fetch-depth: 0
  25. - name: get_all_deps
  26. run: |
  27. pushd source
  28. # make sure all previous left-overs are cleaned
  29. make clean-all
  30. # enterprise is a super-set, should be enough for all profiles
  31. make deps-emqx-enterprise
  32. popd
  33. zip -ryq source.zip source/* source/.[^.]*
  34. - uses: actions/upload-artifact@v3
  35. with:
  36. name: source-${{ matrix.profile[0] }}
  37. path: source.zip
  38. linux:
  39. needs: prepare
  40. runs-on: aws-${{ matrix.arch }}
  41. # always run in builder container because the host might have the wrong OTP version etc.
  42. # otherwise buildx.sh does not run docker if arch and os matches the target arch and os.
  43. container:
  44. image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
  45. strategy:
  46. fail-fast: false
  47. matrix:
  48. profile:
  49. - emqx
  50. - emqx-enterprise
  51. otp:
  52. - 24.3.4.2-3
  53. arch:
  54. - amd64
  55. os:
  56. - debian10
  57. - amzn2
  58. builder:
  59. - 5.0-34
  60. elixir:
  61. - 1.13.4
  62. defaults:
  63. run:
  64. shell: bash
  65. steps:
  66. - uses: AutoModality/action-clean@v1
  67. - uses: actions/download-artifact@v3
  68. with:
  69. name: source-${{ matrix.profile }}
  70. path: .
  71. - name: unzip source code
  72. run: unzip -q source.zip
  73. - name: build emqx packages
  74. working-directory: source
  75. env:
  76. ELIXIR: ${{ matrix.elixir }}
  77. PROFILE: ${{ matrix.profile[0] }}
  78. ARCH: ${{ matrix.arch }}
  79. run: |
  80. set -eu
  81. PKGTYPES="tgz pkg"
  82. IS_ELIXIR="no"
  83. for PKGTYPE in ${PKGTYPES};
  84. do
  85. ./scripts/buildx.sh \
  86. --profile "${PROFILE}" \
  87. --pkgtype "${PKGTYPE}" \
  88. --arch "${ARCH}" \
  89. --elixir "${IS_ELIXIR}" \
  90. --builder "builder_to_be_ignored"
  91. done
  92. - uses: actions/upload-artifact@v3
  93. if: success()
  94. with:
  95. name: ${{ matrix.profile }}
  96. path: source/_packages/${{ matrix.profile }}/
  97. - name: Send notification to Slack
  98. uses: slackapi/slack-github-action@v1.23.0
  99. if: failure()
  100. env:
  101. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  102. with:
  103. payload: |
  104. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  105. mac:
  106. needs: prepare
  107. strategy:
  108. fail-fast: false
  109. matrix:
  110. profile:
  111. - emqx
  112. otp:
  113. - 24.3.4.2-3
  114. os:
  115. - macos-12
  116. - macos-12-arm64
  117. runs-on: ${{ matrix.os }}
  118. steps:
  119. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  120. - uses: actions/download-artifact@v3
  121. with:
  122. name: source-${{ matrix.profile }}
  123. path: .
  124. - name: unzip source code
  125. run: |
  126. ln -s . source
  127. unzip -o -q source.zip
  128. rm source source.zip
  129. - uses: ./.github/actions/package-macos
  130. with:
  131. profile: ${{ matrix.profile }}
  132. otp: ${{ matrix.otp }}
  133. os: ${{ matrix.os }}
  134. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  135. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  136. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  137. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  138. - uses: actions/upload-artifact@v3
  139. if: success()
  140. with:
  141. name: ${{ matrix.profile }}
  142. path: _packages/${{ matrix.profile }}/
  143. - name: Send notification to Slack
  144. uses: slackapi/slack-github-action@v1.23.0
  145. if: failure()
  146. env:
  147. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  148. with:
  149. payload: |
  150. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}