version: '{build}'
image: Visual Studio 2017

pull_requests:
  do_not_increment_build_number: true

environment:
    BUILD: $(APPVEYOR_BUILD_NUMBER)
    COVERITY_EMAIL:
        secure: 9iw6ajDvltEymr75DhlRbH8X+2olJ8mbWLPqyYMmleg=
    COVERITY_TOKEN:
        secure: S9XU2JhyUK9XstLG3CN2vB5M8ce8zYZp5VECx3kvx24=

build_script:
- ps: >-
    if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True") {
        & .\build.cmd coverity
    } else {
        & .\build.cmd
    }

on_failure:
  - ps: $root = (Resolve-Path artifacts); [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName failed-build }

nuget:
    disable_publish_on_pr: true

test: off

artifacts:
    - path: .\artifacts\*\*

deploy:
    - provider: NuGet
      api_key:
          secure: BVzuxe9khaakJDNLAhtUM2w5G3gAkoOasCDAilstAtpLuCdFNfu3jrf0KrI5B1Bo
      skip_symbols: true
      on:
          appveyor_repo_tag: true

version: '{build}'
image: Visual Studio 2017

pull_requests:
  do_not_increment_build_number: true

environment:
    BUILD: $(APPVEYOR_BUILD_NUMBER)
    COVERITY_EMAIL:
        secure: 9iw6ajDvltEymr75DhlRbH8X+2olJ8mbWLPqyYMmleg=
    COVERITY_TOKEN:
        secure: S9XU2JhyUK9XstLG3CN2vB5M8ce8zYZp5VECx3kvx24=

build_script:
- cmd: if defined APPVEYOR_SCHEDULED_BUILD (build.cmd coverity) else (build.cmd)

on_failure:
  - ps: $root = (Resolve-Path artifacts); [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName failed-build }

nuget:
    disable_publish_on_pr: true

test: off

artifacts:
    - path: .\artifacts\*\*

deploy:
    - provider: NuGet
      api_key:
          secure: BVzuxe9khaakJDNLAhtUM2w5G3gAkoOasCDAilstAtpLuCdFNfu3jrf0KrI5B1Bo
      skip_symbols: true
      on:
          appveyor_repo_tag: true

Use cmd to invoke build, not PowerShell
Use cmd to invoke build, not PowerShell

Works around spurious "build failure" when PowerShell sees output
on standard out.
