-
Notifications
You must be signed in to change notification settings - Fork 214
/
.travis.yml
83 lines (71 loc) · 2.56 KB
/
.travis.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
sudo: required
language: generic
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack
- $TRAVIS_BUILD_DIR/.stack-work
matrix:
include:
# Build only on macOS
- env: BUILD=stack
compiler: ": #stack default osx"
os: osx
# Build only master and release tags
branches:
only:
- master
- /^\d+\.\d+\.\d+(\.\d+)?$/
addons:
homebrew:
packages:
- libsodium
update: true
before_install:
# Using compiler above sets CC to an invalid value, so unset it
- unset CC
- CABALARGS=""
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
- | # Install stack
mkdir -p ~/.local/bin
travis_retry curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
# Use the more reliable S3 mirror of Hackage
mkdir -p $HOME/.cabal
echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- SAVED_OPTIONS=$(set +o)
- set -ex
- stack --no-terminal --install-ghc build --only-dependencies
- eval "$SAVED_OPTIONS"
script:
- export PATH="${PATH}:$(pwd)/bin"
- stack build --copy-bins --local-bin-path ./bin
- source .travis-functions.sh
- mkdir -p share/man/man1
- cp dhall/man/dhall.1 share/man/man1/
- cp dhall-docs/src/Dhall/data/man/dhall-docs.1 share/man/man1/
- tar -jcvf $(mk_release_name dhall) bin/dhall share/man/man1/dhall.1
- tar -jcvf $(mk_release_name dhall-json) bin/dhall-to-json bin/dhall-to-yaml bin/json-to-dhall
- tar -jcvf $(mk_release_name dhall-toml) bin/dhall-to-toml bin/toml-to-dhall
- tar -jcvf $(mk_release_name dhall-bash) bin/dhall-to-bash
- tar -jcvf $(mk_release_name dhall-lsp-server) bin/dhall-lsp-server
- tar -jcvf $(mk_release_name dhall-nix) bin/dhall-to-nix
- tar -jcvf $(mk_release_name dhall-openapi) bin/openapi-to-dhall
- tar -jcvf $(mk_release_name dhall-yaml) bin/dhall-to-yaml-ng bin/yaml-to-dhall
- tar -jcvf $(mk_release_name dhall-docs) bin/dhall-docs bin/dhall-docs share/man/man1/dhall-docs.1
- tar -jcvf $(mk_release_name dhall-csv) bin/dhall-to-csv bin/csv-to-dhall
- mkdir -p uploads
- mv *.tar.bz2 uploads/
deploy:
- provider: releases
api_key: $GITHUB_OAUTH_TOKEN
file_glob: true
file: uploads/*
skip_cleanup: true
on:
tags: true
script:
- echo 'done'