forked from pencil2d/pencil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
174 lines (161 loc) · 6.25 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Travis-CI configuration file for SuperTuxKart modified by CandyFace for Pencil2D
#
# Configuration manual:
# http://docs.travis-ci.com/user/build-configuration/
#
# How to use TravisCI with C++ (Qt Test, C++11):
# https://github.com/richelbilderbeek/travis_qmake_gcc_cpp11_qt_qtests
#
language: cpp
compiler: g++
sudo: required
dist: trusty
osx_sdk: macosx10.12
os:
- linux
- osx
env:
global:
- DOXYFILE: $TRAVIS_BUILD_DIR/util/docs/Doxyfile-Travis
- GH_REPO_REF: github.com/pencil2d/pencil-docs.git
- DOXYGEN_OUTPUT_DIR: $TRAVIS_BUILD_DIR/docs
python:
- "3.4"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- ubuntu-sdk-team
- trusty-media
- sourceline: 'ppa:beineri/opt-qt591-trusty'
packages:
- build-essential
- qt59tools
- qt59base
- qt59multimedia
- qt59svg
- qt59xmlpatterns
- bsdtar
- ffmpeg
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
- python3
- python3-pip
before_install:
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
ver=$(python -V 2>&1 | sed 's/.* \([0-9]\).\([0-9]\).*/\1\2/');
python -V
if [ "$ver" -le "27" ]; then
brew upgrade python;
fi
brew install p7zip;
brew install qt;
brew link qt --force;
fi
install:
- pip3 freeze > requirements.txt
- pip3 install -r requirements.txt
- sudo pip3 install --upgrade oauth2client
- sudo pip3 install --upgrade google-api-python-client
- python3 -V
- pip3 -V
before_script:
- echo "are changes related to source code?"
- 'if [ "$TRAVIS_BRANCH" != "release" ]; then
bash $TRAVIS_BUILD_DIR/util/checkchanges.sh;
fi'
- 'if [ "$TRAVIS_OS_NAME" == "linux" ]; then
. /opt/qt59/bin/qt59-env.sh;
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
echo "give xvfb some time to start";
sleep 3;
fi'
- qmake --version
script:
- mkdir "build" && cd build
- 'if [ "$TRAVIS_BRANCH" == "release" ]; then
qmake ../ PREFIX=/usr CONFIG+=release DEFINES+=QT_NO_DEBUG_OUTPUT DEFINES+=PENCIL2D_RELEASE;
else
qmake ../ PREFIX=/usr CONFIG+=release CONFIG+=GIT CONFIG+=NIGHTLY;
fi'
- make;
- "$TRAVIS_BUILD_DIR/build/tests/tests"
after_success:
- echo "look for build folder and zip file"
- ls
- 'if [ "$TRAVIS_OS_NAME" == "linux" ]; then
make INSTALL_ROOT="${PWD}/Pencil2D" install;
rm -rf Pencil2D/usr/lib;
echo "Creating AppImage...";
sed -i "/^Keywords\(\[[a-zA-Z_.@]\+\]\)\?=/d;/^Version=/cVersion=1.0" Pencil2D/usr/share/applications/pencil2d.desktop;
install -Dm755 /usr/bin/ffmpeg Pencil2D/usr/plugins/ffmpeg;
curl -fsSLO https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage;
chmod 755 linuxdeployqt-continuous-x86_64.AppImage;
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/pulseaudio" ./linuxdeployqt-continuous-x86_64.AppImage Pencil2D/usr/share/applications/pencil2d.desktop -executable=Pencil2D/usr/plugins/ffmpeg -extra-plugins=iconengines/libqsvgicon.so -appimage;
mv Pencil2D*.AppImage* "pencil2d-linux-$(date +"%Y-%m-%d").AppImage";
fi'
- 'if [ "$TRAVIS_OS_NAME" == "osx" ]; then
echo "cleaning...";
make clean;
mv bin Pencil2D;
echo "Fixing info.plist";
cd Pencil2D;
plutil -replace CFBundleExecutable -string pencil2d Pencil2D.app/Contents/Info.plist;
plutil -replace CFBundleIdentifier -string org.pencil2d.Pencil2D Pencil2D.app/Contents/Info.plist;
echo "Copying ffmpeg plugin";
mkdir Pencil2D.app/Contents/MacOS/plugins;
wget -P Pencil2D.app/Contents/MacOS/plugins https://evermeet.cx/pub/ffmpeg/ffmpeg-3.4.2.7z;
7z x Pencil2D.app/Contents/MacOS/plugins/ffmpeg-3.4.2.7z -o"Pencil2D.app/Contents/MacOS/plugins";
rm Pencil2D.app/Contents/MacOs/plugins/ffmpeg-3.4.2.7z;
echo "Copying necessary Qt frameworks";
macdeployqt Pencil2D.app;
echo "applying macdeployqt fix";
wget https://github.com/aurelien-rainone/macdeployqtfix/archive/master.zip; unzip -x master.zip; python $TRAVIS_BUILD_DIR/build/Pencil2D/macdeployqtfix-master/macdeployqtfix.py $TRAVIS_BUILD_DIR/build/Pencil2D/Pencil2D.app/Contents/MacOS/Pencil2D /usr/local/Cellar/qt/5.9.1/;
echo "Removing files";
rm -rf macdeployqtfix-master;
rm master.zip;
cd ..;
echo "Zipping...";
zip -r "pencil2d-mac-$(date +"%Y-%m-%d").zip" Pencil2D/;
fi'
- echo "zipping done"
- ls
# Upload to google drive
- 'if [ \( "$TRAVIS_BRANCH" == "master" -o "$TRAVIS_BRANCH" == "release" \) -o "$FORCE_NIGHTLY_UPLOAD" == "yes" ]; then
echo "Initiate deployment on Google Drive";
cd "$TRAVIS_BUILD_DIR/util";
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
python3 nightly-build-upload.py "$LINUX_NIGHTLY_PARENT" "$TRAVIS_BUILD_DIR/build/pencil2d-linux-$(date +"%Y-%m-%d").AppImage";
fi;
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
python3 nightly-build-upload.py "$OSX_NIGHTLY_PARENT" "$TRAVIS_BUILD_DIR/build/pencil2d-mac-$(date +"%Y-%m-%d").zip";
fi;
echo "Operation done";
fi'
# Upload internal pull request to google drive
- 'if [ "$TRAVIS_PULL_REQUEST_SLUG" == "pencil2d/pencil" ]; then
echo "Initiate deployment on Google Drive";
cd "$TRAVIS_BUILD_DIR/util";
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
mv "$TRAVIS_BUILD_DIR/build/pencil2d-linux-$(date +"%Y-%m-%d").AppImage" "$TRAVIS_BUILD_DIR/build/pencil2d-linux-pr-$TRAVIS_PULL_REQUEST.AppImage";
python3 pr-build-upload.py "$LINUX_PR_PARENT" "$TRAVIS_BUILD_DIR/build/pencil2d-linux-pr-$TRAVIS_PULL_REQUEST.AppImage";
fi;
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
mv "$TRAVIS_BUILD_DIR/build/pencil2d-mac-$(date +"%Y-%m-%d").zip" "$TRAVIS_BUILD_DIR/build/pencil2d-mac-pr-$TRAVIS_PULL_REQUEST.zip";
python3 pr-build-upload.py "$OSX_PR_PARENT" "$TRAVIS_BUILD_DIR/build/pencil2d-mac-pr-$TRAVIS_PULL_REQUEST.zip";
fi;
fi'
# Deploy doxygen documentation to github pages
- 'if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_OS_NAME" == "linux" ]; then
cd "$TRAVIS_BUILD_DIR/util/docs";
for i in core svg xmlpatterns; do
curl -fsSLO "https://doc.qt.io/qt-5/qt$i.tags";
done;
./documentation-deploy.sh;
fi'