build_packages_cron.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. make -C source deps-all
  28. zip -ryq source.zip source/* source/.[^.]*
  29. - uses: actions/upload-artifact@v3
  30. with:
  31. name: source-${{ matrix.profile[1] }}
  32. path: source.zip
  33. linux:
  34. needs: prepare
  35. runs-on: aws-${{ matrix.arch }}
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. profile:
  40. - emqx
  41. - emqx-enterprise
  42. otp:
  43. - 24.3.4.2-3
  44. arch:
  45. - amd64
  46. os:
  47. - debian10
  48. - amzn2
  49. builder:
  50. - 5.0-34
  51. elixir:
  52. - 1.13.4
  53. defaults:
  54. run:
  55. shell: bash
  56. steps:
  57. - uses: AutoModality/action-clean@v1
  58. - uses: actions/download-artifact@v3
  59. with:
  60. name: source-${{ matrix.profile }}
  61. path: .
  62. - name: unzip source code
  63. run: unzip -q source.zip
  64. - name: build emqx packages
  65. working-directory: source
  66. env:
  67. BUILDER: ${{ matrix.builder }}
  68. ELIXIR: ${{ matrix.elixir }}
  69. OTP: ${{ matrix.otp }}
  70. PROFILE: ${{ matrix.profile[0] }}
  71. ARCH: ${{ matrix.arch }}
  72. OS: ${{ matrix.os }}
  73. run: |
  74. set -eu
  75. PKGTYPES="tgz pkg"
  76. IS_ELIXIR="no"
  77. for PKGTYPE in ${PKGTYPES};
  78. do
  79. ./scripts/buildx.sh \
  80. --profile "${PROFILE}" \
  81. --pkgtype "${PKGTYPE}" \
  82. --arch "${ARCH}" \
  83. --elixir "${IS_ELIXIR}" \
  84. --builder "ghcr.io/emqx/emqx-builder/${BUILDER}:${ELIXIR}-${OTP}-${OS}
  85. done
  86. - uses: actions/upload-artifact@v3
  87. if: success()
  88. with:
  89. name: ${{ matrix.profile }}
  90. path: source/_packages/${{ matrix.profile }}/
  91. - name: Send notification to Slack
  92. uses: slackapi/slack-github-action@v1.23.0
  93. if: failure()
  94. env:
  95. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  96. with:
  97. payload: |
  98. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  99. mac:
  100. needs: prepare
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. profile:
  105. - emqx
  106. otp:
  107. - 24.3.4.2-3
  108. os:
  109. - macos-12
  110. - macos-12-arm64
  111. runs-on: ${{ matrix.os }}
  112. steps:
  113. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  114. - uses: actions/download-artifact@v3
  115. with:
  116. name: source-${{ matrix.profile }}
  117. path: .
  118. - name: unzip source code
  119. run: |
  120. ln -s . source
  121. unzip -o -q source.zip
  122. rm source source.zip
  123. - uses: ./.github/actions/package-macos
  124. with:
  125. profile: ${{ matrix.profile }}
  126. otp: ${{ matrix.otp }}
  127. os: ${{ matrix.os }}
  128. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  129. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  130. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  131. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  132. - uses: actions/upload-artifact@v3
  133. if: success()
  134. with:
  135. name: ${{ matrix.profile }}
  136. path: _packages/${{ matrix.profile }}/
  137. - name: Send notification to Slack
  138. uses: slackapi/slack-github-action@v1.23.0
  139. if: failure()
  140. env:
  141. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  142. with:
  143. payload: |
  144. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}