This repository has been archived by the owner on Sep 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (53 loc) · 1.67 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
sudo: false
language: c
cache:
directories:
- nim
env:
global:
- NIMREPO="https://github.com/nim-lang/Nim"
- NIMVER="$(git ls-remote ${NIMREPO} devel | cut -f 1)"
- NIMDIR="${TRAVIS_BUILD_DIR}/nim/${NIMVER}"
install:
- echo "NIMDIR = ${NIMDIR}"
# After building nim, wipe csources to save on cache space.
- "{ [ -f ${NIMDIR}/bin/nim ]; } ||
( rm -rf nim;
mkdir -p nim;
git clone --single-branch --branch devel --depth=1 ${NIMREPO} ${NIMDIR};
cd ${NIMDIR};
[ -d csources ] || git clone --depth 1 https://github.com/nim-lang/csources.git;
cd csources;
sh build.sh;
cd ..;
./bin/nim c koch;
./koch boot -d:release;
rm -rf csources;
)"
# - "{ [ -f ${NIMDIR}/bin/nimble ]; } ||
# ( cd ${NIMDIR};
# ./koch tools;
# )"
- export PATH="${NIMDIR}/bin:${PATH}"
# koch docs can be run only after nim is added to PATH.
- "{ [ -d ${NIMDIR}/doc/html ]; } ||
( cd ${NIMDIR};
./koch docs;
)"
script:
- nim -v
before_deploy:
- sed -i 's|</h1>|\0<p>Built from Nim <b>devel</b> commit <a href="'"${NIMREPO}/tree/${NIMVER}"'">'"${NIMVER:0:8}"'</a> on '"$(date)"'.</p>|' "${NIMDIR}/doc/html/overview.html"
- cp -f "${NIMDIR}/doc/html/overview.html" "${NIMDIR}/doc/html/index.html"
deploy:
provider: pages
# local-dir *has* to be a relative path from the repo root.
local-dir: "nim/${NIMVER}/doc/html"
skip-cleanup: true
github-token: "${GITHUB_OAUTH_TOKEN}"
keep-history: false
on:
branch: master
# References:
# https://github.com/kaushalmodi/hello_musl/blob/master/.travis.yml
# https://docs.travis-ci.com/user/deployment/pages/