services:
  - docker

environment:
  matrix:
    - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
      DOCKERFILE: Dockerfile-ubuntu_20_04
    - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
      DOCKERFILE: Dockerfile-ubuntu_21_04
    - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
      DOCKERFILE: Dockerfile-debian
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
      BUILD_TYPE: Release

install:
  - cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make"

before_build:
  - cmd: git submodule update --init --recursive
  - cmd: mkdir build
  - cmd: cd build
  - sh: cd scripts
  - sh: ./build-container.sh -f $DOCKERFILE

build_script:
  - cmd: set OLDPATH=%PATH%
  - cmd: set PATH=C:\msys64\mingw64\bin
  - cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
  - cmd: mingw32-make -j2
  - cmd: set PATH=%OLDPATH%
  - sh: ./build-sunshine.sh -pu

after_build:
  - cmd: Del ..\assets\apps_linux.json
  - cmd: 7z a Sunshine-Windows.zip ..\assets
  - cmd: 7z a Sunshine-Windows.zip sunshine.exe
  - cmd: 7z a Sunshine-Windows.zip tools\dxgi-info.exe
  - cmd: 7z a Sunshine-Windows.zip tools\audio-info.exe
  - cmd: 7z a Sunshine-Windows.zip tools\sunshinesvc.exe
  - cmd: 7z a Sunshine-Windows.zip ..\tools\install-service.bat
  - cmd: 7z a Sunshine-Windows.zip ..\tools\uninstall-service.bat
  - cmd: appveyor PushArtifact Sunshine-Windows.zip
  - sh: appveyor PushArtifact sunshine-build/sunshine.deb

