version: '{build}'
clone_folder: C:\projects\flow
os: Visual Studio 2015
platform: x64
environment:
  matrix:
    - OPAM_SWITCH: 4.07.1+mingw64c
      FORK_USER: ocaml
      FORK_BRANCH: master
      CYG_ROOT: C:\cygwin64
      PACKAGE: flowtype-ci
      TESTS: false
      INSTALL: false
      DEPOPTS: false
      REVDEPS: false

install:
- ps: C:\projects\flow\resources\appveyor\install.ps1
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/$env:FORK_USER/ocaml-ci-scripts/$env:FORK_BRANCH/appveyor-install.ps1"))

build_script:
- call %CYG_ROOT%\bin\bash.exe -l %APPVEYOR_BUILD_FOLDER%\appveyor-opam.sh
- call %CYG_ROOT%\bin\bash.exe -l %APPVEYOR_BUILD_FOLDER%\resources\appveyor\build.sh
#- ps: C:\projects\flow\resources\appveyor\build.ps1

after_build:
- ps: C:\projects\flow\resources\appveyor\after_build.ps1

test_script:
- ps: C:\projects\flow\resources\appveyor\test.ps1

cache:
- "%LOCALAPPDATA%\\Yarn"

artifacts:
  - path: bin\*.zip

deploy:
  provider: GitHub
  # flow-bot
  auth_token:
    secure: f1YgYz9csZ8QokY6+aXF10toZtXlFxicbm7uTcylqq+ILoRE6y5GUaf1TfoUalx5
  artifact: /.*\.zip/
  on:
    APPVEYOR_REPO_TAG: true
