jdk:
  - oraclejdk8
os:
  - linux
language: scala
dist: trusty
stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    # default stage is test
    - stage: release
      script:
        - nvm install 'lts/*' && nvm use 'lts/*'
        - git fetch --unshallow
        - git fetch --tags
        - sbt ci-release

cache:
  directories:
    - $HOME/.sbt/0.13/dependency
    - $HOME/.sbt/1.0/dependency
    - $HOME/.sbt/boot/scala*
    - $HOME/.sbt/launchers
    - $HOME/.ivy2/cache
    - $HOME/.cache/coursier
    - $HOME/.coursier
  yarn: true

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

jdk:
  - oraclejdk8
os:
  - linux
language: scala
dist: trusty
stages:
  - name: test
  - name: release
    if: (branch = master AND type = push) OR (tag IS present)

jobs:
  include:
    # default stage is test
    - stage: release
      script:
        - nvm install 'lts/*' && nvm use 'lts/*'
        - git fetch --unshallow
        - git fetch --tags
        - ./sbt ci-release

cache:
  directories:
    - $HOME/.sbt/0.13/dependency
    - $HOME/.sbt/1.0/dependency
    - $HOME/.sbt/boot/scala*
    - $HOME/.sbt/launchers
    - $HOME/.ivy2/cache
    - $HOME/.cache/coursier
    - $HOME/.coursier
  yarn: true

before_cache:
  - du -h -d 1 $HOME/.ivy2/cache
  - du -h -d 2 $HOME/.sbt/
  - find $HOME/.sbt -name "*.lock" -type f -delete
  - find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
  - rm -rf $HOME/.ivy2/local

Use embedded sbt launcher in Travis
Use embedded sbt launcher in Travis
