-
Notifications
You must be signed in to change notification settings - Fork 126
/
.travis.yml
130 lines (125 loc) · 4.54 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
sudo: false
dist: xenial
cache:
apt: true
directories:
- $HOME/.deps
notifications:
email: false
slack:
rooms:
secure: FO4vtIe+YSl6xpJVmNzSOvef5RQxOjuUGJ02zhRrkBK3DOQMP2pOjIRIyEq6m0xx+BVK5UoLl8ACFS5e5P0wJOE7Bvl963yonKgK+sGutEGck5EmroBLCln9KvXkYaBElMgDZBZDm8q9ValjVwB2ym/aP82//6LLnCeVRBMThjE=
on_success: change
on_failure: always
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "VR/Ts9vkdBqrE22XaT4IrREJB7k0Ml60U+ek0VeVHQTAYGjL+KP13ocoTjBEIEo+iKbUJdX6pXN3VxKu7VAu2W47qIRi7VRznjH0MOonreV7oLX1s7uXYmxJSVIWjQ3EcKIW9I+Qpd3brTd3BV/ew816hfYJJKC2SU6AIV8RszE="
matrix:
include:
- os: osx
osx_image: xcode10.3
env: QF_ARCH=OSX
language: c++
compiler: clang
- os: linux
language: c++
compiler: clang
env: QF_ARCH=x86_64
addons:
apt:
update: true
packages:
- clang
- cmake
- ninja-build
- libsdl2-dev
- libopenal-dev
- libfreetype6-dev
- zlib1g-dev
- libcurl4-gnutls-dev
- libpulse-dev
- libpulse0=1:8.0-0ubuntu3.14
- libpulse-mainloop-glib0=1:8.0-0ubuntu3.14
coverity_scan:
project:
name: "Qfusion/qfusion"
description: "Build submitted via Travis CI"
notification_email: vluchits@gmail.com
build_command_prepend: "cd source && cov-configure --comptype clangcc --compiler clang && cov-configure --comptype clangcxx --compiler clang++ && export SDL2DIR=$HOME/.deps/$QF_ARCH && make -G Ninja ."
build_command: "ninja"
branch_pattern: ci
- dist: precise
language: android
env: QF_ARCH=android QF_ANDROID_ABI=armeabi-v7a
jdk: oraclejdk7
android:
components:
- build-tools-21.0.2
- android-18
install:
- |
if [[ "$QF_ARCH" == "android" ]] && [ ! -e "$HOME/.deps/android-ndk-r11c" ]; then
NDK_URL="http://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip"
curl -L ${NDK_URL} >ndk.zip && unzip ndk.zip -d $HOME/.deps &> /dev/null && rm ndk.zip
fi
- if [[ "$QF_ARCH" == "android" ]]; then export NDK_HOME=$HOME/.deps/android-ndk-r11c && export PATH="$PATH:$NDK_HOME"; fi
- if [[ "$QF_ARCH" == "x86_64" ]]; then export CC=clang CXX=clang++; fi
- cd "$TRAVIS_BUILD_DIR"
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ ! -d "$HOME/.deps/cmake" ]]; then
cd $HOME/.deps
CMAKE_URL="https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz"
mkdir -p cmake && travis_retry wget --no-clobber --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
export PATH=${HOME}/.deps/cmake/bin:${PATH}
echo ${PATH}
fi
- cmake --version
- cd "$TRAVIS_BUILD_DIR/source"
- if [[ "$QF_ARCH" == "x86_64" ]]; then cmake -G Ninja .; fi
- if [[ "$QF_ARCH" == "OSX" ]]; then cmake -G Xcode .; fi
- |
if [[ "$QF_ARCH" == "android" ]]; then
mkdir -p build/libs
cd ../platforms/android/projects/qfusion/jni
ln -s ../../../../../libsrcs libsrcs
ln -s ../../../../../third-party third-party
ln -s ../../../../../source source
ln -s ../../../../../icons icons
fi
- cd "$TRAVIS_BUILD_DIR"
script:
- cd source
- if [[ "$QF_ARCH" == "x86_64" ]]; then ninja; fi
- |
if [[ "$QF_ARCH" == "OSX" ]]; then
xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -scheme ALL_BUILD | xcpretty
fi
- |
if [[ "$QF_ARCH" == "android" ]]; then
cd ../platforms/android/projects/qfusion/jni &&
ndk-build APP_ABI=$QF_ANDROID_ABI -j8 &&
cd "$TRAVIS_BUILD_DIR/source" &&
cp -Rd ../platforms/android/projects/qfusion/libs/* build/
fi
before_deploy:
- cd build
- echo "${TRAVIS_COMMIT}" >commit.txt
- if [[ "$QF_ARCH" == "OSX" ]]; then cd Release && tar -czvf ../../tmp.tar.gz *.app && cd ..; fi
- if [[ "$QF_ARCH" != "OSX" ]]; then tar -czvf ../tmp.tar.gz * --exclude *.a --exclude base*/*.a libs/*.a; fi
- cd ..
- mv tmp.tar.gz ${QF_ARCH}-Release.tar.gz
deploy:
provider: releases
api_key:
secure: QJZp/MxExRLxtb/vBVNPjnavK/VlveFY5McQOi8qaSa3n30Rihlnlg7XuvAvwTY6zvpEAJcTlxFYh6T4zM2SRuql3XE2uBWFAsrhvw44JhqiSgZZepGu31eWPor4OeqEwuofXjXBzkz+m3xAOtpjnlKD/8crcMXnAlut/10jUoM=
skip_cleanup: true
file_glob: true
file: "*-Release.tar.gz"
overwrite: true
on:
repo: Qfusion/qfusion
tags: true