forked from quotient-im/Quaternion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
179 lines (164 loc) · 5.42 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
175
176
177
178
179
language: cpp
dist: bionic
git:
depth: false
cache:
apt: true
env:
global:
- DESTDIR: "$TRAVIS_BUILD_DIR/install"
- CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=$DESTDIR/usr"
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
packages:
- ninja-build
- qtdeclarative5-dev
- qml-module-qtquick-controls
- qml-module-qtquick-controls2
- qtmultimedia5-dev
- qttools5-dev
- qt5keychain-dev
- os: linux
dist: xenial
compiler: gcc
env:
- BUILD_APPIMAGE=1
- CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF"
- CC=gcc-7
- CXX=g++-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt-5.12.3-xenial'
packages:
- g++-7
- libgl1-mesa-dev # Forgotten Qt dep
- qt512base
- qt512imageformats
- qt512svg
- qt512multimedia
- qt512quickcontrols
- qt512quickcontrols2
- qt512tools
- qt512translations
- qt5keychain-dev
- appstream-util
after_success:
# TODO: maybe move AppImage generation to CMakeLists.txt
# (pre-wgetting AppImageKit to avoid CMakeList.txt dependency on Internet?)
# FIXME: The AppImageKit downloadables should at the very least be verified
- mkdir AppImageKit && pushd AppImageKit
- |
wget -c -nv \
"https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" \
"https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so" \
"https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64"
- chmod a+x ./linuxdeployqt-continuous-x86_64.AppImage
- install -D -m "u=rw,go=r" -t $DESTDIR/usr/optional/libstdc++ /usr/lib/x86_64-linux-gnu/libstdc++.so.6
- install -D -m "u=rw,go=r" ./exec*.so $DESTDIR/usr/optional/exec.so
- install -m "u=rwx,go=rx" ./AppRun* $DESTDIR/AppRun
- unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
- |
./linuxdeployqt-continuous-x86_64.AppImage \
$DESTDIR/usr/share/applications/*.desktop -appimage \
-extra-plugins=iconengines,platformthemes/libqgtk3.so \
-qmldir=$TRAVIS_BUILD_DIR/client/qml -verbose=$DEPLOY_VERBOSITY
- popd
- os: linux
compiler: clang
addons:
apt:
sources:
- sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
packages:
- ninja-build
- libgl1-mesa-dev # Forgotten Qt dep
- qt512base
- qt512imageformats
- qt512svg
- qt512multimedia
- qt512quickcontrols
- qt512quickcontrols2
- qt512tools
- qt512translations
- qt5keychain-dev
- appstream-util
- os: osx
env: [ 'PATH=/usr/local/opt/qt/bin:$PATH' ]
before_cache:
- brew cleanup
cache:
directories:
- $HOME/Library/Caches/Homebrew
addons:
homebrew:
update: true
packages:
- qt5
- qtkeychain
after_success:
- _cmake_build --target image
- mv -v build/quaternion.dmg "quaternion-$VERSION.dmg"
before_install:
- if [ -f /opt/qt512/bin/qt512-env.sh ]; then . /opt/qt512/bin/qt512-env.sh; fi
# VERSION is also used by linuxdeployqt
- if [ -n "$TRAVIS_TAG" ]; then export VERSION="$TRAVIS_TAG"; else export VERSION="git$(git rev-list --count HEAD)"; fi
- if [ -f "$(which ninja)" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi
# RPM spec-style: swallow a command with default parameters into a variable
# and add/override parameters further in the code if/as necessary
- shopt -s expand_aliases
- alias _cmake_config='cmake $CMAKE_ARGS . -Bbuild'
- alias _cmake_build='cmake --build build'
install:
- git clone https://gitlab.matrix.org/matrix-org/olm.git
- pushd olm
- _cmake_config
- _cmake_build # TODO: --target install when the patch for olm lands
- popd
#before_script is reserved for customisation in the build matrix
script:
# TODO: add building with an external lib
- _cmake_config -LA -DUSE_INTREE_LIBQMC=1 -DDEPLOY_VERBOSITY=$DEPLOY_VERBOSITY
- if [ -f "$(which appstream-util)" ]; then appstream-util validate linux/*.appdata.xml; fi
- _cmake_build --target all
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then _cmake_build --target install; fi
#after_success is reserved for customisation in the build matrix
before_deploy:
- sed -i -e "s/VERSION_VALUE/$VERSION/g" .ci/bintray-release.json
- sed -i -e "s/BINTRAY_SUBJECT/$BINTRAY_SUBJECT/g" .ci/bintray-release.json
- sed -i -e "s/BINTRAY_REPO/$BINTRAY_REPO/g" .ci/bintray-release.json
- sed -i -e "s/BINTRAY_NAME/$BINTRAY_NAME/g" .ci/bintray-release.json
deploy:
- provider: bintray
file: .ci/bintray-release.json
user: $BINTRAY_USER
key: $BINTRAY_TOKEN
skip_cleanup: true
on:
tags: false
- provider: releases
api_key: $GITHUB_API_KEY
file: quaternion-$VERSION.dmg
skip_cleanup: true
on:
tags: true
- provider: releases
api_key: $GITHUB_API_KEY
file_glob: true
file: AppImageKit/Quaternion*.AppImage
skip_cleanup: true
on:
condition: -n "$RELEASE_APPIMAGE"
tags: true
notifications:
webhooks:
urls:
- "https://scalar.vector.im/api/neb/services/hooks/dHJhdmlzLWNpLyU0MGtpdHN1bmUlM0FtYXRyaXgub3JnLyUyMVBDelV0eHRPalV5U3hTZWxvZiUzQW1hdHJpeC5vcmc"
on_success: change # always|never|change
on_failure: always
on_start: never