environment:
 github_release_token:
  secure: TTQbwwwftUsijup2DaIPSnfBoYtXNrPVUFxNdFF/kugUndKeQk2k7YUSe1C1ojZn
 matrix:
  - nodejs_version: 4
  - nodejs_version: 5
  - nodejs_version: 6
  - nodejs_version: 7
  - nodejs_version: 8

image: Visual Studio 2015

install:
  - ps: Install-Product node $env:nodejs_version
  - npm install -g npm
  - node --version
  - npm --version
  - git submodule update --init --recursive

build_script:
  - npm install --build-from-source

test_script:
  - npm test

artifacts:
  - path: build\stage\gagern\node-libtidy\releases\download\**\*.tar.gz
    name: binary

before_deploy:
  - node_modules/.bin/node-pre-gyp package

deploy:
  - provider: GitHub
    release: $(APPVEYOR_REPO_TAG_NAME)
    artifact: binary
    auth_token: $(github_release_token)
    draft: true
    prerelease: false
    on:
      appveyor_repo_tag: true

after_deploy:
  - git clean -fdx
  - npm install --fallback-to-build=false
  - npm test

environment:
 github_release_token:
  secure: TTQbwwwftUsijup2DaIPSnfBoYtXNrPVUFxNdFF/kugUndKeQk2k7YUSe1C1ojZn
 matrix:
  - nodejs_version: 5
  - nodejs_version: 6
  - nodejs_version: 7
  - nodejs_version: 8

platform:
  - x86
  - x64

image: Visual Studio 2015

install:
  - ps: Install-Product node $env:nodejs_version
  - npm install -g npm
  - node --version
  - npm --version
  - git submodule update --init --recursive

build_script:
  - npm install --build-from-source

test_script:
  - npm test

artifacts:
  - path: build\stage\gagern\node-libtidy\releases\download\**\*.tar.gz
    name: binary

before_deploy:
  - node_modules/.bin/node-pre-gyp package

deploy:
  - provider: GitHub
    release: $(APPVEYOR_REPO_TAG_NAME)
    artifact: binary
    auth_token: $(github_release_token)
    draft: true
    prerelease: false
    on:
      appveyor_repo_tag: true

after_deploy:
  - git clean -fdx
  - npm install --fallback-to-build=false
  - npm test

Enable 32 and 64 bit builds on Windows, disable Node version 4
Enable 32 and 64 bit builds on Windows, disable Node version 4

Appveyor has a problem with Node 4 32 bit, for details see
https://github.com/mapbox/node-pre-gyp/issues/209.
