forked from channable/vaultenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
42 lines (35 loc) · 1.36 KB
/
.travis.yml
File metadata and controls
42 lines (35 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
sudo: true
language: generic
os:
- linux
- osx
cache:
directories:
- $HOME/.stack
- $TRAVIS_BUILD_DIR/.stack-work
env:
global:
- GITHUB_RELEASE_VERSION=1.2.4
before_install:
- mkdir -p ~/.local/bin
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
travis_retry curl -sSL https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
else
travis_retry curl -sSL https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
fi
install:
- stack setup --no-terminal
- stack build --only-dependencies --test --copy-bins
script:
- stack test --copy-bins
after_success:
- |
if [ -n "$TRAVIS_TAG" ]; then
travis_retry curl -L https://github.com/tfausak/github-release/releases/download/$GITHUB_RELEASE_VERSION/github-release-$TRAVIS_OS_NAME.gz | gunzip > github-release
chmod a+x github-release
stack exec -- cp $(which vaultenv) .
# Use a user within the organization and generate a github token
./github-release release --token=$GITHUB_TOKEN --owner=$GITHUB_USER --repo=vaultenv --title=v$TRAVIS_TAG --tag=$TRAVIS_TAG
./github-release upload --token=$GITHUB_TOKEN --owner=$GITHUB_USER --repo=vaultenv --file=vaultenv --tag=$TRAVIS_TAG --name=vaultenv-$TRAVIS_TAG-$TRAVIS_OS_NAME-x86_64
fi;