build_packages_cron.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. strategy:
  16. fail-fast: false
  17. matrix:
  18. profile:
  19. - ['emqx', 'master']
  20. - ['emqx', 'release-57']
  21. - ['emqx', 'release-58']
  22. os:
  23. - ubuntu22.04
  24. - amzn2023
  25. env:
  26. PROFILE: ${{ matrix.profile[0] }}
  27. OS: ${{ matrix.os }}
  28. BUILDER_SYSTEM: force_docker
  29. defaults:
  30. run:
  31. shell: bash
  32. steps:
  33. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  34. with:
  35. ref: ${{ matrix.profile[1] }}
  36. fetch-depth: 0
  37. - name: Set up environment
  38. id: env
  39. run: |
  40. source env.sh
  41. BUILDER="ghcr.io/emqx/emqx-builder/${EMQX_BUILDER_VSN}:${ELIXIR_VSN}-${OTP_VSN}-${OS}"
  42. echo "BUILDER=$BUILDER" >> "$GITHUB_ENV"
  43. - name: build tgz
  44. run: |
  45. ./scripts/buildx.sh --profile "$PROFILE" --pkgtype tgz --builder "$BUILDER"
  46. - name: build pkg
  47. run: |
  48. ./scripts/buildx.sh --profile "$PROFILE" --pkgtype pkg --builder "$BUILDER"
  49. - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
  50. if: success()
  51. with:
  52. name: ${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.os }}
  53. path: _packages/${{ matrix.profile[0] }}/
  54. retention-days: 7
  55. - name: Send notification to Slack
  56. uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
  57. if: failure()
  58. env:
  59. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  60. with:
  61. payload: |
  62. {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  63. mac:
  64. runs-on: ${{ matrix.os }}
  65. if: github.repository_owner == 'emqx'
  66. strategy:
  67. fail-fast: false
  68. matrix:
  69. profile:
  70. - emqx
  71. branch:
  72. - master
  73. os:
  74. - macos-14-arm64
  75. steps:
  76. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  77. with:
  78. ref: ${{ matrix.branch }}
  79. fetch-depth: 0
  80. - name: Set up environment
  81. id: env
  82. run: |
  83. source env.sh
  84. echo "OTP_VSN=$OTP_VSN" >> "$GITHUB_OUTPUT"
  85. - uses: ./.github/actions/package-macos
  86. with:
  87. profile: ${{ matrix.profile }}
  88. otp: ${{ steps.env.outputs.OTP_VSN }}
  89. os: ${{ matrix.os }}
  90. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  91. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  92. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  93. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  94. - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
  95. if: success()
  96. with:
  97. name: ${{ matrix.profile }}-${{ matrix.os }}
  98. path: _packages/${{ matrix.profile }}/
  99. retention-days: 7
  100. - name: Send notification to Slack
  101. uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
  102. if: failure()
  103. env:
  104. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  105. with:
  106. payload: |
  107. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}