name: Build
on:
  pull_request:
    branches:
      - main
jobs:
  Build:
    runs-on: windows-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v6
        with:
          submodules: true

      - name: Set up .NET
        uses: actions/setup-dotnet@v5
        with:
          dotnet-version: '10.0.x'

      - name: Download Dalamud Latest
        run: |
          Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip
          Expand-Archive -Force latest.zip -DestinationPath "$env:AppData\XIVLauncher\addon\Hooks\dev"

      - name: Restore NuGet Packages
        run: dotnet restore RotationSolver/RotationSolver.csproj

      - name: Build Plugin
        run: dotnet build --no-restore -c Release RotationSolver/RotationSolver.csproj
