name: Scheduled build packages concurrency: group: build-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true on: schedule: - cron: '0 */6 * * *' workflow_dispatch: jobs: linux: if: github.repository_owner == 'emqx' runs-on: aws-${{ matrix.arch }} # always run in builder container because the host might have the wrong OTP version etc. # otherwise buildx.sh does not run docker if arch and os matches the target arch and os. container: image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}" strategy: fail-fast: false matrix: profile: - ['emqx', 'master'] - ['emqx-enterprise', 'release-51'] otp: - 25.3.2-1 arch: - amd64 os: - debian10 - amzn2023 builder: - 5.1-1 elixir: - 1.14.5 defaults: run: shell: bash steps: - uses: emqx/self-hosted-cleanup-action@v1.0.3 - uses: actions/checkout@v3 with: ref: ${{ matrix.profile[1] }} fetch-depth: 0 - name: build emqx packages env: ELIXIR: ${{ matrix.elixir }} PROFILE: ${{ matrix.profile[0] }} ARCH: ${{ matrix.arch }} run: | set -eu git config --global --add safe.directory "$GITHUB_WORKSPACE" PKGTYPES="tgz pkg" IS_ELIXIR="no" for PKGTYPE in ${PKGTYPES}; do ./scripts/buildx.sh \ --profile "${PROFILE}" \ --pkgtype "${PKGTYPE}" \ --arch "${ARCH}" \ --elixir "${IS_ELIXIR}" \ --builder "force_host" done - uses: actions/upload-artifact@v3 if: success() with: name: ${{ matrix.profile[0] }} path: _packages/${{ matrix.profile[0] }}/ - name: Send notification to Slack uses: slackapi/slack-github-action@v1.23.0 if: failure() env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} with: payload: | {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"} mac: runs-on: ${{ matrix.os }} if: github.repository_owner == 'emqx' strategy: fail-fast: false matrix: profile: - emqx branch: - master otp: - 25.3.2-1 os: - macos-12 - macos-12-arm64 steps: - uses: emqx/self-hosted-cleanup-action@v1.0.3 - uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} fetch-depth: 0 - uses: ./.github/actions/package-macos with: profile: ${{ matrix.profile }} otp: ${{ matrix.otp }} os: ${{ matrix.os }} apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }} apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }} apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }} apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }} - uses: actions/upload-artifact@v3 if: success() with: name: ${{ matrix.profile }} path: _packages/${{ matrix.profile }}/ - name: Send notification to Slack uses: slackapi/slack-github-action@v1.23.0 if: failure() env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} with: payload: | {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}