---
sudo: false
language: c
cache:
directories:
- $HOME/.cabal
- $HOME/.ghc
addons:
apt:
packages:
- libgmp3-dev
matrix:
include:
- env: TARGET=x86_64-unkown-linux-gnu
addons:
apt:
update: true
sources:
- hvr-ghc
packages:
- ghc-8.6.1
- cabal-install-2.4
- env: TARGET=x86_64-apple-darwin
os: osx
before_install:
- |
if [ `uname` = "Darwin" ]
then
brew install cabal-install
cabal new-update
else
export PATH=/opt/ghc/bin:$PATH
cabal new-update
fi
script:
- curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s app
- cabal new-build all
- |
if [ `uname` = "Darwin" ]
then
export BINPATH="$(find dist-newstyle/ -name {{ project }} -perm 755 | tail -n1)"
else
export BINPATH="$(find dist-newstyle/ -name {{ project }} -executable | tail -n1)"
fi
- echo $BINPATH
- mv $BINPATH {{ project }}-$TARGET
- strip {{ project }}-$TARGET
deploy:
api_key:
secure: file: {{ project }}-$TARGET
on:
tags: true
provider: releases
skip_cleanup: true
branches:
only:
- master
- /\d+\.\d+\.\d+\.\d+.*$/