name: Build executable

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    permissions:
      contents: read

    steps:
      - uses: actions/checkout@v5

      - uses: pnpm/action-setup@v5
        with:
          version: 10

      - uses: actions/setup-node@v5
        with:
          node-version: 22
          cache: pnpm
          cache-dependency-path: web-panel/pnpm-lock.yaml

      - name: Build unsigned executable
        shell: pwsh
        run: ./build.ps1 -Configuration Release

      - name: Upload unsigned executable
        uses: actions/upload-artifact@v6
        with:
          name: WandEnhancer-unsigned
          path: WandEnhancer/bin/Release/WandEnhancer.exe
          if-no-files-found: error
