tweetr 0.2.1

tweetr is a platform that allows you to create and queue tweets to be shared when YOU want. You create content when you have time and then use FOSS and NOT pay whatever-ridiculous amount of $$$ for posting them automatically.
sudo: false
language: generic
cache: cargo

matrix:
  include:
    - env: LANGUAGE=Rust DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../tweetr-$TRAVIS_TAG"
      language: rust
      rust: stable
    - env: LANGUAGE=Rust
      language: rust
      rust: beta
    - env: LANGUAGE=Rust
      language: rust
      rust: nightly
    - env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../tweetr-man-$TRAVIS_TAG.tbz2"
      language: ruby
      rust: []
      rvm: "2.2"
    - env: LANGUAGE=Rust-doc DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../tweetr-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_045b50fdfbe0_key -iv $encrypted_045b50fdfbe0_iv -in gh_rsa.enc -out gh_rsa -d;
    fi

install:
  - if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi

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

after_success:
  - if [ "$LANGUAGE" == "Rust" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
      cp target/release/tweetr "$TRAVIS_BUILD_DIR/../tweetr-$TRAVIS_TAG";
      strip --strip-all --remove-section=.comment --remove-section=.note "$TRAVIS_BUILD_DIR/../tweetr-$TRAVIS_TAG";
    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/8dcc679165d4ac9106b73024deee97435659701d/deploy.sh.gpg | gpg -d | bash;
    fi
  - if [ "$LANGUAGE" == "Rust-doc" ] && [ "$TRAVIS_TAG" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
      cp -r target/doc "$TRAVIS_BUILD_DIR/../tweetr-doc-$TRAVIS_TAG";
      pushd "$TRAVIS_BUILD_DIR/..";
      tar -caf "tweetr-doc-$TRAVIS_TAG.tbz2" "tweetr-doc-$TRAVIS_TAG";
      rm -rf "tweetr-doc-$TRAVIS_TAG";
      popd;
    fi
  - if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; 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 "$TRAVIS_BUILD_DIR/../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 "$TRAVIS_BUILD_DIR/../man" "$TRAVIS_BUILD_DIR/../tweetr-man-$TRAVIS_TAG";
      pushd "$TRAVIS_BUILD_DIR/..";
      tar -caf "tweetr-man-$TRAVIS_TAG.tbz2" "tweetr-man-$TRAVIS_TAG";
      rm -rf "tweetr-man-$TRAVIS_TAG";
      popd;
    fi

deploy:
  provider: releases
  api_key:
    secure: "Hds0C90k33OsGpB3WfOKUqQgctobO3EocN7D2robDzf8QVri0sw2xMKdy3SPdaMriLdI10k+ipYtvYZZ5wKf7U8HvuC6sdTWSIMGnph7tYZY9IEYxrRK0rkmXOmK8iO0UNaxscoElXrr20mJ0upZxA2d6wNe7UczxH3QzapwK6AcxS56RBx94jLywasPxVjIaKwMjdRu2lisMkjECeZVo8aSkICkpHQr2D9WBTIr13w8TViZWE/beM4K/4RLyKAqJkisq/dW/AnLoesyQbk3QSIlM121hN/XM4fKVkO4VlN/rdDPkUMzUF0QUWtcpVJ7qTMEyhqxZ7pWB4LGVlzOzsjA3iSRAtMX7cZGQ9cHFNuAoRu7udXTD5s0wT7WkAxqDFc50N7KVIf8n8x9NJEP9ltiUILZjX/XoVQ0+LPKp2l4zIT5+l9llWELIJKoWVa1PqZzaFFoXKi5D+xIEzxgn69pENVdPZ53pBh9HVBYc7RVqZOOfwdyReHTjdg+7+f5uVl0BvKxR5GgeEwJ4xrfulkq06u4oE8ZwDOZpCyMTcPFr1PGd90H1JNKN7byxVlceArlBHEn9Wie+NLIZ+oWp1y7agIZy5dKDvuyd8/vkjdJYN0i9huJi6pI8dMJS0cK7xWKV1Jdw3GFUrUOP6XfPuayYlrRPDtehYtEYinhfXk="
  file: "$DEPLOY_FILE"
  skip_cleanup: true
  on:
    tags: true
    env: $DEPLOY = true