-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
135 lines (128 loc) · 5.53 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
language: generic
sudo: false
cache:
apt: true
directories:
- /tmp/tools
git:
submodules: false
env:
global:
- PATH="$HOME/bin:$HOME/calibre:$PATH"
- CMAKE_VERSION_PREFIX=3.7
- CMAKE_VERSION_FULL=3.7.2
- NINJA_VERSION=1.7.2
matrix:
include:
- env: LANGUAGE=C++ CXX=g++-5 CC=gcc-5
addons:
apt:
packages:
- g++-5
- unzip
sources: &sources
- r-packages-precise
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- llvm-toolchain-precise-3.9
- env: LANGUAGE=C++ CXX=g++-6 CC=gcc-6 DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../gen-epub-book-$TRAVIS_TAG"
addons:
apt:
packages:
- g++-6
- unzip
sources: *sources
- env: LANGUAGE=C++ CXX=clang++-3.8 CC=clang-3.8
addons:
apt:
packages:
- clang-3.8
- unzip
sources: *sources
- env: LANGUAGE=C++ CXX=clang++-3.9 CC=clang-3.9
addons:
apt:
packages:
- clang-3.9
- unzip
sources: *sources
- env: LANGUAGE=Ruby DEPLOY=true DEPLOY_FILE="$TRAVIS_BUILD_DIR/../gen-epub-book.cpp-man-$TRAVIS_TAG.tbz2"
language: ruby
rvm: "2.2"
allow_failures:
# Clang doesn't have std::put_time()
- env: LANGUAGE=C++ CXX=clang++-3.8 CC=clang-3.8
- env: LANGUAGE=C++ CXX=clang++-3.9 CC=clang-3.9
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then
openssl aes-256-cbc -K $encrypted_996b68c689e3_key -iv $encrypted_996b68c689e3_iv -in gh_rsa_awk.enc -out gh_rsa_awk -d;
fi
install:
- if [ "$LANGUAGE" == "C++" ]; then git submodule update --init --recursive; fi
- if [ "$LANGUAGE" == "C++" ]; then curl -SL https://download.calibre-ebook.com/linux-installer.py | python -c "import sys; import os; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main(os.getenv('HOME'))"; fi
- if [ "$LANGUAGE" == "C++" ]; then ebook-convert --version; fi
-
- if [ "$LANGUAGE" == "C++" ]; then mkdir -p /tmp/tools; pushd /tmp/tools; fi
- if [ "$LANGUAGE" == "C++" ] && [[ ! -f "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" ]]; then
curl -SOL "https://cmake.org/files/v$CMAKE_VERSION_PREFIX/cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
chmod +x "cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh";
fi
- if [ "$LANGUAGE" == "C++" ]; then ./"cmake-$CMAKE_VERSION_FULL-Linux-x86_64.sh" --prefix="$HOME" --exclude-subdir --skip-license; fi
-
- if [ "$LANGUAGE" == "C++" ] && [[ ! -f "ninja-$NINJA_VERSION.zip" ]]; then
curl -SLO "https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip";
mv "ninja-linux.zip" "ninja-$NINJA_VERSION.zip";
fi
- if [ "$LANGUAGE" == "C++" ]; then unzip "ninja-$NINJA_VERSION.zip" -d "$HOME/bin"; popd; fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then gem install ronn; fi
script:
- if [ "$LANGUAGE" == "C++" ]; then make; fi
-
- if [ "$LANGUAGE" == "Ruby" ]; then
mkdir man; pushd man;
cp ../gen-epub-book.md gen-epub-book.cpp.md;
ronn --organization="gen-epub-book.cpp developers" gen-epub-book.cpp.md;
mv "gen-epub-book.1.html" "gen-epub-book.cpp.1.html";
mv "gen-epub-book.1" "gen-epub-book.cpp.1";
popd;
fi
after_success:
- if [ "$LANGUAGE" == "C++" ] && [ "$DEPLOY" ] && [ "$TRAVIS_TAG" ]; then
cp "out/gen-epub-book.out" "$DEPLOY_FILE";
strip --strip-all --remove-section=.comment --remove-section=.note "$DEPLOY_FILE";
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ] && [ "$TRAVIS_COMMIT_RANGE" ] && ! [ "$TRAVIS_TAG" ]; then
(
echo "Update C++ manual for commits $TRAVIS_COMMIT_RANGE";
echo;
git log $TRAVIS_COMMIT_RANGE --pretty=oneline;
) >> $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
mkdir -p ~/.ssh && cp gh_rsa_awk ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa;
git clone -b man [email protected]:nabijaczleweli/gen-epub-book.git $TRAVIS_BUILD_DIR-man;
cp -f man/* "$TRAVIS_BUILD_DIR-man";
pushd "$TRAVIS_BUILD_DIR-man";
git config --global user.email "[email protected]";
git config --global user.name "Nabijaczleweli Autouploader Bot";
git config --global push.default simple;
git add *;
git commit -F $TRAVIS_BUILD_DIR/../MAN_UPDATE_MSG;
git push;
popd;
fi
- if [ "$LANGUAGE" == "Ruby" ] && [ "$TRAVIS_TAG" ]; then
cp -r man "$TRAVIS_BUILD_DIR/../gen-epub-book.cpp-man-$TRAVIS_TAG";
pushd "$TRAVIS_BUILD_DIR/..";
tar -caf "gen-epub-book.cpp-man-$TRAVIS_TAG.tbz2" "gen-epub-book.cpp-man-$TRAVIS_TAG";
rm -rf "gen-epub-book.cpp-man-$TRAVIS_TAG";
popd;
fi
deploy:
provider: releases
api-key:
secure: stxnyBJJBRCIL5CdzwQeCGwrZ9Bh1Z8jZA4ojKZ/1RzXyAV/h1g2tQnbbW7cUA7QT4AvITwRDN5CW6KzZfUAqUr2Kz0XoMuE7+zuyFUihVt6Vmilr//ZUpkTbektfJDUvfYA4P4kna9S2zUfE1sW3wGheq5lbi70UVN39Zc1d8aE2dO25DP4Hcqf2HH/sHRA+U7uyMtD75qPlGgcl4YPQaPVyuVfIthMaXYYr2Pt21qIOoMib2oMIKJWLc9ftkBQaIvs9Zt0sECMTmQhaO0li8N4ZpaxiUJsSyGxt/ZkydRjDoReJVkQQO+/p4Ed7jQp8TcaBlSmFivNyd18/L06CX2h0BiawftbtEIDC9U1Xi+7VqVWfk2kIK6MqjnY0AtdsAJmQvTq60e7O1lnHkDZTu3tvXR8v+6HQdofeUM6oU75CRXgmO+MTtxQkyB1v1tDqh7REfYHCO4Q6HKaPVGpJP5XOuY0qN9vragTP5UlVgVDYi0+jzX8zrL+gE0SKm55lYkYrfNqheCvTref1No4K92Lt5fjQbT2LSjp3b/NESvcLHiL42S7KrkhI3qFqJwEYPVXl/3eGyRp/EpGUaNdFh9eZECTBOAaGLVtHQlVgfUpoST+9fBiFuRHmSexlV19Ke3NPa2h229kuIBshFWxq3Dlk9ZJMpWXKzJII36/TAA=
file: "$DEPLOY_FILE"
skip_cleanup: true
on:
tags: true
condition: $DEPLOY = true