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