name: "Continuous build (macOS)"

on:
  push:
    branches:
      - '*'
    tags-ignore:
      - 'continuous*'

jobs:
  build:
    strategy:
      matrix:
        include:
          - os: macos-15
            target: 10.9

          - os: macos-15
            target: 11.0

      fail-fast: false

    runs-on: ${{ matrix.os }}

    steps:
      - name: Install dependencies
        run: |
          brew install automake libtool meson nasm yasm

      - name: Import certificates
        uses: apple-actions/import-codesign-certs@v6
        with:
          p12-file-base64: ${{ secrets.CERTIFICATES }}
          p12-password: ${{ secrets.CERTIFICATES_PASSWORD }}

      - name: Checkout repository
        uses: actions/checkout@v6
        with:
          submodules: recursive

      - name: Build DMG
        env:
          MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }}
          NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
          RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
        run: |
          .github/workflows/tools/build-macos
