build_packages_cron.yaml 3.7 KB

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