-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtravis.sh
executable file
·59 lines (53 loc) · 2 KB
/
travis.sh
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
#!/bin/bash
set -e -o pipefail
BM="--build-mode=singleFile"
if [[ "$TRAVIS_OS_NAME" == "osx" || "$DC" == "ldc2" ]]; then
BM="--build-mode=separate"
fi
dub test --compiler=${DC} ${BM}
dub test -c unittest-gtk --compiler=${DC} ${BM}
if [[ $TRAVIS_BRANCH == 'master' ]] ; then
if [ ! -z "$GH_TOKEN" ]; then
git checkout master
dub build -b release --compiler=${DC}
bin/plotcli < examples/1/data.txt
bin/plotcli < examples/2/data.txt
bin/plotcli < examples/3/data.txt
bin/plotcli < examples/4/data.txt
bin/plotcli < examples/5/data.txt
dub build -b docs --compiler=${DC}
cd docs
mkdir images
#cp ../*.{png,svg,pdf} images/
cp ../*.png images/
../bin/plotcli --help > images/help.txt
git init
git config user.name "Travis-CI"
git config user.email "[email protected]"
git add .
git commit -m "Deployed to Github Pages"
#git push --force --quiet "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}" HEAD:gh-pages > /dev/null 2>&1
git push --force --quiet "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}" master:gh-pages > /dev/null 2>&1
#git push --force "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}" HEAD:gh-pages
cd ..
fi
fi
if [ -n "$TRAVIS_TAG" ]; then
git checkout $TRAVIS_TAG
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
dub build --compiler=$DC -b release
strip bin/plotcli
tar -czf plotcli-osx.tar.gz -C bin/ plotcli
dub build --compiler=$DC -b release -c plotcli-gtk
strip bin/plotcli
tar -czf plotcli-osx-gtk.tar.gz -C bin/ plotcli
fi
if [[ "$TRAVIS_OS_NAME" == "linux" && "$DC" == "ldc2" ]]; then
dub build --compiler=$DC -b release
strip bin/plotcli
tar caf plotcli-linux.tar.gz -C bin/ plotcli
dub build --compiler=$DC -b release -c plotcli-gtk
strip bin/plotcli
tar caf plotcli-linux-gtk.tar.gz -C bin/ plotcli
fi
fi