-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
370 lines (353 loc) · 13.5 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
language: c
os: linux
git:
depth: false
env:
global:
- CACHE=$HOME/.sdlpal-caches
- PIP=pip
cache:
directories:
- $CACHE
before_script:
- mkdir deploy
jobs:
fast_finish: true
include:
- os: linux
env: TARGET=AppImage EXT=AppImage
addons:
apt:
sources:
- sourceline: 'ppa:savoury1/games'
packages:
- libsdl2-dev
- libfltk1.3-dev
- upx-ucl
script:
- cd unix
- make CCFLAGS="-DAPPIMAGE=1"
- ./appimage.sh
- rm ../main.unix.*
- make check
- cd ..
- os: linux
env: TARGET=MinGW32 SDL2_VERSION=2.0.14 EXT=zip
addons:
apt:
packages:
- binutils-mingw-w64-i686
- gcc-mingw-w64-i686
- g++-mingw-w64-i686
- zip
- upx-ucl
before_install:
- cd win32
- |
if ! [ -d $CACHE/SDL2-$SDL2_VERSION ]
then
export PUSHD="$(pwd)"
cd ../3rd/SDL
CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ \
bash ./configure --host=i686-w64-mingw32 --prefix=$CACHE/SDL2-$SDL2_VERSION \
--enable-static --disable-shared
make install V=1 SHELL=/bin/bash
cd "${PUSHD}"
fi
- ln -sf $CACHE/SDL2-$SDL2_VERSION
- export PATH=$(pwd)/SDL2-$SDL2_VERSION/bin:$PATH
- cd ..
script:
- cd win32
- make HOST=i686-w64-mingw32-
- i686-w64-mingw32-strip -s sdlpal.exe
- upx --best --lzma sdlpal.exe
- zip sdlpal-win32-mingw.zip sdlpal.exe
- mv sdlpal-win32-mingw.zip ../deploy/
- cd ..
- os: linux
env: TARGET=MinGW32-armv7 SDL2_VERSION=2.0.14-armv7 EXT=zip
addons:
apt:
packages:
- zip
- upx-ucl
- make
- lzma
- openssl
- mono-devel
before_install:
- cd win32
- |
if ! [ -f $CACHE/llvm-mingw-armv7/armv7-w64-mingw32/bin/libc++.dll ]
then
# download llvm-mingw for armv7 build
export PUSHD="$(pwd)"
mkdir $CACHE
cd $CACHE
wget -O llvm-mingw-armv7.tar.gz 'https://github.com/sdlpal/tools/releases/download/sensedown/llvm-mingw-armv7.tar.gz'
tar xzvf llvm-mingw-armv7.tar.gz
rm llvm-mingw-armv7.tar.gz
cd "${PUSHD}"
fi
- |
if ! [ -d $CACHE/SDL2-$SDL2_VERSION ]
then
export PUSHD="$(pwd)"
cd ../3rd/SDL
export PATH=${CACHE}/llvm-mingw-armv7/bin:$PATH
CC=armv7-w64-mingw32-gcc CXX=armv7-w64-mingw32-g++ \
bash ./configure --host=armv7-w64-mingw32 --prefix=$CACHE/SDL2-$SDL2_VERSION \
--enable-static --disable-shared --disable-joystick --disable-haptic \
--disable-video-opengl --enable-render-d3d
make install V=1 SHELL=/bin/bash
cd "${PUSHD}"
fi
- ln -sf $CACHE/SDL2-$SDL2_VERSION
- ln -sf $CACHE/llvm-mingw-armv7 llvm-mingw
- export PATH=$(pwd)/SDL2-$SDL2_VERSION/bin:$(pwd)/llvm-mingw/bin:$PATH
- cd ..
script:
- cd win32
- make HOST=armv7-w64-mingw32- OPENGL_LIBS=
- armv7-w64-mingw32-strip -s sdlpal.exe
- "openssl pkcs12 -passin pass: -in ../winrt/SDLPal.UWP/SDLPal_TemporaryKey.pfx -nocerts -nodes -out key.pem"
- "openssl rsa -passout pass:temporary -in key.pem -outform PVK -pvk-strong -out authenticode.pvk"
- "openssl pkcs12 -passin pass: -in ../winrt/SDLPal.UWP/SDLPal_TemporaryKey.pfx -nokeys -nodes -out cert.pem"
- "openssl crl2pkcs7 -nocrl -certfile cert.pem -outform DER -out authenticode.spc"
- "echo temporary | signcode -spc authenticode.spc -v authenticode.pvk -a sha1 -$ commercial -n SDLPal -i https://sdlpal.github.io -t https://tsa.starfieldtech.com -tr 10 sdlpal.exe"
- zip sdlpal-windows-armv7.zip sdlpal.exe
- mv sdlpal-windows-armv7.zip ../deploy/
- cd ..
- os: linux
env: TARGET=wii EXT=tar.bz2
before_install:
- echo 'DOCKER_OPTS="$DOCKER_OPTS --debug --registry-mirror=https://mirror.gcr.io"'
- sudo service docker restart
- docker system info
- export PUSHD="$(pwd)"
- mkdir -p $CACHE/
- cd $CACHE/
- docker run -dit --name devkit -v $(pwd):/cache -v $TRAVIS_BUILD_DIR:/src devkitpro/devkitppc bash
- |
if ! [ -d $CACHE/sdl-wii ]
then
git clone https://github.com/dborth/sdl-wii.git
fi
- docker exec -it devkit make -C cache/sdl-wii/SDL install
- cd "${PUSHD}"
script:
- cd wii
- docker exec -it devkit /bin/bash -ex /src/wii/.travis/docker.sh
- tar cvjf ../deploy/sdlpal-wii.tar.bz2 icon.png meta.xml boot.dol
- make clean
- cd ..
- os: linux
env: TARGET=3ds EXT=cia
addons:
apt:
packages:
- unzip
services:
- docker
before_install:
- echo 'DOCKER_OPTS="$DOCKER_OPTS --debug --registry-mirror=https://mirror.gcr.io"'
- sudo service docker restart
- docker system info
- export PUSHD="$(pwd)"
- mkdir -p $CACHE/
- cd $CACHE/
- docker run -dit --name devkit -v $(pwd):/cache -v $TRAVIS_BUILD_DIR:/src devkitpro/devkitarm bash
- |
if ! [ -d $CACHE/SDL-1.2-N3DS ]
then
git clone https://github.com/zephray/SDL-1.2-N3DS.git
fi
- docker exec -it devkit make -C cache/SDL-1.2-N3DS/SDL-1.2.15 -f Makefile.n3ds install
- |
if ! [ -f $CACHE/makerom ]
then
wget https://github.com/3DSGuy/Project_CTR/releases/download/makerom-v0.17/makerom-v0.17-ubuntu_x86_64.zip
unzip -o makerom-v0.17-ubuntu_x86_64.zip
chmod +x makerom
fi
- docker exec -it devkit cp /cache/makerom /opt/devkitpro/tools/bin
- cd "${PUSHD}"
script:
- cd 3ds
- docker exec -it devkit make -C src/3ds cia
- cp sdlpal.cia ../deploy/sdlpal-3ds.cia
- cd ..
- os: linux
language: android
env: TARGET=Android ANDROID_BUILD_TOOLS=28.0.3 NDK_VERSION=r16 TERM=dumb EXT=apk PIP="sudo pip3"
addons:
apt:
packages:
- python3-pip
android:
components:
- tools
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-28
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
cache:
directories:
- $CACHE
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/dists/
before_install:
- export PUSHD="$(pwd)"
- mkdir -p $CACHE
- cd $CACHE
- |
if [ -f ndk.zip ]
then
mv ndk.zip ndk-$NDK_VERSION.zip
fi
- |
if ! [ -f ndk-$NDK_VERSION.zip ]
then
wget https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip -O ndk-$NDK_VERSION.zip
fi
- cd ..
- unzip $CACHE/ndk-$NDK_VERSION.zip > /dev/null
- export ANDROID_NDK_HOME=`pwd`/android-ndk-$NDK_VERSION
- cd "${PUSHD}"
script:
- cd android
- sed -i.bak s/"android:versionCode.*"/"android:versionCode=\"`date +'%s'`\""/g ./app/src/main/AndroidManifest.xml
- ./gradlew assembleRelease
- cd ..
- if [[ $TRAVIS_COMMIT_MESSAGE =~ .*[skip\ play].* ]]; then touch $HOME/PLAY_DEPLOY; else echo 'WARNING - skipping Google Play deployment'; fi
- |
if [ -f "$HOME/PLAY_DEPLOY" ] && ! [ -z "$ANDROID_KEY_FILE" ]
then
/usr/local/android-sdk/build-tools/${ANDROID_BUILD_TOOLS}/zipalign -v 4 android/app/build/outputs/apk/release/app-release-unsigned.apk deploy/sdlpal-release.apk
echo ${ANDROID_KEY_FILE} | base64 -d > android-key.key
/usr/local/android-sdk/build-tools/${ANDROID_BUILD_TOOLS}/apksigner sign --ks android-key.key --ks-pass pass:${ANDROID_KEY_PASS} deploy/sdlpal-release.apk
else
jarsigner -storetype pkcs12 -keystore winrt/SDLPal.UWP/SDLPal_TemporaryKey.pfx -sigalg SHA1withRSA -digestalg SHA1 -signedjar deploy/sdlpal-release.apk -storepass "" android/app/build/outputs/apk/release/app-release-unsigned.apk 1
fi
- os: osx
osx_image: xcode12.3
env: TARGET=iOS EXT=ipa
cache: cocoapods
podfile: ios/SDLPal/Podfile
script:
- cd ios/SDLPal
- pod install
- xcodebuild -workspace SDLPal.xcworkspace -scheme SDLPal ONLY_ACTIVE_ARCH=NO CODE_SIGNING_ALLOWED=NO -configuration Release CONFIGURATION_BUILD_DIR=/tmp/sdlpal-build
- mkdir -p Payload
- mv /tmp/sdlpal-build/SDLPal.app Payload
- zip ../../deploy/sdlpal-unsigned.ipa -r Payload
- cd ../..
- os: osx
osx_image: xcode12.3
env: TARGET=macOS EXT=dmg
language: objective-c
script:
- cd macos
- xcodebuild -project Pal.xcodeproj -configuration Release
- hdiutil create -srcfolder build/Release/Pal.app -volname "SDLPal" ../deploy/sdlpal-macos.dmg
- #xcodebuild test -scheme PalTests #disabled since always fail in travis-ci
- cd ..
- os: osx
osx_image: xcode9.2
env: TARGET=macOS-SDL1 SDL=1.2.15 EXT=dmg PIP=pip3
before_install:
- |
if ! [ -d /Library/Frameworks/SDL.framework ]
then
export PUSHD="$(pwd)"
mkdir -p "${CACHE}"
cd "${CACHE}"
if ! [ -f SDL-$SDL.dmg ]
then
curl -O -L https://www.libsdl.org/release/SDL-$SDL.dmg
fi
hdiutil attach SDL-$SDL.dmg
sudo cp -a /Volumes/SDL/SDL.framework /Library/Frameworks/
hdiutil detach /Volumes/SDL
rm *.dmg
cd "${PUSHD}"
fi
script:
- cd macos
- xcodebuild -project Pal_SDL12.xcodeproj -configuration Release
- hdiutil create -srcfolder build/Release/Pal.app -volname "SDLPal-SDL1" ../deploy/sdlpal-sdl1-macos.dmg
- cd ..
after_success:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install python3
- os: linux
language: node_js
env: TARGET=Emscripten TAG=1.39.8-upstream EXT=zip
services:
- docker
before_install:
- echo 'DOCKER_OPTS="$DOCKER_OPTS --debug --registry-mirror=https://mirror.gcr.io"'
- sudo service docker restart
- docker system info
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:$TAG bash
script:
- sed -i 's@https://localhost:8080/@https://sdlpal.github.io/demo/@g' emscripten/Makefile
- docker exec -it emscripten emmake make -C emscripten
- cd emscripten
- zip ../deploy/sdlpal-emscripten.zip *.{html,js,wasm,wasm.map,png}
- cd ..
before_deploy:
- |
if [ -f "$HOME/PLAY_DEPLOY" ]
then
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install -y ruby2.4 ruby2.4-dev
sudo gem install google-api-client -v 0.29.1
sudo gem install fastlane
echo ${PLAY_API_JSONFILE} | base64 -d > google-key.json;
fi
- CI=$(git show -s --format=%cI)
- DATE=${CI%T*}
- REV=$(git rev-list --count HEAD)
- COMMIT=$(git rev-parse --short HEAD)
- VERSION=v$DATE-r$REV-g$COMMIT
- $PIP install cloudsmith-cli
- git config --global user.email "[email protected]"
- git config --global user.name "SDLPAL"
deploy:
- provider: script
script: bash -c '[ -f "$HOME/PLAY_DEPLOY" ] && fastlane supply --apk deploy/sdlpal-release.apk --track alpha --json_key ./google-key.json --package_name com.sdlpal.sdlpal || true'
skip_cleanup: true
on:
branch: master
- provider: script
script: bash -c '[[ -f "emscripten/sdlpal.js" ]] && git clone --depth=1 https://github.com/sdlpal/demo ~/demo && cp -f emscripten/*.{html,js,wasm,wasm.map,png} ~/demo && cd ~/demo && git add -A && git commit -mAutoupdate -a && git push "https://${AUTO_UPDATE_USERNAME}:${AUTO_UPDATE_PASS}@github.com/sdlpal/demo" || true'
skip_cleanup: true
on:
branch: master
- provider: releases
token: $GITHUB_TOKEN
file_glob: true
file: deploy/*
skip_cleanup: true
overwrite: true
on:
all_branches: true
tags: true
- provider: script
edge: true
script: cloudsmith push raw sdlpal/sdlpal --version $VERSION --name $TARGET --republish deploy/*.$EXT --tags "branch/$TRAVIS_BRANCH"
on:
all_branches: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/922838d6727e919df50e
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always