matrix:
  include:
    - os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "9"
      env:
        - ELECTRON_CACHE=$HOME/.cache/electron
        - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
        - ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

    - os: linux
      language: node_js
      node_js: "6"
      
script:
  - npm test
  - npm run build:dist
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
       npm run build:linux && npm run build:windows
    else
       npm run build:macos
    fi

cache:
  directories:
    - node_modules
    - $HOME/.cache/electron
    - $HOME/.cache/electron-builder

matrix:
  include:
    - os: osx
      osx_image: xcode9.2
      language: node_js
      node_js: "9"
      env:
        - ELECTRON_CACHE=$HOME/.cache/electron
        - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
        - ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

    - os: linux
      language: node_js
      node_js: "6"
      
script:
  - npm test
  - npm run build:dist
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
       npm run build:linux && npm run build:windows
    else
       npm run build:macos
    fi

cache:
  directories:
    - node_modules
    - $HOME/.cache/electron
    - $HOME/.cache/electron-builder

before_deploy:
  - git config --local user.name "nukeop"
  - git config --local user.email "alsw@protonmail.com"
  - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
    
deploy:
  provider: releases
  api_key: $GITHUB_TOKEN
  file_glob: true
  file:
    - "release/*.exe"
    - "release/*.deb"
    - "release/*.tar.gz"
    - "release/*.zip"
    - "release/*.AppImage"
  skip_cleanup: true
  on:
    tags: true

Build and release on Github
Build and release on Github
