name: Compile

on:
  push:
    branches:
      - main
      - test*
  workflow_dispatch: # Manual trigger added

jobs:
  build-runspace:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v4
      with:
        ref: ${{ github.head_ref }}
    - name: Compile project
      shell: pwsh
      run: |
        Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
      continue-on-error: false # Directly fail the job on error, removing the need for a separate check
    - uses: stefanzweifel/git-auto-commit-action@v5
      with:
        commit_message: Compile Winutil
      if: success()
