build_packages_cron.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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-51']
  23. otp:
  24. - 25.3.2-1
  25. arch:
  26. - amd64
  27. os:
  28. - debian10
  29. - amzn2
  30. builder:
  31. - 5.1-0
  32. elixir:
  33. - 1.14.5
  34. defaults:
  35. run:
  36. shell: bash
  37. steps:
  38. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  39. - uses: actions/checkout@v3
  40. with:
  41. ref: ${{ matrix.profile[1] }}
  42. fetch-depth: 0
  43. - name: build emqx packages
  44. env:
  45. ELIXIR: ${{ matrix.elixir }}
  46. PROFILE: ${{ matrix.profile[0] }}
  47. ARCH: ${{ matrix.arch }}
  48. run: |
  49. set -eu
  50. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  51. PKGTYPES="tgz pkg"
  52. IS_ELIXIR="no"
  53. for PKGTYPE in ${PKGTYPES};
  54. do
  55. ./scripts/buildx.sh \
  56. --profile "${PROFILE}" \
  57. --pkgtype "${PKGTYPE}" \
  58. --arch "${ARCH}" \
  59. --elixir "${IS_ELIXIR}" \
  60. --builder "force_host"
  61. done
  62. - uses: actions/upload-artifact@v3
  63. if: success()
  64. with:
  65. name: ${{ matrix.profile[0] }}
  66. path: _packages/${{ matrix.profile[0] }}/
  67. - name: Send notification to Slack
  68. uses: slackapi/slack-github-action@v1.23.0
  69. if: failure()
  70. env:
  71. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  72. with:
  73. payload: |
  74. {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  75. mac:
  76. runs-on: ${{ matrix.os }}
  77. if: github.repository_owner == 'emqx'
  78. strategy:
  79. fail-fast: false
  80. matrix:
  81. profile:
  82. - emqx
  83. branch:
  84. - master
  85. otp:
  86. - 25.3.2-1
  87. os:
  88. - macos-12
  89. - macos-12-arm64
  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 }}"}