Skip to content

Commit

Permalink
Deploy binaries to GitHub Releases (#181)
Browse files Browse the repository at this point in the history
This should build on OSX as well as Linux.
When there is a git tag, the build should create a Release on GitHub.
The Release should have the built binaries for OSX and Linux.
  • Loading branch information
joneshf authored and Gabriella439 committed Nov 21, 2017
1 parent be10607 commit 755f91b
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ before_cache:

matrix:
include:
- env: CABALVER=1.24 GHCVER=8.0.1
- env: CABALVER=1.24 GHCVER=8.0.1 DEPLOY_GITHUB_RELEASE=true
compiler: ": #GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
- env: CABALVER=1.24 GHCVER=8.0.1 DEPLOY_GITHUB_RELEASE=true
compiler: ": #GHC 8.0.1"
os: osx

before_install:
- unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
# Work around travis issue by updating Homebrew: https://github.com/travis-ci/travis-ci/issues/8552
- if [ "$TRAVIS_OS_NAME" = osx ];
then
brew update;
brew install cabal-install;
brew install gnu-sed --with-default-names;
fi

install:
- cabal --version
Expand Down Expand Up @@ -73,4 +83,20 @@ script:
- SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")

before_deploy:
- tar --create --file "$TRAVIS_OS_NAME.tar" --files-from /dev/null
- tar --append --file "$TRAVIS_OS_NAME.tar" --directory dist/build/dhall dhall
- tar --append --file "$TRAVIS_OS_NAME.tar" --directory dist/build/dhall-format dhall-format
- tar --append --file "$TRAVIS_OS_NAME.tar" --directory dist/build/dhall-hash dhall-hash
- gzip "$TRAVIS_OS_NAME.tar"

deploy:
provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
file: "$TRAVIS_OS_NAME.tar.gz"
on:
condition: $DEPLOY_GITHUB_RELEASE = true
tags: true
skip_cleanup: true

# EOF

0 comments on commit 755f91b

Please sign in to comment.