forked from sdlpal/sdlpal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
393 lines (376 loc) · 15.4 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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
language: c
os: linux
env:
global:
- CACHE=$HOME/.sdlpal-caches
cache:
directories:
- $CACHE
before_script:
- mkdir deploy
jobs:
fast_finish: true
include:
- os: linux
env: TARGET=AppImage
addons:
apt:
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.10
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
- cat SDL2-$SDL2_VERSION/bin/sdl2-config
- 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.10-armv7
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
- cat SDL2-$SDL2_VERSION/bin/sdl2-config
- 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 http://sdlpal.github.io -t http://timestamp.verisign.com/scripts/timstamp.dll -tr 10 sdlpal.exe"
- zip sdlpal-windows-armv7.zip sdlpal.exe
- mv sdlpal-windows-armv7.zip ../deploy/
- cd ..
- os: linux
env: TARGET=wii
before_install:
- export DEVKITPRO=$CACHE/devkitPro
- export DEVKITPPC=${DEVKITPRO}/devkitPPC
- export PATH=$DEVKITPPC/bin:$PATH
- |
if ! [ -f $DEVKITPRO/libogc/include/gctypes.h ]
then
rm -rfv $DEVKITPRO
fi
- |
if ! [ -d $DEVKITPRO ]
then
export PUSHD="$(pwd)"
mkdir -p $DEVKITPRO
(
cd $DEVKITPRO &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/devkitPPC_r27-x86_64-linux.tar.bz2 &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/libogc-1.8.12.tar.bz2 &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/libfat-ogc-1.0.13.tar.bz2 &&
wget https://github.com/dborth/sdl-wii/releases/download/2013-10-28/SDL.Wii.10-28-2013.zip
)&&(
cd $DEVKITPRO
tar xvf devkitPPC_r27-x86_64-linux.tar.bz2
mkdir libogc
tar xvf libogc-1.8.12.tar.bz2 -C libogc
tar xvf libfat-ogc-1.0.13.tar.bz2 -C libogc
unzip SDL.Wii.10-28-2013.zip
rm -v *.zip *.bz2
echo "cache finished!"
)||(
rm -rfv $DEVKITPRO
echo "download failed! clearing cache"
)
fi
script:
- cd wii
- make
- tar cvjf ../deploy/sdlpal-wii.tar.bz2 icon.png meta.xml boot.dol
- make clean
- cd ..
- os: linux
env: TARGET=3ds
addons:
apt:
packages:
- unzip
before_install:
- export PUSHD="$(pwd)"
- mkdir -p $CACHE/
- cd $CACHE/
- wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb
- sudo dpkg -i devkitpro-pacman.deb
- sudo dkp-pacman -Syu
- sudo dkp-pacman -S 3ds-dev --noconfirm
- export DEVKITPRO=/opt/devkitpro
- export DEVKITARM=/opt/devkitpro/devkitARM
- sudo chown $(whoami):$(whoami) /opt/devkitpro
- rm -rf SDL-1.2-N3DS
- git clone https://github.com/zephray/SDL-1.2-N3DS.git
- cd SDL-1.2-N3DS/SDL-1.2.15
- make -f Makefile.n3ds install
- wget https://github.com/profi200/Project_CTR/releases/download/0.15/makerom_015_ctrtool.zip
- unzip makerom_015_ctrtool.zip
- sudo mkdir -p /opt/ctrtool/bin
- sudo cp Linux_x86_64/* /opt/ctrtool/bin/
- sudo chmod +x /opt/ctrtool/bin/*
- export PATH=/opt/ctrtool/bin:$PATH
- cd "${PUSHD}"
script:
- cd 3ds
- make
- make 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
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 http://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: xcode11
env: TARGET=iOS
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: xcode11
env: TARGET=macOS
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 SDL=1.2.15
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 ..
- os: linux
language: node_js
env: TARGET=Emscripten TAG=1.39.8-upstream
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:$TAG bash
script:
- sed -i 's@http://localhost:8080/@https://sdlpal.github.io/demo/@g' emscripten/Makefile
- docker exec -it emscripten emmake make -C emscripten
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*}
- COMMIT=$(git rev-parse --short HEAD)
- VERSION=v$DATE-g$COMMIT
- set -f
- |
sed -i.bak "
s/@VERSION@/$VERSION/g
s/@DESC@/$(echo -n $TRAVIS_COMMIT_MESSAGE|tr '\r' '\\r'|tr '\n' '\\n'|sed -e 's@[\\"]@\\&@g;s@[/&\$]@\\&@g')/g
s/@RELEASE_DATE@/$(git show -s --format=%cI)/g
s/@VCS_TAG@/$(git describe --tags)/g
s/@AUTHOR@/$(git show -s --format=%an)/g
s/@AUTHOR_DATE@/$(git show -s --format=%ai)/g
s/@CIMMITER@/$(git show -s --format=%cn)/g
s/@BRANCH@/$TRAVIS_BRANCH/g
s/@COMMITID@/$(git show -s --format=%h)/g
" bintray.json
- set +f
- 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:
secure: FFV8UBcz6GkeSoGRbrL9tnTpVqXoFjFK2QtW0Ml8YvvqaHhxOaIWs2nAabOGsW1mJop/QlpuUNw1TfLl7TokcUDgOHrFRdC8hVY7K1uSWMnt7m4ZRPatVybIkzgrnItHlnMrL4uJK2xXb6Jc5+cSrU5jRMcmTZjaOKLTBwF97+6AgqpdmKUCVYZJzQYg0Jn9GfaL1EOGl7ISt/VEgi/tKFzJvJVxJBU3NuKyxXlfEwkTiSOFuGoD5qWDjCE+aGxTR6RQefsADPIDfeU3TJHTJE/ORGy9gl+Y41JgU0Bfgipcqg1RSwNclclmxgi8lo/XNUiZAMTyQrXjByBWcvYovk+H4h9mbvJlrVSjI8Wxb5ICcYkhDVkNxtEXX7AsIk4yHiNTi1MAW0qJJKinaFxLmK2U3LGEK3DudXl/0eVRoQATmRcXLdBQezISt2CWpTktCxlQmtz/GsoHv0PcWdkJYL4qbbRrBRFj9++VjlnCI124YZnbVjC3+jtWN1Zluxynj0GDBY3r7EdLWWKZo5XnygPOZ8+uaTMYfqmTvQWPc5GRRRdVJowQFQhb48hzKyWYqsf8eyS3VuZ9b/DwES3dutOaX7sIL9Vkg3DlQYOEz938MB4VbTGizUUrBbrIP4Kz/+WOZ9pxM9X+qsgMYkw8FvHqn2TvCWxPDCgqq3zUWig=
file_glob: true
file: deploy/*
skip_cleanup: true
overwrite: true
on:
all_branches: true
tags: true
- provider: bintray
user: $BINTRAY_USER
key: $BINTRAY_KEY
file: bintray.json
skip_cleanup: true
on:
all_branches: true
after_deploy:
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X PATCH "https://api.bintray.com/packages/sdlpal/nightly/$TRAVIS_BRANCH" -H "Content-Type:application/json" -d '{"github_repo":"sdlpal/sdlpal"}'
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X POST "https://api.bintray.com/packages/sdlpal/nightly/$TRAVIS_BRANCH/readme" -H "Content-Type:application/json" -d '{"github":{"github_repo":"sdlpal/sdlpal"}}'
- FILE=$(ls deploy)
- sleep 10
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X PUT "https://api.bintray.com/file_metadata/sdlpal/nightly/$VERSION/$FILE" -H "Content-Type:application/json" -d '{"list_in_downloads":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