From 8599159490355a5b4fd6585f345d2a809fafe6f4 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Sat, 22 Apr 2017 15:36:41 +0200 Subject: [PATCH] add releases with travis Signed-off-by: Tomas Tomecek --- .travis.yml | 40 +++++++++++++++++++++++++--------------- Makefile | 5 +++++ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 838ec77..1cbad3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,33 @@ +language: rust + dist: trusty sudo: required -language: rust services: - - docker +- docker env: global: - - PROJECT_NAME=pretty-git-prompt - -rust: - - stable - - nightly + - PROJECT_NAME=pretty-git-prompt +matrix: + include: + - os: osx + rust: stable + env: TARGET=x86_64-apple-darwin + - os: linux + rust: stable + env: TARGET=x86_64-unknown-linux-gnu script: - - if [ ${TRAVIS_EVENT_TYPE} = "cron" ] ; then make unstable-environment && make test ; fi -# matrix: -# allow_failures: -# - rust: nightly -# -# before_install: -# - sudo apt-get update -# - sudo apt-get upgrade -y cmake +- if [ ${TRAVIS_EVENT_TYPE} = "cron" ] ; then make unstable-environment && make test; else cargo test --verbose; fi +before_deploy: +- make release +deploy: + provider: releases + api_key: + secure: J0JjJwZQFLediTBX9Fdi5lGfryXWRIpwyvBIZ8aogo6Yz16FvgU35nomAI9eIdxgTkGzDIhmnk2LxgzKnB7VWB/j2Qc4N+HqP+RDymTKCmG1ywQjNtvk8/u/8WFIYysE/GWyreD6+4R2XGWBk6oiKrpaMXUlpl8/2Cs5jt1eGZff/Moitt5DFmtHuPKPqPZtF2/sfDHMtIRxWqxTVmFP5ydsWh87r7vsQ7KpaPtXs3+dhT4lKh8JBfvbdIrNK0pMaVR0cQctgiK1IAchZxfHjgiz5OwH1vaRtaw/fvTcc8UVuOwV/+0DNCewcMUq8iqALepv3LSlDAlK/5xXt5J5NIGEXMpQbRektSWvvzwzN45859Y+pEnh8s5MNynxJH6NJCYtQ/etwfEhlZ6A9Uj7zGU6LyxYbU9nUzj0v+c28BKCDMAIJ8Q/TCiI1UD49lbZBzcHCVzpUAsFqmNYCBdSgQlqJEPj7ZLplxAJ4h1JkP/mN78zHp9K4v8D+3U8EhMhrlsx5pwiLs0y1vLYMKlyvm/zeQFAX4h9CDeRWFunIlY8QmHtgTDw59xx7mOBcdzE7B3COKtuPBRBdlFiXZPckMZss2IOAw+2oPyQ4XikYDyecAfpeGh3f5NOIZnqTKv2RhY4qVP3mH5hKvZzCaXzzfYS9s2ALlP+L69k1o7uFQo= + file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET} + skip_cleanup: true + on: + condition: $TRAVIS_RUST_VERSION = stable + repo: TomasTomecek/pretty-git-prompt + tags: true diff --git a/Makefile b/Makefile index e7b5134..7d7abcf 100644 --- a/Makefile +++ b/Makefile @@ -63,3 +63,8 @@ shell: show-work: egrep --color=yes -C 3 "(TODO|FIXME)" $(DEPS) Makefile Dockerfile + + +release: + cargo build --target ${TARGET} --release + cp -av target/release/${PROJECT_NAME} "${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"