First stab at running OSX build.

This commit is contained in:
Benjamin Summers 2019-12-11 19:59:45 -08:00
parent c5299c0b3d
commit 0ce787a196
2 changed files with 54 additions and 22 deletions

View File

@ -1,9 +1,31 @@
language: nix # TODO Only do release builds on the `pull` branch?
nix: 2.1.3
os: jobs:
- linux include:
- osx # - os: linux
# language: nix
# nix: 2.1.3
# install:
# - nix-env -iA cachix -f https://cachix.org/api/v1/install
# script:
# - cachix use urbit2
# - ./sh/cachix
# - make build-fast
# - make release
# - sh/ci-tests
- os: osx
language: generic
sudo: required
script:
- ver="$(git rev-parse HEAD)"
- if [ -n "${TRAVIS_COMMIT-}" ]; then ver="$TRAVIS_COMMIT"; fi
- if [ -n "${TRAVIS_TAG-}" ]; then ver="$TRAVIS_TAG"; fi
- stack clean
- stack install king --local-bin-path ./release
- mv release/king release/king-darwin-$ver
- otool -L release/king-darwin-$ver
cache: cache:
directories: directories:
@ -17,17 +39,8 @@ before_install:
- sh/travis-install-stack - sh/travis-install-stack
install: install:
- nix-env -iA cachix -f https://cachix.org/api/v1/install
- stack --no-terminal --install-ghc build king --only-dependencies - stack --no-terminal --install-ghc build king --only-dependencies
# TODO Only do release builds on the `pull` branch?
script:
- cachix use urbit2
- ./sh/cachix || true
- make build-fast
- make release
- sh/ci-tests
deploy: deploy:
- skip_cleanup: true - skip_cleanup: true
provider: gcs provider: gcs

View File

@ -2,20 +2,39 @@
set -ex set -ex
##
## Make sure this is running OSX/Linux in Travis
##
os="$TRAVIS_OS_NAME"
[ "$os" = osx ] || [ "$os" = linux ]
##
## Download the stack executable.
##
mkdir -p ~/.local/bin mkdir -p ~/.local/bin
# OSX stackurl="https://get.haskellstack.org/stable/$os-x86_64.tar.gz"
# curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
case $os in
osx)
curl -L "$stackurl" |
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
linux)
mkdir -p tmp mkdir -p tmp
curl -L "$stackurl" | tar xz -C tmp
pax="https://get.haskellstack.org/stable/linux-x86_64.tar.gz"
curl -L $pax | tar xz -C tmp
mv tmp/stack-*/stack ~/.local/bin mv tmp/stack-*/stack ~/.local/bin
esac
##
## Use the more reliable S3 mirror of Hackage.
##
# Use the more reliable S3 mirror of Hackage
mkdir -p ~/.cabal mkdir -p ~/.cabal
cat > ~/.cabal/config <<EOF cat > ~/.cabal/config <<EOF