-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
168 lines (152 loc) · 5.92 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
# Do not trigger Travis if the commit message contains "(WIP)" or "#no_travis" (case-insensitive)
if: commit_message !~ /(\(WIP\)|#no_travis)/
language: cpp
# For Linux, use Ubuntu 18.04 to have g++-10 in Ubuntu Toolchain PPA
dist: bionic
env:
global:
PREMAKE_VERSION="5.0.0-alpha15"
addons:
apt:
packages: &linux_packages
libxrandr-dev
libudev-dev
libgl1-mesa-dev
libflac-dev
libogg-dev
libvorbis-dev
libvorbisenc2
libvorbisfile3
libopenal-dev
jobs:
include:
# Disable OSX since we know OSX clang doesn't support <concepts>
# # For OSX, use 10.15.7 with Xcode 12.2 to have OSX clang 12.0.0
# - os: osx
# osx_image: xcode12.2
# env:
# # osx simply names "clang++" the latest clang installed with Xcode toolchain
# - COMPILER=clang++
# - PREMAKE_GENERATOR=gmake
# # There are two OSX builds deployed, here is the gmake build
# - DEPLOY=true
# - DEPLOY_FILE=build/macosx_gmake_Release/bin/Game_gmake.app.zip
# compiler: clang++
# - os: osx
# osx_image: xcode12.2
# env:
# - COMPILER=clang++
# - PREMAKE_GENERATOR=xcode4
# # There are two OSX builds deployed, here is the Xcode build
# - DEPLOY=true
# - DEPLOY_FILE=build/macosx_xcode4_Release/bin/Game.app.zip
# compiler: clang++
- os: linux
env:
- COMPILER=g++-10
- PREMAKE_GENERATOR=gmake
# make with g++ build will represent Linux to deploy release
- DEPLOY=true
- DEPLOY_FILE=build/linux_gmake_Release/bin/Game_Linux.zip
addons:
apt:
packages:
- *linux_packages
- g++-10
sources:
- ubuntu-toolchain-r-test
- os: linux
env:
- COMPILER=clang++-11
- PREMAKE_GENERATOR=gmake
- DEPLOY=false
addons:
apt:
packages:
- *linux_packages
# g++-10 is only to install C++20 headers/libraries to be used by clang
- g++-10
- clang-11
sources:
# ubuntu-toolchain-r-test is only to install g++-10
- ubuntu-toolchain-r-test
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
compiler: clang++
install:
# Set the ${CXX} variable properly (don't do it in env, it is too early and would be overriden
# by travis compiler settings just afterward)
# and do it after the initial package install to have g++-10 available if used
- export CXX=${COMPILER}
- ${CXX} --version
# Dependencies required by the CI are installed in DEPS_DIR
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p "${DEPS_DIR}"
- pushd "${DEPS_DIR}"
# Download premake binary for current platform if not already done via cache (also check version just in case)
- |
if [[ ! -d "premake-${PREMAKE_VERSION}" || ! -x "premake-${PREMAKE_VERSION}/premake5" || "$(premake5 --version)" != *"${PREMAKE_VERSION}" ]]; then
rm -rf "premake-${PREMAKE_VERSION}"
mkdir -p "premake-${PREMAKE_VERSION}"
pushd "premake-${PREMAKE_VERSION}"
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
PREMAKE_BINARY_OS_NAME="macosx"
else
PREMAKE_BINARY_OS_NAME="linux"
fi
wget "https://github.com/premake/premake-core/releases/download/v${PREMAKE_VERSION}/premake-${PREMAKE_VERSION}-${PREMAKE_BINARY_OS_NAME}.tar.gz"
tar -xvzf "premake-${PREMAKE_VERSION}-${PREMAKE_BINARY_OS_NAME}.tar.gz"
popd
fi
# Install premake in ~/bin
- mkdir -p "$HOME/bin"
- cp "premake-${PREMAKE_VERSION}/premake5" "$HOME/bin/premake5"
# leave DEPS_DIR
- popd
before_script:
# Build dependencies
- engine/build_deps.py
# Premake
- premake5 "${PREMAKE_GENERATOR}"
script:
# Make (build dir must have been created by premake5)
- pushd build
- |
if [[ "${PREMAKE_GENERATOR}" == "gmake"* ]]; then
export JOBS="$(nproc)" # should be ~2
config=release make -j${JOBS} --debug=v
elif [[ "${PREMAKE_GENERATOR}" == "xcode"* ]]; then
xcodebuild -project Game.xcodeproj -target Game -configuration Release
fi
- popd
before_deploy:
# Archive the whole bin content to make sure to have the executable, assets and config.
# On OSX, we will eventually put everything in the .app, but the zip command should still work.
# Archiving also allows us to preserve execution permissions on Unix systems.
# We pushd to avoid archiving the whole folder hierarchy into the zip.
- |
if [[ $TRAVIS_OS_NAME == "linux" ]]; then
pushd build/linux_${PREMAKE_GENERATOR}_Release/bin
zip -r Game_Linux.zip .
popd
elif [[ $TRAVIS_OS_NAME == "osx" ]]; then
if [[ $PREMAKE_GENERATOR == "gmake"* ]]; then
pushd build/macosx_${PREMAKE_GENERATOR}_Release/bin
zip -r Game_gmake.app.zip .
popd
else
pushd build/macosx_${PREMAKE_GENERATOR}_Release/bin
zip -r Game.app.zip .
popd
fi
fi
deploy:
- provider: releases
api_key:
secure: IhrVPJTMBqjDyaM2384WfLGlctyQKPWPLABaVWtLef9hEsGr2U1zSzvdTpChFfgFT8Rc6BZSyFeQTVUoNGMAx3Sb3ei44VBL7b3L4xPuRglnjesmgd0CwMmQjYYLn1eL8D599cxkobhkwMxgl4ynDXS/1e07g0HwDdw5e/MVguotnLvsu0PXmHJEJ6Vt7lgkCQb4qK207D2RDfxWHZYry9uLsC+RWG3c0rrEF+oYnUfrb7248OPGzOBQCzZtNcOzxP2YWw+Em2/cn2HbOjiYClM7gjZnVgisE+x4Xel7OPNKur2LtYEuoEMrvGd7r3m4xMmiNLWOb3XWzAQncqUiK1nLBoAdA9MQm7lIS8I+mpV0i9wvsWLmFM98gAKjY/bv5tcpjPC4iRlbWZCMm50+Oxpg4Jwkw60Te0teG2tSCdWEbqVYku6PIv699f6EfpADA4vyteC832sIirIJ/Q+XawnSJpHII/OcGgOzPujk/IzGLk8IZyM3z6ZVaXB0NSmdYKP7AdylsS3GKxIFCL+hf9hRQniXDgmZyf2ehGt1kdLuWayPjkmaWpu5rnen1JJARLAx8n2ozhMHQt32SrPOpDBxX4z05g1UR/rgbtN9ij65puHOcwXO0mOLwRlC5mb+/1PBYKfcC+9O2Gw6IrMlx4wbwah3cEBHVs7Vp3f8mVQ=
file: ${DEPLOY_FILE}
# ignore travis lint warning, the new `cleanup` is not working yet
skip_cleanup: true
on:
condition: $DEPLOY = true
tags: true