language: node_js

node_js: "6"

addons:
  apt:
    packages:
    - fakeroot
    - dpkg
    - rpm
    - lintian
    - libdbus-1-dev
    - libglib2.0-dev
    - reprepro
    - createrepo

before_install:
- npm i -g npm@5.4.2

install:
- npm install
- npm run linux
- npm run darwin
- npm run windows

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3

script:
- npm run lint
- cd linux/
- npm run test

git:
  depth: 1

cache:
  directories:
  - node_modules
  - darwin/node_modules
  - linux/node_modules
  - windows/node_modules

before_cache:
- cd ..

before_deploy:
- cd linux/
- openssl aes-256-cbc -K $encrypted_6866d25ad40b_key -iv $encrypted_6866d25ad40b_iv -in headset_priv.asc.enc -out headset_priv.asc -d
- npm run repo


deploy:
- provider: releases
  skip_cleanup: true
  file_glob: true
  api_key: "$GITHUB_TOKEN"
  file: build/installers/*
  on:
    tags: true
- provider: pages
  skip_cleanup: true
  local_dir: gh-pages
  github_token: "$GITHUB_TOKEN"
  on:
    branch: master

language: node_js

node_js: "6"

addons:
  apt:
    packages:
    - fakeroot
    - dpkg
    - rpm
    - lintian
    - libdbus-1-dev
    - libglib2.0-dev
    - reprepro
    - createrepo

before_install:
- npm i -g npm@5.4.2

install:
- npm install
- npm run linux
- npm run darwin
- npm run windows

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3

script:
- npm run lint
- cd linux/
- npm run test

git:
  depth: 1

cache:
  directories:
  - node_modules
  - darwin/node_modules
  - linux/node_modules
  - windows/node_modules

before_cache:
- cd ..

before_deploy:
- cd linux/
- openssl aes-256-cbc -K $encrypted_6866d25ad40b_key -iv $encrypted_6866d25ad40b_iv -in headset_priv.asc.enc -out headset_priv.asc -d
- npm run repo


deploy:
- provider: releases
  skip_cleanup: true
  file_glob: true
  api_key: "$GITHUB_TOKEN"
  file: build/installers/*
  on:
    tags: true
- provider: pages
  skip_cleanup: true
  local_dir: gh-pages
  github_token: "$GITHUB_TOKEN"
  on:
    tags: true

Deploy pages on tag commits only
Deploy pages on tag commits only
