version: 2.0.{build}
environment:
  matrix:
  - solution_name: win32/sdlpal.sln
    BUILD_WIN32:
    BUILD_UWP: rem
  - solution_name: winrt/SDLPal.UWP.sln
    BUILD_WIN32: rem
    BUILD_UWP: 
build_script:
  - |
    %BUILD_WIN32% msbuild %solution_name% /p:Configuration=Release /m
  - |
    %BUILD_UWP% msbuild %solution_name% /p:Configuration=Release;AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /m
before_build:
  # SDL include/lib setup; for win32
  - |-
    %BUILD_WIN32% appveyor DownloadFile http://www.libsdl.org/release/SDL2-devel-2.0.5-VC.zip
    %BUILD_WIN32% 7z x SDL2-devel-2.0.5-VC.zip
    %BUILD_WIN32% move /y SDL2-2.0.5\include SDL2\ > nul
    %BUILD_WIN32% move /y SDL2-2.0.5\lib SDL2\ > nul
    %BUILD_WIN32% rd /s /q SDL2-2.0.5 > nul

  # SDL src setup; for UWP
  - |-
    %BUILD_UWP% appveyor DownloadFile http://www.libsdl.org/release/SDL2-2.0.5.zip
    %BUILD_UWP% 7z x SDL2-2.0.5.zip
    %BUILD_UWP% rd /s /q SDL2 > nul
    %BUILD_UWP% move /y SDL2-2.0.5 SDL2 > nul

deploy:
- provider: GitHub
  on:
    appveyor_repo_tag: true
  auth_token:
    secure: RYDRqm5LncsJG32FRSlCkLzkJC4ykCtlgO3+xW4q80wQOA3U9pHAe2beyMEduJIe
artifacts:
  - path: win32/Release/sdlpal.exe
    name: win32 build

  - path: winrt/AppPackages/SDLPal
    name: SDLPal UWP
    type: zip
notifications:
- provider: Webhook
  url: https://webhooks.gitter.im/e/2accb0e6e37119e604b3
  method: POST
  on_build_success: true
  on_build_failure: true
  on_build_status_changed: true
