sudo: false
dist: trusty
language: rust

cache:
- cargo

before_cache:
- rm -r $TRAVIS_BUILD_DIR/target/debug

jobs:
  include:
  - os: linux
    rust: 1.31.0
  - os: linux
    rust: stable
  - os: linux
    rust: beta
  - os: linux
    rust: nightly

  # deploy
  - stage: publish
    os: linux
    rust: stable
    install: true
    script: true

    deploy:
    - provider: script
      script: 'cargo publish --verbose --token=$CARGO_TOKEN'
      on:
        tags: true
