name: "Continuous build (Windows)"

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

jobs:
  build:
    strategy:
      matrix:
        include:
          - os: windows-latest
            arch: X86_64
            system: system-x64
            mingw: 64

          - os: windows-latest
            arch: X86
            system: system-i686
            mingw: 32

          - os: windows-latest
            arch: ARM64
            system: system-arm64
            mingw: 64

      fail-fast: false

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

    defaults:
      run:
        shell: cmd

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

      - name: Build
        env:
          RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
        run: |
          set CDK_INSTALL_PATH=%CD%\boca
          set PATH=%CDK_INSTALL_PATH%\${{ matrix.system }}\usr\bin;%PATH%
          mkdir %CDK_INSTALL_PATH%\${{ matrix.system }}\tmp 2> nul
          set MSYSTEM=MINGW${{ matrix.mingw }}
          set BUILD_WIN32=True
          set BUILD_${{ matrix.arch }}=True
          bash .github/workflows/tools/build-windows
