From 8ab6e9374b39c4f5d6831e85aafbf8ba445fd4c6 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Mon, 24 Apr 2017 13:15:40 -0600 Subject: [PATCH] Install GHR from binary --- .travis.yml | 13 ++++++------- tools/install-ghr.sh | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 tools/install-ghr.sh diff --git a/.travis.yml b/.travis.yml index 2adfe7c..192c8fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ -language: generic +addons: + apt: + packages: + - libgmp-dev +language: c sudo: false -go: -- 1.7.x cache: directories: - $HOME/.local/bin @@ -11,10 +13,7 @@ os: - osx before_install: - sh tools/install-stack.sh -install: -- export GOPATH="${TRAVIS_BUILD_DIR}/go" -- export PATH="${TRAVIS_BUILD_DIR}/go/bin:$PATH" -- go get -u github.com/tcnksm/ghr +- sh tools/install-ghr.sh script: - stack setup - stack build --ghc-options -O2 --pedantic diff --git a/tools/install-ghr.sh b/tools/install-ghr.sh new file mode 100644 index 0000000..d8f6621 --- /dev/null +++ b/tools/install-ghr.sh @@ -0,0 +1,20 @@ +set -o errexit -o verbose + +if test ! "$TRAVIS_TAG" +then + echo 'This is not a release build.' +else + if [ "$TRAVIS_OS_NAME" = "linux" ] + then + ARCH="linux" + else + ARCH="darwin" + fi + echo "Installing ghr" + URL="https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_${ARCH}_386.zip" + curl -L ${URL} > ghr.zip + mkdir -p "$HOME/bin" + export PATH="$HOME/bin:$PATH" + unzip ghr.zip -d "$HOME/bin" + rm ghr.zip +fi