build_packages_cron.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. permissions:
  10. contents: read
  11. jobs:
  12. linux:
  13. if: github.repository_owner == 'emqx'
  14. runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
  15. container:
  16. image: "ghcr.io/emqx/emqx-builder/${{ matrix.profile[2] }}-${{ matrix.os }}"
  17. strategy:
  18. fail-fast: false
  19. matrix:
  20. profile:
  21. - ['emqx', 'master', '5.3-5:1.15.7-26.2.1-2']
  22. - ['emqx', 'release-57', '5.3-5:1.15.7-26.2.1-2']
  23. os:
  24. - ubuntu22.04
  25. - amzn2023
  26. defaults:
  27. run:
  28. shell: bash
  29. steps:
  30. - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
  31. with:
  32. ref: ${{ matrix.profile[1] }}
  33. fetch-depth: 0
  34. - name: fix workdir
  35. run: |
  36. set -eu
  37. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  38. # Align path for CMake caches
  39. if [ ! "$PWD" = "/emqx" ]; then
  40. ln -s $PWD /emqx
  41. cd /emqx
  42. fi
  43. echo "pwd is $PWD"
  44. - name: build emqx packages
  45. env:
  46. PROFILE: ${{ matrix.profile[0] }}
  47. ACLOCAL_PATH: "/usr/share/aclocal:/usr/local/share/aclocal"
  48. run: |
  49. set -eu
  50. make "${PROFILE}-tgz"
  51. make "${PROFILE}-pkg"
  52. - name: test emqx packages
  53. env:
  54. PROFILE: ${{ matrix.profile[0] }}
  55. run: |
  56. set -eu
  57. ./scripts/pkg-tests.sh "${PROFILE}-tgz"
  58. ./scripts/pkg-tests.sh "${PROFILE}-pkg"
  59. - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  60. if: success()
  61. with:
  62. name: ${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.os }}
  63. path: _packages/${{ matrix.profile[0] }}/
  64. retention-days: 7
  65. - name: Send notification to Slack
  66. uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
  67. if: failure()
  68. env:
  69. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  70. with:
  71. payload: |
  72. {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  73. mac:
  74. runs-on: ${{ matrix.os }}
  75. if: github.repository_owner == 'emqx'
  76. strategy:
  77. fail-fast: false
  78. matrix:
  79. profile:
  80. - emqx
  81. branch:
  82. - master
  83. otp:
  84. - 26.2.1-2
  85. os:
  86. - macos-12-arm64
  87. steps:
  88. - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
  89. with:
  90. ref: ${{ matrix.branch }}
  91. fetch-depth: 0
  92. - uses: ./.github/actions/package-macos
  93. with:
  94. profile: ${{ matrix.profile }}
  95. otp: ${{ matrix.otp }}
  96. os: ${{ matrix.os }}
  97. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  98. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  99. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  100. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  101. - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  102. if: success()
  103. with:
  104. name: ${{ matrix.profile }}-${{ matrix.os }}
  105. path: _packages/${{ matrix.profile }}/
  106. retention-days: 7
  107. - name: Send notification to Slack
  108. uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
  109. if: failure()
  110. env:
  111. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  112. with:
  113. payload: |
  114. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}