sudo: false

env:
  global:
    - ELECTRON_CACHE=$HOME/.cache/electron
    - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder

language: node_js
node_js:
- '8'
notifications:
  email: false
cache:
  directories:
    - "node_modules"
    - $HOME/.cache/electron
    - $HOME/.cache/electron-builder
addons:
  apt:
    packages:
    - sshpass
before_install:
  - npm i -g npm@6.4.1
jobs:
  include:
    - stage: build 🔨
      install: npm ci
      script: npm run build
    - stage: quality ✔
      install: npm ci --ignore-scripts
      name: lint front
      script: npm run lint:js
    - name: lint back
      install: npm ci --ignore-scripts
      script: npm run lint:server
    - stage: deploy 📦
      name: linux app
      if: branch = develop AND repo = silexlabs/Silex
      install: npm ci
      script: npm run release
      os: linux
      dist: xenial
    - name: osx app
      if: branch = develop AND repo = silexlabs/Silex
      install: npm ci
      script: npm run release
      os: osx

