build_packages_cron.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. workflow_dispatch:
  9. jobs:
  10. linux:
  11. needs: prepare
  12. runs-on: aws-${{ matrix.arch }}
  13. # always run in builder container because the host might have the wrong OTP version etc.
  14. # otherwise buildx.sh does not run docker if arch and os matches the target arch and os.
  15. container:
  16. image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. profile:
  21. - emqx
  22. - emqx-enterprise
  23. branch:
  24. - master
  25. - release-50
  26. otp:
  27. - 24.3.4.2-3
  28. arch:
  29. - amd64
  30. os:
  31. - debian10
  32. - amzn2
  33. builder:
  34. - 5.0-34
  35. elixir:
  36. - 1.13.4
  37. defaults:
  38. run:
  39. shell: bash
  40. steps:
  41. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  42. - uses: actions/checkout@v3
  43. with:
  44. ref: ${{ matrix.branch }}
  45. fetch-depth: 0
  46. - name: build emqx packages
  47. env:
  48. ELIXIR: ${{ matrix.elixir }}
  49. PROFILE: ${{ matrix.profile }}
  50. ARCH: ${{ matrix.arch }}
  51. run: |
  52. set -eu
  53. PKGTYPES="tgz pkg"
  54. IS_ELIXIR="no"
  55. for PKGTYPE in ${PKGTYPES};
  56. do
  57. ./scripts/buildx.sh \
  58. --profile "${PROFILE}" \
  59. --pkgtype "${PKGTYPE}" \
  60. --arch "${ARCH}" \
  61. --elixir "${IS_ELIXIR}" \
  62. --builder "force_host"
  63. done
  64. - uses: actions/upload-artifact@v3
  65. if: success()
  66. with:
  67. name: ${{ matrix.profile }}
  68. path: _packages/${{ matrix.profile }}/
  69. - name: Send notification to Slack
  70. uses: slackapi/slack-github-action@v1.23.0
  71. if: failure()
  72. env:
  73. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  74. with:
  75. payload: |
  76. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  77. mac:
  78. needs: prepare
  79. strategy:
  80. fail-fast: false
  81. matrix:
  82. profile:
  83. - emqx
  84. otp:
  85. - 24.3.4.2-3
  86. os:
  87. - macos-12
  88. - macos-12-arm64
  89. runs-on: ${{ matrix.os }}
  90. steps:
  91. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  92. - uses: actions/checkout@v3
  93. with:
  94. ref: ${{ matrix.branch }}
  95. fetch-depth: 0
  96. - uses: ./.github/actions/package-macos
  97. with:
  98. profile: ${{ matrix.profile }}
  99. otp: ${{ matrix.otp }}
  100. os: ${{ matrix.os }}
  101. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  102. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  103. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  104. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  105. - uses: actions/upload-artifact@v3
  106. if: success()
  107. with:
  108. name: ${{ matrix.profile }}
  109. path: _packages/${{ matrix.profile }}/
  110. - name: Send notification to Slack
  111. uses: slackapi/slack-github-action@v1.23.0
  112. if: failure()
  113. env:
  114. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  115. with:
  116. payload: |
  117. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}