environment:
  matrix:
    - CMAKE_BUILD_TYPE: DEBUG
    - CMAKE_BUILD_TYPE: RELEASE

platform:
  - x86
  - x64

init:
  - cmd: set PATH=C:\Program Files (x86)\CMake\bin\;%PATH%

before_build:
  - cmake .

build_script:
  - cmake --build . --config %CMAKE_BUILD_TYPE%

test_script:
  - ctest -C %CMAKE_BUILD_TYPE%

after_build:
  - cpack -G WIX -C %CMAKE_BUILD_TYPE%

artifacts:
  - path: '*.msi'

deploy:
  provider: GitHub
  auth_token:
    secure: AtMhevKUU0Cf+huWpOz+axnd0TdO5fO+m6yjLR34qYKRqdsBIPI508k/sMxDxzLj
  draft: false
  prerelease: false
  force_update: true
  on:
    branch: master
    appveyor_repo_tag: true
    CMAKE_BUILD_TYPE: RELEASE
    platform: x64

environment:
  matrix:
    - CMAKE_BUILD_TYPE: DEBUG
    - CMAKE_BUILD_TYPE: RELEASE

platform:
  - x86
  - x64

init:
  - cmd: set PATH=C:\Program Files (x86)\CMake\bin\;%PATH%

before_build:
  - cmake .

build_script:
  - cmake --build . --config %CMAKE_BUILD_TYPE%

test_script:
  - ctest -C %CMAKE_BUILD_TYPE%

after_test:
  - cpack -G WIX -C %CMAKE_BUILD_TYPE%

artifacts:
  - path: '*.msi'

deploy:
  provider: GitHub
  auth_token:
    secure: AtMhevKUU0Cf+huWpOz+axnd0TdO5fO+m6yjLR34qYKRqdsBIPI508k/sMxDxzLj
  draft: false
  prerelease: false
  force_update: true
  on:
    branch: master
    appveyor_repo_tag: true
    CMAKE_BUILD_TYPE: RELEASE
    platform: x64

Move CPack from after_build to after_test
Move CPack from after_build to after_test
