forked from viewizard/astromenace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
198 lines (187 loc) · 5.2 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
matrix:
include:
- name: Ubuntu 20.04 AMD64 Clang
os: linux
dist: focal
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- NEED_DEPLOY="true"
addons:
apt:
packages:
- cmake
- make
- ninja-build
- libsdl2-dev
- libogg-dev
- libvorbis-dev
- libopenal-dev
- libalut-dev
- libfreetype6-dev
- libfontconfig1-dev
- name: Ubuntu 20.04 AMD64 GCC
os: linux
dist: focal
env:
- MATRIX_EVAL="CC=gcc && CXX=g++"
- NEED_DEPLOY="false"
addons:
apt:
packages:
- cmake
- make
- ninja-build
- libsdl2-dev
- libogg-dev
- libvorbis-dev
- libopenal-dev
- libalut-dev
- libfreetype6-dev
- libfontconfig1-dev
- name: Ubuntu 20.04 ARM64 Clang
os: linux
arch: arm64
dist: focal
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- NEED_DEPLOY="true"
addons:
apt:
packages:
- cmake
- make
- ninja-build
- libsdl2-dev
- libogg-dev
- libvorbis-dev
- libopenal-dev
- libalut-dev
- libfreetype6-dev
- libfontconfig1-dev
- name: Ubuntu 20.04 ARM64 GCC
os: linux
arch: arm64
dist: focal
env:
- MATRIX_EVAL="CC=gcc && CXX=g++"
- NEED_DEPLOY="false"
addons:
apt:
packages:
- cmake
- make
- ninja-build
- libsdl2-dev
- libogg-dev
- libvorbis-dev
- libopenal-dev
- libalut-dev
- libfreetype6-dev
- libfontconfig1-dev
- name: Ubuntu 20.04 MinGW
os: linux
dist: focal
env:
- MINGW="true"
- NEED_DEPLOY="true"
addons:
apt:
packages:
- cmake
- make
- ninja-build
- libsdl2-dev
- libogg-dev
- libvorbis-dev
- libopenal-dev
- libalut-dev
- libfreetype6-dev
- libfontconfig1-dev
- p7zip-full
- mingw-w64
- name: macOS native compilation
os: osx
osx_image: xcode12
env:
- NEED_DEPLOY="true"
addons:
homebrew:
packages:
- ninja
- sdl2
- libogg
- libvorbis
- freealut
- freetype
language: cpp
git:
depth: false
branches:
only:
- master
- test_ci
env:
global:
- RELEASE_BRANCH=master
before_install:
- eval "${MATRIX_EVAL}"
- |
if [ "$MINGW" = "true" ]; then
wget https://github.com/viewizard/astromenace-windows-prebuilt-dependencies/releases/download/latest/prebuilt_dep_mingw_32bit.zip
unzip prebuilt_dep_mingw_32bit.zip
rm prebuilt_dep_mingw_32bit.zip
export CUSTOM_CMAKE_ARGS="-DMINGW=1 -DDEPS_PATH=$PWD/prebuilt_dep_mingw_32bit -DDONTCREATEVFS=1"
fi
script:
- mkdir build
- cd build
- cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=$PWD/../bin -DCMAKE_BUILD_TYPE=Release ${CUSTOM_CMAKE_ARGS}
- cmake --build . --target install
- |
if [ "$MINGW" = "true" ]; then
mkdir ../build-vfs
cd ../build-vfs
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build .
mv gamedata.vfs ../bin/gamedata.vfs
fi
- cd ..
before_deploy:
- |
if [ "$TRAVIS_BRANCH" = "$RELEASE_BRANCH" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
# Create tag
#if [[ -z "$TRAVIS_TAG" ]]; then
# export TRAVIS_TAG="$(awk -F'"' '/GAME_VERSION/ {print $2}' ./src/build_config.h)-$(git rev-list HEAD --count)"
# git config --local user.name "Travis"
# git config --local user.email "[email protected]"
# git tag "$TRAVIS_TAG" -a -m "[Autogenerated] This is the latest version pushed to the ${TRAVIS_BRANCH} branch."
# git push https://${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG} --tags >/dev/null 2>&1
#fi
# Prepare files for deployment
mv bin astromenace
if [ "$MINGW" = "true" ]; then
7z a astromenace-win.zip astromenace
elif [ ${TRAVIS_OS_NAME} = 'linux' ]; then
echo "Make sure, you have all required libs installed: libSDL2 (ver 2.0.5+), libopenal (ver 1.0+), libalut (ver 1.0+), libogg (ver 1.1+), libvorbis (ver 1.1+), freetype (ver 2.1.6+)." > ./astromenace/ReadMe.txt
tar cfz astromenace-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}.tar.gz ./astromenace/*
elif [ ${TRAVIS_OS_NAME} = 'osx' ]; then
echo "Make sure, you have all required libs installed with HomeBrew (https://brew.sh/): sdl2, libogg, libvorbis, freealut, freetype." > ./astromenace/ReadMe.txt
tar cfz astromenace-${TRAVIS_OS_NAME}.tar.gz ./astromenace/*
fi
fi
deploy:
provider: releases
api_key: $GITHUB_API_KEY
file:
- "*.tar.gz"
- "*.zip"
file_glob: true
skip_cleanup: true
overwrite: true
name: "Autogenerated (for testing purposes only)"
prerelease: true
draft: true
on:
repo: $TRAVIS_REPO_SLUG
branch: $RELEASE_BRANCH
condition: $NEED_DEPLOY == "true"