-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
119 lines (112 loc) · 3.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
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
sudo: false
language: cpp
env:
global:
- BIN=mini-qml
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.15.0-xenial'
packages:
- g++-7
- git
env:
- APPIMAGE="true"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- os: linux
dist: xenial
sudo: require
services: docker
env: WEBASM="true"
- os: osx
osx_image: xcode10.1
compiler: clang
env:
- DMG="true"
- MATRIX_EVAL="COMPILER=clang++"
install:
- if [ ! -z "${APPIMAGE}" ]; then
export QTV=qt515;
sudo apt update -qq;
echo "Install qt libraries";
sudo apt install build-essential ${QTV}base
${QTV}quickcontrols ${QTV}quickcontrols2
${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:
- export GITHUB_TOKEN="${github_token}"
- 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/continuous/linuxdeployqt-continuous-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
- if [ ! -z "${WEBASM}" ]; then
git remote set-url origin https://${GITHUB_TOKEN}@github.com/patrickelectric/mini-qml;
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*";
git fetch --all;
git config --global user.name "Patrick José Pereira";
git config --global user.email "[email protected]";
echo "Build project";
mkdir build;
docker run --rm -v $PWD:/project/source -v $PWD/build:/project/build maukalinow/qtwasm_builder:5.15_latest;
rm -rf build/{Makefile,*.o,*.cpp};
git checkout --track origin/gh-pages;
mv build/* .;
rm -rf build;
sudo mv mini-qml.html index.html;
git add --all;
git commit -sm "Update WebAssembly";
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
- if [ ! -z "${WEBASM}" ]; then git push origin gh-pages; fi