-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
99 lines (92 loc) · 2.82 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
sudo: false
language: cpp
branches:
only:
- master
env:
global:
- BIN=qml-browser
matrix:
include:
- os: linux
dist: xenial
sudo: require
addons:
apt:
sources:
# Add ppa for gcc-7
- sourceline: 'ppa:ubuntu-toolchain-r/test'
# Set ppa to get a modern version of qt
- sourceline: 'ppa:beineri/opt-qt-5.12.3-xenial'
packages:
- g++-7
- git
env:
- APPIMAGE="true"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: osx
osx_image: xcode10.1
compiler: clang
env:
- DMG="true"
- MATRIX_EVAL="COMPILER=clang++"
install:
- if [ ! -z "${APPIMAGE}" ]; then
export QTV=qt512;
sudo apt update -qq;
echo "Install qt libraries";
sudo apt install build-essential ${QTV}base
${QTV}quickcontrols ${QTV}quickcontrols2
${QTV}webengine ${QTV}multimedia
${QTV}graphicaleffects ${QTV}svg ${QTV}scxml libgl1-mesa-dev;
export ARTIFACT="$BIN*.AppImage";
fi
- if [ ! -z "${DMG}" ]; then
echo "Download last version of Qt with brew";
brew update > /dev/null;
brew install qt5;
chmod -R 755 /usr/local/opt/qt5/*;
export QTDIR="/usr/local/opt/qt5";
export PATH="$QTDIR/bin:$PATH";
export ARTIFACT="$BIN*.dmg";
fi
script:
- eval "${MATRIX_EVAL}"
- if [ ! -z "${APPIMAGE}" ]; then
echo "Load qt env";
source /opt/qt*/bin/qt*-env.sh;
echo "Build project";
mkdir build && cd build;
qmake ..;
make;
echo "Create deploy folder";
mkdir deploy;
cp ../deploy/icon.png deploy/;
cp ../deploy/$BIN.desktop deploy/;
mv $BIN deploy/;
echo "Donwload and run linuxdeployqt";
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage";
chmod a+x linuxdeployqt*.AppImage;
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH;
mkdir -p deploy/usr/share/doc/libc6/;
cp /usr/share/doc/libc6/copyright deploy/usr/share/doc/libc6/copyright;
./linuxdeployqt*.AppImage deploy/$BIN.desktop -unsupported-allow-new-glibc -bundle-non-qt-libs -extra-plugins=iconengines,imageformats -verbose=2 -qmldir=../qml -appimage;
mv $BIN*.AppImage $BIN.AppImage;
fi
- if [ ! -z "${DMG}" ]; then
echo "Build project";
mkdir build && cd build;
qmake ..;
make;
echo "Run macdeployqt";
macdeployqt $BIN.app/ -qmldir=../qml -dmg;
find . | grep dmg;
fi
after_success:
- if [ "${TRAVIS_PULL_REQUEST}" != false ] || [ "${TRAVIS_BRANCH}" != "master" ]; then
echo "This is not the master branch, no deploy will be done";
travis_terminate 0;
fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- if [ ! -z "${APPIMAGE}" ]; then bash ./upload.sh $ARTIFACT; fi
- if [ ! -z "${DMG}" ]; then bash ./upload.sh $ARTIFACT; fi