mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 20:47:27 +03:00
First stab at running OSX build.
This commit is contained in:
parent
c5299c0b3d
commit
0ce787a196
41
.travis.yml
41
.travis.yml
@ -1,9 +1,31 @@
|
||||
language: nix
|
||||
nix: 2.1.3
|
||||
# TODO Only do release builds on the `pull` branch?
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
jobs:
|
||||
include:
|
||||
# - 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:
|
||||
directories:
|
||||
@ -17,17 +39,8 @@ before_install:
|
||||
- sh/travis-install-stack
|
||||
|
||||
install:
|
||||
- nix-env -iA cachix -f https://cachix.org/api/v1/install
|
||||
- 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:
|
||||
- skip_cleanup: true
|
||||
provider: gcs
|
||||
|
@ -2,20 +2,39 @@
|
||||
|
||||
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
|
||||
|
||||
# OSX
|
||||
# curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
|
||||
stackurl="https://get.haskellstack.org/stable/$os-x86_64.tar.gz"
|
||||
|
||||
mkdir -p tmp
|
||||
case $os in
|
||||
osx)
|
||||
curl -L "$stackurl" |
|
||||
tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
|
||||
linux)
|
||||
mkdir -p tmp
|
||||
curl -L "$stackurl" | tar xz -C tmp
|
||||
mv tmp/stack-*/stack ~/.local/bin
|
||||
esac
|
||||
|
||||
pax="https://get.haskellstack.org/stable/linux-x86_64.tar.gz"
|
||||
|
||||
curl -L $pax | tar xz -C tmp
|
||||
##
|
||||
## Use the more reliable S3 mirror of Hackage.
|
||||
##
|
||||
|
||||
mv tmp/stack-*/stack ~/.local/bin
|
||||
|
||||
# Use the more reliable S3 mirror of Hackage
|
||||
mkdir -p ~/.cabal
|
||||
|
||||
cat > ~/.cabal/config <<EOF
|
||||
|
Loading…
Reference in New Issue
Block a user