build_packages_cron.yaml 3.7 KB

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