diff --git a/.travis.yml b/.travis.yml index 137e7ea5..3152c782 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,18 +30,6 @@ matrix: - rust: beta - rust: nightly -before_install: - - export PATH="$PATH:$HOME/.cargo/bin" - -install: - - bash ci/install.sh - -script: - - bash ci/script.sh - -before_deploy: - - bash ci/before_deploy.sh - deploy: provider: releases api_key: diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh deleted file mode 100644 index 32f9df39..00000000 --- a/ci/before_deploy.sh +++ /dev/null @@ -1,66 +0,0 @@ -# `before_deploy` phase: here we package the build artifacts - -set -ex - -. $(dirname $0)/utils.sh - -# Generate artifacts for release -mk_artifacts() { - cargo build --target $TARGET --release -} - -mk_tarball() { - # create a "staging" directory - local td=$(mktempd) - local out_dir=$(pwd) - - # NOTE All Cargo build artifacts will be under the 'target/$TARGET/{debug,release}' - cp target/$TARGET/release/oxipng $td - - pushd $td - - # release tarball will look like 'rust-everywhere-v1.2.3-x86_64-unknown-linux-gnu.tar.gz' - tar czf $out_dir/${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz * - - popd - rm -r $td -} - -# Package your artifacts in a .deb file -# NOTE right now you can only package binaries using the `dobin` command. Simply call -# `dobin [file..]` to include one or more binaries in your .deb package. I'll add more commands to -# install other things like manpages (`doman`) as the needs arise. -# XXX This .deb packaging is minimal -- just to make your app installable via `dpkg` -- and doesn't -# fully conform to Debian packaging guideliens (`lintian` raises a few warnings/errors) -mk_deb() { - dobin target/$TARGET/release/oxipng -} - -main() { - mk_artifacts - mk_tarball - - if [ $TRAVIS_OS_NAME = linux ]; then - if [ ! -z $MAKE_DEB ]; then - dtd=$(mktempd) - mkdir -p $dtd/debian/usr/bin - - mk_deb - - mkdir -p $dtd/debian/DEBIAN - cat >$dtd/debian/DEBIAN/control <>.cargo/config </dev/null || mktemp -d -t tmp) -} - -host() { - case "$TRAVIS_OS_NAME" in - linux) - echo x86_64-unknown-linux-gnu - ;; - osx) - echo x86_64-apple-darwin - ;; - esac -} - -gcc_prefix() { - case "$TARGET" in - aarch64-unknown-linux-gnu) - echo aarch64-linux-gnu- - ;; - arm*-gnueabihf) - echo arm-linux-gnueabihf- - ;; - *) - return - ;; - esac -} - -dobin() { - [ -z $MAKE_DEB ] && die 'dobin: $MAKE_DEB not set' - [ $# -lt 1 ] && die "dobin: at least one argument needed" - - local f prefix=$(gcc_prefix) - for f in "$@"; do - install -m0755 $f $dtd/debian/usr/bin/ - ${prefix}strip -s $dtd/debian/usr/bin/$(basename $f) - done -} - -architecture() { - case $1 in - x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl) - echo amd64 - ;; - i686-unknown-linux-gnu|i686-unknown-linux-musl) - echo i386 - ;; - arm*-unknown-linux-gnueabihf) - echo armhf - ;; - *) - die "architecture: unexpected target $TARGET" - ;; - esac -}