install:
  - git submodule update --init --recursive
  - set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\bin;%PATH%
  - mingw32-make -v
  - make -v
  - uname
  - set MSYS=winsymlinks:native

build_script:
  - appveyor AddCompilationMessage "Building 3rd party libraries"
  - bash -c "mingw32-make 3rdparty API=win32 ; gpgconf --kill all"
  - appveyor AddCompilationMessage "Tests"
  - mingw32-make -C src/ check API=win32
  - curl -F 'file=@test-report.xml' "https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%"
#  - mingw32-make -C src/ print-.VARIABLES API=win32 V=1
  - appveyor AddCompilationMessage "Building GrafX2"
  - mingw32-make API=win32
  - appveyor AddCompilationMessage "Building zip package"
  - mingw32-make ziprelease API=win32
  - appveyor AddCompilationMessage "Building win32 installer"
  - mingw32-make win32installer API=win32
#  - mingw32-make 3rdparty API=sdl2
#  - mingw32-make API=sdl2
#  - mingw32-make ziprelease API=sdl2

artifacts:
  - path: '*.7z'
    name: GrafX2 portable installation
  - path: 'install\*.exe'
    name: GrafX2 installer

on_failure:
  - 'dir /S tools'
