image:
  - macOS
  - 'Visual Studio 2019'

branches:
  only:
    - master
    - develop
    - /^v\d.*$/
    - /^deploy-test(-.*)?$/

configuration:
  - Release

for:
  - matrix:
      only:
        - image: 'Visual Studio 2019'

    install:
      - git submodule update --init --recursive

    build_script:
      - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
      - C:\msys64\usr\bin\bash -lc "cd \"%APPVEYOR_BUILD_FOLDER%\" && scripts/appveyor-win.sh"

    artifacts:
      - path: Chiaki
        name: Chiaki
      - path: Chiaki-PDB
        name: Chiaki-PDB

  - matrix:
      only:
        - image: macOS

    install:
      - git submodule update --init --recursive
      - sudo pip3 install protobuf
      - HOMEBREW_NO_AUTO_UPDATE=1 brew install qt@5 opus openssl@1.1 nasm sdl2 protobuf
      - scripts/build-ffmpeg.sh

    build_script:
      - export CMAKE_PREFIX_PATH="`pwd`/ffmpeg-prefix;/usr/local/opt/openssl@1.1;/usr/local/opt/qt@5"
      - scripts/build-common.sh
      - cp -a build/gui/chiaki.app Chiaki.app
      - /usr/local/opt/qt@5/bin/macdeployqt Chiaki.app -dmg

    artifacts:
      - path: Chiaki.dmg
        name: Chiaki
