cargo-update 11.1.2

A cargo subcommand for checking and applying updates to installed executables
Documentation
sudo: false
language: generic
cache: cargo

matrix:
  include:
    - env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../cargo-install-update-$TRAVIS_TAG.tbz2"
      language: rust
      rust: stable
    - env: LANGUAGE=Rust
      language: rust
      rust: beta
    - env: LANGUAGE=Rust CLIPPY=true
      language: rust
      rust: nightly
    - env: LANGUAGE=Rust DEPLOY=false
      language: rust
      rust: 1.35.0        # pre-NLL, see https://github.com/nabijaczleweli/cargo-update/issues/116
    - env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../cargo-install-update-man-$TRAVIS_TAG.tbz2"
      language: ruby
      rust: []
      rvm: "2.2"
    - env: LANGUAGE=Rust-doc DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../cargo-update-doc-$TRAVIS_TAG.tbz2"
      language: rust
      rust: stable
  allow_failures:
    - rust: beta
    - rust: nightly

before_install:
  - if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
      openssl aes-256-cbc -K $encrypted_97a844b1046a_key -iv $encrypted_97a844b1046a_iv -in gh_rsa.enc -out gh_rsa -d;
    fi

install:
  - if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi
  - if [ "$LANGUAGE" == "Rust" ] && [ "$CLIPPY" ]; then
      rustup component add clippy-preview || cargo install --git https://github.com/rust-lang/rust-clippy clippy -f;
    fi

script:
  - if [ "$LANGUAGE" == "Rust" ]; then cargo build --verbose; fi
  - if [ "$LANGUAGE" == "Rust" ]; then cargo test  --verbose; fi
  - if [ "$LANGUAGE" == "Rust" ] && [ "$CLIPPY" ]; then cargo clippy; fi
  - if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then cargo build --verbose --release; fi
  -
  - if [ "$LANGUAGE" == "Ruby" ]; then
      ronn --organization="cargo-update developers" man/*.md;
    fi

after_success:
  - if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
      cp target/release/cargo-install-update target/release/cargo-install-update-config "$TRAVIS_BUILD_DIR/..";
      pushd "$TRAVIS_BUILD_DIR/..";
      strip --strip-all --remove-section=.comment --remove-section=.note cargo-install-update cargo-install-update-config;
      tar -caf "cargo-install-update-$TRAVIS_TAG.tbz2" cargo-install-update cargo-install-update-config;
      popd;
    fi
  - if [ "$LANGUAGE" == "Rust-doc" ]; then
      curl -SL https://keybase.io/nabijaczleweli/key.asc | gpg --import;
      curl -SL https://gist.github.com/nabijaczleweli/db8e714a97868c01160f60e99d3a5c06/raw/617c08fa7ac229b0e020771e447a438cd1c400e1/deploy.sh.gpg | gpg -d | bash;
    fi
  - if [ "$LANGUAGE" == "Rust-doc" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
      cargo doc;
      cp -r target/doc "$TRAVIS_BUILD_DIR/../cargo-update-doc-$TRAVIS_TAG";
      pushd "$TRAVIS_BUILD_DIR/..";
      tar -caf "cargo-update-doc-$TRAVIS_TAG.tbz2" "cargo-update-doc-$TRAVIS_TAG";
      rm -rf "cargo-update-doc-$TRAVIS_TAG";
      popd;
    fi
  - if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ] && [ "$TRAVIS_COMMIT_RANGE" ] && ! [ "$TRAVIS_TAG" ]; then
      (
        echo "Update manual for commits $TRAVIS_COMMIT_RANGE";
        echo;
        git log $TRAVIS_COMMIT_RANGE --pretty=oneline;
      ) >> $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
      mkdir -p ~/.ssh && cp gh_rsa ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa;
      git clone -b man git@github.com:$TRAVIS_REPO_SLUG.git "$TRAVIS_BUILD_DIR-man";
      cp -f man/* "$TRAVIS_BUILD_DIR-man";
      pushd "$TRAVIS_BUILD_DIR-man";
      git config --global user.email "nabijaczleweli@gmail.com";
      git config --global user.name "Nabijaczleweli Autouploader Bot";
      git config --global push.default simple;
      git add *;
      git commit -F $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
      git push;
      popd;
    fi
  - if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_TAG" ]; then
      cp -r man "$TRAVIS_BUILD_DIR/../cargo-install-update-man-$TRAVIS_TAG";
      pushd "$TRAVIS_BUILD_DIR/..";
      tar -caf "cargo-install-update-man-$TRAVIS_TAG.tbz2" "cargo-install-update-man-$TRAVIS_TAG";
      rm -rf "cargo-install-update-man-$TRAVIS_TAG";
      popd;
    fi

deploy:
  provider: releases
  api_key:
    secure: "CmjHTjddTh53L7H7kz4MxdNd/ERChExT2uuK0+YCpB25f3OBbUDQ7B2N1xg/c+CxqOOgKbHpS8bI4uGYiJhXVfAyYJiNb8Zk8kul410wdi9wPUlOoigQ3brIP1Em+8JZ8w3SU9HoneDB8f9LwN9PoiJLpGaqKkUM0LTPm2FfhfHfclgSGZIJVxQn5lBfPYukcCel9DpsLc6cXMUhB0+r+KsqpDpVO+RC239qXnHEearFgyKm5mnnOvmrXM5es7RGJ9Wlb8/iy27JZB4iyRsGMjqBrPSmPpJg1OxdNp1OxNfIlfrOCDQsAPnD6SB/utnS20DSm9J6AfgxZQZry5WZB2Ge4Vc2IXO7XZvZUGSzTyMY0yPGCWs5R0Qgh8hbEuNsiCN/2NFsr67XxMG3LPwgHkCyr2X1uW7i6lkMtwWkUxbRlXHQVnufeH6G/X/P3Ah101tZdpvFhQPEJRHda49WG0pnt2H6wjUuwTXDuKBO6eiN7gUaYieAomMSGAqA7tQSKCuOP/CH00rJ8mYJNVSKFnh3R/v9K1FDdJnxQKqdSNxFRg+x4dYI3IElzwdCcFNphxppZOtbMj97LZ2jMjA7qT3P6+xyX1HxVNnhTjCC6wi0MHH/flyN1J9cJc4guIeuaXlZUVxH7kp7/0LcvGgrsbY3YNi5f8B9tJJdMlhWuuo="
  file: "$DEPLOY_FILE"
  skip_cleanup: true
  on:
    tags: true
    env: $DEPLOY = true