diff options
-rw-r--r-- | .travis.yml | 64 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | ci/before_deploy.sh | 37 | ||||
-rw-r--r-- | ci/install.sh | 27 | ||||
-rw-r--r-- | ci/script.sh | 16 |
7 files changed, 150 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..265ca79 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,64 @@ +# Based on the "trust" template v0.1.2 +# https://github.com/japaric/trust/tree/v0.1.2 + +dist: trusty +language: rust +services: docker +sudo: required + +env: + global: + - CRATE_NAME=dua + +matrix: + include: + - env: ENABLE_TESTS=1 + # Linux + # fails as /usr/bin/file can't be found. Fair enough + # - env: TARGET=i686-unknown-linux-musl + - env: TARGET=x86_64-unknown-linux-musl + + # OSX + - env: TARGET=i686-apple-darwin + os: osx + - env: TARGET=x86_64-apple-darwin + os: osx + +cache: + - cargo +before_cache: + # Travis can't cache files that are not readable by "others" + - chmod -R a+r $HOME/.cargo + +branches: + only: + # release tags + - /^\d+\.\d+\.\d+.*$/ + - master + +before_install: + - set -e + - rustup self update + +install: + - sh bin/ci/install.sh + - source ~/.cargo/env || true + +script: + - bash bin/ci/script.sh + +after_script: set +e + +before_deploy: + - sh bin/ci/before_deploy.sh + +deploy: + - provider: releases + api_key: + secure: "HVOsRZp+GHHwCHxQl8vkTmCkZAtT5+8pY6aJq1oxDXRtJbLmG7VpWnrCFssv2jeSELlmodS1cLIfGVvItHwGyhVWJX3REjF3fMHDmzg4pNCGT/M8lF7QyxCROZtkMSDN4MHUNZ1k47IV8hf/HOFcb8jRf1DOYTVogMSIMXTL8Hmw85HTOUI1oSAew7Sg+RaNZXxrbwUmM6EsDR82OskNW2QWHUz0V1NrcghyUR111soPD5vyqsedFhD6xVVJb0Yas2QQD8WtLxX1btlyJCpCWZnHH0cfwvvrYYqPFZa91y6BtTAOX+Bn6veVLjL4KmRF+yTEwNsg39Oaho5oRvSCZEzgrUyL/d0ZqcBlqHyzSY8cSedZcAO083Qihan4BzYv9ndAqA2lgowEwM0EWn4gQVVXsxdeq8p6DT7ziCtrpJilL45ci/3rqf3g4imPDXVNPlToO5UJEZjixY/Pd14ZBthKWWicIAdXqj2E7tCrWRxMEThmyHF2wpyo/YzM3IHBd2tCPFjZ+GizzFjqEhC5IBdau02NCZNllBAamtrx65AJ6Mr8lOaqMS9RPENnhx1xn8xWZWeEOFMAxvoEohHZjRU0RBGQ5PtTWBqdKukDRGnbeGRkhbEHffkcSpUV9VHq+wrGkJ00QfUgftoJKtdO+BBe9kVGiYM3UqepMK7HVSY=" + file_glob: true + file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* + on: + condition: $TRAVIS_RUST_VERSION = stable && -n "$TARGET" + tags: true + skip_cleanup: true @@ -185,7 +185,7 @@ checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" [[package]] name = "dua-cli" -version = "2.1.12" +version = "2.1.13" dependencies = [ "atty", "byte-unit", @@ -1,6 +1,6 @@ [package] name = "dua-cli" -version = "2.1.12" +version = "2.1.13" authors = ["Sebastian Thiel <byronimo@gmail.com>"] edition = "2018" include = ["src/**/*", "Cargo.toml"] @@ -49,6 +49,10 @@ dua interactive * [ ] Evaluate unit coloring - can we highlight different units better, make them stick out? +#### ✅ v2.1.13-- Dependency Update; Github Releases + +Binaries for Linux and MacOS are now available on GitHub Releases. + #### ✅ v2.1.12-- More obvious highlighting of active panel Depending on the terminal used, it might not have been obvious which panel was active. This might be diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh new file mode 100644 index 0000000..05ec68c --- /dev/null +++ b/ci/before_deploy.sh @@ -0,0 +1,37 @@ +# This script takes care of building your crate and packaging it for release + +set -ex + +main() { + # We run tests only once, and won't try to create any additional artifacts + if [ -n "$ENABLE_TESTS" ]; then + return + fi + + local src=$(pwd) \ + stage= + + case $TRAVIS_OS_NAME in + linux) + stage=$(mktemp -d) + ;; + osx) + stage=$(mktemp -d -t tmp) + ;; + esac + + test -f Cargo.lock || cargo generate-lockfile + + cross rustc --bin $CRATE_NAME --target $TARGET --release -- -C lto + + strip target/$TARGET/release/$CRATE_NAME + cp target/$TARGET/release/$CRATE_NAME $stage/ + + cd $stage + tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz * + cd $src + + rm -rf $stage +} + +main diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 0000000..748ad9a --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,27 @@ +set -ex + +main() { + local target= + if [ $TRAVIS_OS_NAME = linux ]; then + target=x86_64-unknown-linux-musl + sort=sort + else + target=x86_64-apple-darwin + sort=gsort # for `sort --sort-version`, from brew's coreutils. + fi + + # This fetches latest stable release + local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ + | cut -d/ -f3 \ + | grep -E '^v[0.1.0-9.]+$' \ + | $sort --version-sort \ + | tail -n1) + curl -LSfs https://japaric.github.io/trust/install.sh | \ + sh -s -- \ + --force \ + --git japaric/cross \ + --tag $tag \ + --target $target +} + +main diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 0000000..b4d6240 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,16 @@ +# This script takes care of testing your crate + +set -ex + +main() { + if [ -n "$ENABLE_TESTS" ]; then + make tests + return + fi + cross build --target $TARGET +} + +# we don't run the "test phase" when doing deploys +if [ -z $TRAVIS_TAG ]; then + main +fi |