environment:
    DEPLOY_PROVIDER: bintray
    BINTRAY_ACCOUNT: alexpux
    BINTRAY_REPOSITORY: msys2
    PACMAN_REPOSITORY_NAME: ci.msys
    BUILD_URL: https://ci.appveyor.com/project/$(APPVEYOR_ACCOUNT_NAME)/$(APPVEYOR_PROJECT_NAME)/build/$(APPVEYOR_BUILD_VERSION)

build_script:
    # TODO: remove the line below once the AppVeyor installation includes a
    # newer version of pacman that can perform core updates
    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman

    # Git is required but currently not part of AppVeyor installation
    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git

    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade
    - C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci-build.sh"

artifacts:
    - path: artifacts\*

deploy:
    - provider: BinTray
      username: $(BINTRAY_ACCOUNT)
      subject: $(BINTRAY_ACCOUNT)
      repo: $(BINTRAY_REPOSITORY)
      package: $(PACMAN_REPOSITORY_NAME)
      version: latest
      publish: true
      override: true
      api_key:
          secure: BINTRAY_TOKEN_ENCRYPTED_BY_APPVEYOR

environment:
    MSYSTEM: MSYS
    DEPLOY_PROVIDER: bintray
    BINTRAY_ACCOUNT: alexpux
    BINTRAY_REPOSITORY: msys2
    PACMAN_REPOSITORY_NAME: ci.msys
    BUILD_URL: https://ci.appveyor.com/project/$(APPVEYOR_ACCOUNT_NAME)/$(APPVEYOR_PROJECT_NAME)/build/$(APPVEYOR_BUILD_VERSION)

build_script:
    # TODO: remove the line below once the AppVeyor installation includes a
    # newer version of pacman that can perform core updates
    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman

    # Git is required but currently not part of AppVeyor installation
    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git

    - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade
    - C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci-build.sh"

artifacts:
    - path: artifacts\*

deploy:
    - provider: BinTray
      username: $(BINTRAY_ACCOUNT)
      subject: $(BINTRAY_ACCOUNT)
      repo: $(BINTRAY_REPOSITORY)
      package: $(PACMAN_REPOSITORY_NAME)
      version: latest
      publish: true
      override: true
      api_key:
          secure: BINTRAY_TOKEN_ENCRYPTED_BY_APPVEYOR

Set a default shell in AppVeyor.
CI: Set a default shell in AppVeyor.

MSYSTEM is now explicitly set to MSYS, so /opt/bin is added to system
path and related build failures are avoided, for example for packages
using mingw-w64-cross-gcc.
