language: scala

scala:
  - 2.11.7

jdk:
  - oraclejdk8

sudo: false

cache:
  directories:
    - $HOME/.ivy2/cache
    - $HOME/.sbt/boot/

after_success:
  - |
    if [ -n "$TRAVIS_TAG" ] || ([ "$TRAVIS_PULL_REQUEST" == false ] && [ "$TRAVIS_BRANCH" == master ])
    then
      mkdir ~/.pgp
      echo $PGP_PUBLIC > ~/.pgp/pubring
      echo $PGP_SECRET > ~/.pgp/secring
      echo "Publishing snapshot"
      sbt xtract/publishSigned xtractTesting/publishSigned
    fi
deploy:
  api_key: $GITHUB_AUTH
  file: target/**/*.jar
  file_glob: true
  provider: releases
  skip_cleanup: true
  on:
    tags: true

script:
  - sbt ++$TRAVIS_SCALA_VERSION test package

  #Avoid unncessary cache updates
  - find $HOME/.sbt -name "*.lock" | xargs rm
  - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

language: scala

scala:
  - 2.11.7

jdk:
  - oraclejdk8

sudo: false

cache:
  directories:
    - $HOME/.ivy2/cache
    - $HOME/.sbt/boot/

after_success:
  - |
    if [ -n "$TRAVIS_TAG" ] || ([ "$TRAVIS_PULL_REQUEST" == false ] && [ "$TRAVIS_BRANCH" == master ])
    then
      mkdir ~/.pgp
      echo $PGP_PUBLIC | base64 --decode > ~/.pgp/pubring
      echo $PGP_SECRET | base64 --decode > ~/.pgp/secring
      echo "Publishing snapshot"
      sbt xtract/publishSigned xtractTesting/publishSigned
    fi
deploy:
  api_key: $GITHUB_AUTH
  file: target/**/*.jar
  file_glob: true
  provider: releases
  skip_cleanup: true
  on:
    tags: true

script:
  - sbt ++$TRAVIS_SCALA_VERSION test package

  #Avoid unncessary cache updates
  - find $HOME/.sbt -name "*.lock" | xargs rm
  - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

Put base64 decoding for PGP credentials back in
Put base64 decoding for PGP credentials back in
