name: Windows

on:
  push:
    branches:
      - main

env:
  ARTIFACT_EXECUTABLE: itaxotools-hapsolutely-windows


jobs:

  build-executable:
    name: Build Windows executable
    runs-on: windows-2019

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.x

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements-live.txt
          pip install ".[dev]"

      - name: Make executable
        uses: iTaxoTools/TaxIGui/.github/actions/make-executable@main

      - uses: actions/upload-artifact@v3
        with:
          name: ${{ env.ARTIFACT_EXECUTABLE }}
          path: dist/*.exe
