build_packages_cron.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. if: github.repository_owner == 'emqx'
  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', 'master']
  22. - ['emqx-enterprise', 'release-50']
  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.profile[1] }}
  45. fetch-depth: 0
  46. - name: build emqx packages
  47. env:
  48. ELIXIR: ${{ matrix.elixir }}
  49. PROFILE: ${{ matrix.profile[0] }}
  50. ARCH: ${{ matrix.arch }}
  51. run: |
  52. set -eu
  53. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  54. PKGTYPES="tgz pkg"
  55. IS_ELIXIR="no"
  56. for PKGTYPE in ${PKGTYPES};
  57. do
  58. ./scripts/buildx.sh \
  59. --profile "${PROFILE}" \
  60. --pkgtype "${PKGTYPE}" \
  61. --arch "${ARCH}" \
  62. --elixir "${IS_ELIXIR}" \
  63. --builder "force_host"
  64. done
  65. - uses: actions/upload-artifact@v3
  66. if: success()
  67. with:
  68. name: ${{ matrix.profile[0] }}
  69. path: _packages/${{ matrix.profile[0] }}/
  70. - name: Send notification to Slack
  71. uses: slackapi/slack-github-action@v1.23.0
  72. if: failure()
  73. env:
  74. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  75. with:
  76. payload: |
  77. {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  78. mac:
  79. runs-on: ${{ matrix.os }}
  80. if: github.repository_owner == 'emqx'
  81. strategy:
  82. fail-fast: false
  83. matrix:
  84. profile:
  85. - emqx
  86. branch:
  87. - master
  88. otp:
  89. - 24.3.4.2-3
  90. os:
  91. - macos-12
  92. - macos-12-arm64
  93. steps:
  94. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  95. - uses: actions/checkout@v3
  96. with:
  97. ref: ${{ matrix.branch }}
  98. fetch-depth: 0
  99. - uses: ./.github/actions/package-macos
  100. with:
  101. profile: ${{ matrix.profile }}
  102. otp: ${{ matrix.otp }}
  103. os: ${{ matrix.os }}
  104. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  105. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  106. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  107. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  108. - uses: actions/upload-artifact@v3
  109. if: success()
  110. with:
  111. name: ${{ matrix.profile }}
  112. path: _packages/${{ matrix.profile }}/
  113. - name: Send notification to Slack
  114. uses: slackapi/slack-github-action@v1.23.0
  115. if: failure()
  116. env:
  117. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  118. with:
  119. payload: |
  120. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}