sudo: false
dist: trusty
language: rust

cache:
- cargo

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

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

  # deploy
  - stage: publish
    os: linux
    rust: stable
    env:
    # CARGO_TOKEN
    - secure: "HoUAOF9ifTpXUxPZNUgtWXLHGCg5i/LSDgQ9wo1l41JZCdjQE/sQ3FMBb6r0rq4JHj66q/sf0ySJedDN0lmC7VwwauKtN4xiSAUlnCoP8PnCGLvBLLfwHYGOUNoJjRuw1CoLielafzt3wqB0+Byz0OX0GrK5E3t7iLJ7XQplCBcKfWddDmgn0IQvVP9GHQKdGlEF2bjycL9dPKeM+O9OQ+sT0KmjF7UgcFDeJTLzP9rwqgKOpebtZPyT2XGCRPWi3p9c+CPw3ObarieLqHkM4aA5euyKHhL2p3P8pEeLU5w9VrUA4XVGmDK8UHCK+U5wrRkcdbb8dN5lUqE2VGUGz9iGafzvc+cQlzBD3t3iTdkhgbm244GW5FRSkJefLkknADHL/xtNbDhSYCYuOpr5Mxc0mXOSWXG1vSvlaj6FBShWdhdZY5kaTAyP2Aqhl6naX9+Aj4EK6HAnM57qwhdc1fkJ1tCrNDmeyc9YpubiAe09Y7jrwftkhTWsyy6wURdVj3+xSCOta0AoC9rTJDZLM06KrKKtgoSeS4BghfxKcBqvV+3pOGEct3gFb7fGSvs1bzelrTAFZx/N4jvL/e5L9RODEvoPBr+iDaCMfgYNSmrOmD0dBeGK+JEP7exKFJZfFpMPYp2YMWhrR5+HKrsZf0TRqQpdD/9B4dDMGRmgjCc="
    install: true
    script: true

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