name: Compile and Push to Itch

on:
  push:
    branches: 
      - master

jobs:
  build:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v1
      with:
        ref: master
    - uses: warrenbuckley/Setup-MSBuild@v1
    - name: Compile Release
      working-directory: build
      run: |
        ..\tools\genie.exe vs2019
        msbuild vs2019\Symmetry.sln -p:Configuration=Release
    - env:
        BUTLER_API_KEY: ${{secrets.ITCH_CREDENTIALS}}
      name: Upload to Itch
      run: |
        curl -L -o butler.zip https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default
        7z e butler.zip
        .\butler.exe push bin bluerriq/symmetry:windows-prealpha --userversion-file bin/version.txt

      
    
