os: unstable

environment:
  DEBUG: electron-builder
  matrix:
    - nodejs_version: STABLE
      publish_build: true
    - nodejs_version: LTS

cache:
  - '%APPDATA%\npm-cache'
  - "%LOCALAPPDATA%/Yarn"
  - node_modules -> package.json
  - flow-typed
  - app/node_modules -> app/package.json

matrix:
  fast_finish: true

build: off

version: '{build}'

shallow_clone: true

clone_depth: 1

install:
  - ps: Install-Product node $env:nodejs_version
  - set CI=true
  - yarn

test_script:
  - yarn lint-ci
  - yarn build
  - yarn test-ci

deploy_script:
  - cmd: powershell if (($env:appveyor_repo_name -eq 'LN-Zap/zap-desktop') -and ($env:appveyor_repo_branch -eq 'master') -and ($env:publish_build)) { yarn release }