environment:
  matrix:
  - MSYSTEM: MINGW64

install:
  # upgrading gcc to 6.x fails
  - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Suuy mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake git mingw-w64-x86_64-mpfr"

build_script:
  - C:\msys64\usr\bin\bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && mkdir build && cd build && cmake ../src -DINCLUDE_MSYS2_DLLS=ON -DCMAKE_BUILD_TYPE=Release -G Ninja"
  - C:\msys64\usr\bin\bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER/build && ninja && cpack"

test_script:
  - C:\msys64\usr\bin\bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER/build && ctest -j4"

artifacts:
  - path: build\lean-@LEAN_VERSION_MAJOR@.@LEAN_VERSION_MINOR@.@LEAN_VERSION_PATCH@-windows.zip
    name: binary

deploy:
  description: 'Lean release'
  provider: GitHub
  auth_token:
    secure: d+yPrDEAbiNrcf3a0PDNYEn/ieOOP6M7cP9zje+QkJEjHFdjBjWMe8b3qrC1hrus
  artifact: binary
  draft: false
  prerelease: false
  on:
    appveyor_repo_tag: true
