build_packages_cron.yaml 3.8 KB

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