-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
675 lines (604 loc) · 14.8 KB
/
.gitlab-ci.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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
stages:
- prepare
- build
- combine
- pack
- deploy
variables:
GIT_DEPTH: "1"
mat_common:
stage: prepare
tags:
- linux
script:
# lua
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/lua-5.4.4.tar.gz | tar zfx -
- mv lua-5.4.4 lua
# sqlite3
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/sqlite-autoconf-3390300.tar.gz | tar zfx -
- mv sqlite-autoconf-3390300 sqlite3
# freetype
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/freetype-2.11.1.tar.gz | tar zfx -
- mv freetype-2.11.1 freetype
# premake
- cp -rf premake/* .;
artifacts:
paths:
- lua
- freetype
- sqlite3
mat_submodules:
stage: prepare
tags:
- linux
script:
- rm -rf ocgcore script
- mkdir ocgcore script
- git config --global --add safe.directory $CI_PROJECT_DIR
- git submodule update --init
artifacts:
paths:
- ocgcore
- script
mat_irrklang:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install git
- mkdir -p ~/.ssh; chmod 700 ~/.ssh; echo "$NANAHIRA_SSH_KEY" | base64 --decode > ~/.ssh/id_rsa; chmod 600 ~/.ssh/id_rsa
- ssh-keyscan git.mycard.moe >> ~/.ssh/known_hosts
- git clone --depth=1 [email protected]:nanahira/irrklang
#- mv -f irrklang/plugins/ikpmp3 .
artifacts:
paths:
- irrklang
- ikpmp3
mat_linux:
stage: prepare
tags:
- linux
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
script:
- apt update; apt -y install git wget tar
- git clone --depth=1 https://code.mycard.moe/mycard/irrlicht-new irrlicht
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta2-linux.tar.gz | tar zfx -
- env PROCESSOR_COUNT=$(nproc) ./.ci/libevent-prebuild.sh
artifacts:
paths:
- premake5
- irrlicht
- libevent-stable
#mat_macos_irrklang_patched:
# stage: build
# tags:
# - linux
# dependencies: []
# script:
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libirrklang-patched-dylib.tar.gz | tar zfx -
# artifacts:
# paths:
# - libirrklang-patched.dylib
mat_macos:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta2-macosx.tar.gz | tar zfx -
# - wget -O - https://cdn01.moecube.com/ygopro-build-materials/libirrklang-patched-dylib.tar.gz | tar zfx -
- mkdir irrlicht
- cd irrlicht
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/irrlicht-mycard-mac.tar.gz | tar zfx -
- cd ..
artifacts:
paths:
- premake5
- irrlicht
mat_windows:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install wget tar patch p7zip-full
# premake5.exe
- wget https://cdn01.moecube.com/ygopro-build-materials/premake-5.0.0-beta2-windows.zip
- 7z x -y premake-5.0.0-beta2-windows.zip
# event
- wget -O - https://cdn01.moecube.com/ygopro-build-materials/libevent-2.0.22-stable.tar.gz | tar zfx -
- mv libevent-2.0.22-stable event
# irrlicht
- git clone --depth=1 -b develop https://code.mycard.moe/mycard/irrlicht-new irrlicht
artifacts:
paths:
- premake5.exe
- event
- irrlicht
._exec_build:
stage: build
variables:
NO_LUA_SAFE: '1' # on client no lua safe
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- bin/
- obj/
exec_windows:
extends: ._exec_build
tags:
- vs
dependencies:
- mat_common
- mat_irrklang
- mat_windows
- mat_submodules
script:
- bash -c 'cp -rf premake/* .'
- '.\premake5.exe vs2019 --irrklang-pro'
- cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
- copy bin\release\ygopro.exe .
artifacts:
paths:
- ygopro.exe
exec_linux:
extends: ._exec_build
tags:
- linux
image: git-registry.mycard.moe/mycard/docker-runner-base:debian11
dependencies:
- mat_common
- mat_irrklang
- mat_linux
- mat_submodules
script:
- apt update; apt -y install git build-essential libgl1-mesa-dev libglu-dev libxxf86vm-dev
- mkdir lib
- cp -rf irrklang/bin/linux-gcc-64/libIrrKlang.so ./lib/
# - cp -rf irrklang/bin/linux-gcc-64/ikpMP3.so ./lib/
- export EVENT_INCLUDE_DIR=$PWD/libevent-stable/include
- export EVENT_LIB_DIR=$PWD/libevent-stable/lib
- ./premake5 gmake --build-freetype --build-sqlite --build-irrlicht --build-ikpmp3 --irrklang-pro
- cd build
- make config=release -j$(nproc)
- cd ..
- mv bin/release/YGOPro ./ygopro
- strip ygopro
artifacts:
paths:
- ygopro
- lib
._exec_macos_platform:
extends: ._exec_build
dependencies:
- mat_macos
- mat_common
- mat_submodules
script:
- ./.ci/exec-macos-platform.sh
artifacts:
paths:
- ygopro-platforms
exec_macos_platform_x86:
extends: ._exec_macos_platform
tags:
- macos
exec_macos_platform_m1:
extends: ._exec_macos_platform
tags:
- macos-m1
variables:
MAC_ARM: 1
exec_macos:
stage: combine
tags:
- macos
dependencies:
- exec_macos_platform_x86
- exec_macos_platform_m1
#- mat_macos_irrklang_patched
script:
- mkdir -p ygopro.app/Contents/MacOS ygopro.app/Contents/Frameworks;
- lipo -create -output ygopro.app/Contents/MacOS/ygopro $(ls -1 ygopro-platforms/ygopro-platform-*);
# do some special things for irrklang
#- mv ./libirrklang-patched.dylib ygopro.app/Contents/Frameworks/libirrklang.dylib
#- install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/../Frameworks/libirrklang.dylib ygopro.app/Contents/MacOS/ygopro
#- dylibbundler -x ygopro.app/Contents/MacOS/ygopro -b -d ygopro.app/Contents/Frameworks/ -p @executable_path/../Frameworks/ -cd -i @executable_path/../Frameworks;
#- strip ygopro.app/Contents/MacOS/ygopro;
- mkdir ygopro.app/Contents/Resources;
- mv premake/gframe/ygopro.icns ygopro.app/Contents/Resources/Icon.icns;
- defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIconFile" "Icon.icns";
- defaults write "$PWD/ygopro.app/Contents/Info.plist" "CFBundleIdentifier" "moe.mycard.ygopro";
artifacts:
paths:
- ygopro.app
#exec_macos_sign:
# stage: sign
# tags:
# - macos
# dependencies:
# - exec_macos
# script: ./.ci/sign-macos.sh
# artifacts:
# paths:
# - ygopro.app
# only:
# - tags
# - master
assets:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install tar wget git
# starter pack
- wget -O - https://code.mycard.moe/mycard/ygopro-starter-pack/-/archive/master/ygopro-starter-pack-master.tar.gz | tar zfx -
- mv ygopro-starter-pack-master/* .
# sound
- wget -O - https://code.mycard.moe/mycard/ygopro-sounds/-/archive/master/ygopro-sounds-master.tar.gz | tar zfx -
- mv ygopro-sounds-master/sound/* sound
# fonts
- mkdir fonts
- cd fonts
- wget -O - https://cdn01.moecube.com/ygopro-fonts.tar.gz | tar zfx -
- cd ..
# pack
- git clone --depth=1 https://code.mycard.moe/mycard/ygopro-card-list
- mv ygopro-card-list/pack .
# locales
- git clone --depth=1 https://code.mycard.moe/nanahira/ygopro-database
- mv ygopro-database/locales .
artifacts:
paths:
- deck
- single
- sound
- fonts
- pack
- locales
only:
- tags
- master
assets_nonwindows:
stage: prepare
tags:
- linux
script:
- apt update; apt -y install tar wget
- wget -O - https://cdn01.moecube.com/windbot/windbot.tar.gz | tar zfx -
artifacts:
paths:
- bot.conf
- windbot
- bot
only:
- tags
- master
assets_windows:
stage: prepare
tags:
- linux
script:
- wget https://cdn01.moecube.com/windbot/WindBot.7z
- 7z x -y WindBot.7z
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync s3://mycard/koishipro/contents/update-koishipro/ ./update-koishipro
- rm -rf update-koishipro/.git || true
artifacts:
paths:
- bot.conf
- WindBot
- Bot.exe
- update-koishipro
only:
- tags
- master
._locale_zh-CN:
variables:
TARGET_LOCALE: zh-CN
._locale_en-US:
variables:
TARGET_LOCALE: en-US
._assets_locale:
stage: build
tags:
- linux
script: ./.ci/assets-locale.sh
artifacts:
paths:
- pics
- cards.cdb
- strings.conf
- bot.conf
only:
- tags
- master
assets_zh-CN:
extends:
- ._assets_locale
- ._locale_zh-CN
assets_en-US:
extends:
- ._assets_locale
- ._locale_en-US
._pack:
stage: pack
tags:
- linux
artifacts:
paths:
- dist
only:
- tags
- master
._pack_format_gz:
extends: ._pack
variables:
ARCHIVE_SUFFIX: gz
._pack_format_zst:
extends: ._pack
variables:
ARCHIVE_SUFFIX: zst
._pack_dlc:
extends: ._pack_format_zst
only:
- tags
._pack_script_windows_non7z:
extends: ._pack
script: ./.ci/pack-windows.sh
._pack_script_windows_7z:
extends: ._pack
script: ./.ci/pack-windows-7z.sh
._pack_script_linux:
extends: ._pack
script: ./.ci/pack-linux.sh
._pack_script_macos:
extends: ._pack
script: ./.ci/pack-macos.sh
._pack_script_windows_dlc:
extends: ._pack_dlc
script: ./.ci/pack-windows-dlc.sh
._pack_script_linux_dlc:
extends: ._pack_dlc
script: ./.ci/pack-linux-dlc.sh
._pack_script_macos_dlc:
extends: ._pack_dlc
script: ./.ci/pack-macos-dlc.sh
._pack_assets_windows_zh-CN:
extends: ._pack
dependencies:
- assets
- assets_windows
- exec_windows
- assets_zh-CN
- mat_submodules
._pack_assets_linux_zh-CN:
extends: ._pack
dependencies:
- assets
- assets_nonwindows
- exec_linux
- assets_zh-CN
- mat_submodules
._pack_assets_macos_zh-CN:
extends: ._pack
dependencies:
- assets
- assets_nonwindows
- exec_macos
- assets_zh-CN
- mat_submodules
._pack_assets_windows_en-US:
extends: ._pack
dependencies:
- assets
- assets_windows
- exec_windows
- assets_en-US
- mat_submodules
._pack_assets_linux_en-US:
extends: ._pack
dependencies:
- assets
- assets_nonwindows
- exec_linux
- assets_en-US
- mat_submodules
._pack_assets_macos_en-US:
extends: ._pack
dependencies:
- assets
- assets_nonwindows
- exec_macos
- assets_en-US
- mat_submodules
._pack_assets_windows_dlc:
extends: ._pack
dependencies:
- assets
- exec_windows
- mat_submodules
._pack_assets_linux_dlc:
extends: ._pack
dependencies:
- assets
- exec_linux
- mat_submodules
._pack_assets_macos_dlc:
extends: ._pack
dependencies:
- assets
- exec_macos
- mat_submodules
pack_windows_dlc_zh-CN:
extends:
- ._pack_assets_windows_dlc
- ._pack_script_windows_dlc
- ._locale_zh-CN
pack_linux_dlc_zh-CN:
extends:
- ._pack_assets_linux_dlc
- ._pack_script_linux_dlc
- ._locale_zh-CN
pack_macos_dlc_zh-CN:
extends:
- ._pack_assets_macos_dlc
- ._pack_script_macos_dlc
- ._locale_zh-CN
pack_windows_dlc_en-US:
extends:
- ._pack_assets_windows_dlc
- ._pack_script_windows_dlc
- ._locale_en-US
pack_linux_dlc_en-US:
extends:
- ._pack_assets_linux_dlc
- ._pack_script_linux_dlc
- ._locale_en-US
pack_macos_dlc_en-US:
extends:
- ._pack_assets_macos_dlc
- ._pack_script_macos_dlc
- ._locale_en-US
pack_windows_zh-CN_7z:
extends:
- ._pack_assets_windows_zh-CN
- ._pack_script_windows_7z
- ._locale_zh-CN
#pack_windows_zh-CN_gz:
# extends:
# - ._pack_assets_windows_zh-CN
# - ._pack_script_windows_non7z
# - ._pack_format_gz
# - ._locale_zh-CN
#pack_windows_zh-CN_zst:
# extends:
# - ._pack_assets_windows_zh-CN
# - ._pack_script_windows_non7z
# - ._pack_format_zst
# - ._locale_zh-CN
pack_linux_zh-CN_gz:
extends:
- ._pack_assets_linux_zh-CN
- ._pack_script_linux
- ._pack_format_gz
- ._locale_zh-CN
#pack_linux_zh-CN_zst:
# extends:
# - ._pack_assets_linux_zh-CN
# - ._pack_script_linux
# - ._pack_format_zst
# - ._locale_zh-CN
pack_macos_zh-CN_gz:
extends:
- ._pack_assets_macos_zh-CN
- ._pack_script_macos
- ._pack_format_gz
- ._locale_zh-CN
#pack_macos_zh-CN_zst:
# extends:
# - ._pack_assets_macos_zh-CN
# - ._pack_script_macos
# - ._pack_format_zst
# - ._locale_zh-CN
pack_windows_en-US_7z:
extends:
- ._pack_assets_windows_en-US
- ._pack_script_windows_7z
- ._locale_en-US
#pack_windows_en-US_gz:
# extends:
# - ._pack_assets_windows_en-US
# - ._pack_script_windows_non7z
# - ._pack_format_gz
# - ._locale_en-US
#pack_windows_en-US_zst:
# extends:
# - ._pack_assets_windows_en-US
# - ._pack_script_windows_non7z
# - ._pack_format_zst
# - ._locale_en-US
pack_linux_en-US_gz:
extends:
- ._pack_assets_linux_en-US
- ._pack_script_linux
- ._pack_format_gz
- ._locale_en-US
#pack_linux_en-US_zst:
# extends:
# - ._pack_assets_linux_en-US
# - ._pack_script_linux
# - ._pack_format_zst
# - ._locale_en-US
pack_macos_en-US_gz:
extends:
- ._pack_assets_macos_en-US
- ._pack_script_macos
- ._pack_format_gz
- ._locale_en-US
#pack_macos_en-US_zst:
# extends:
# - ._pack_assets_macos_en-US
# - ._pack_script_macos
# - ._pack_format_zst
# - ._locale_en-US
upload_contents:
stage: deploy
dependencies:
- pack_windows_zh-CN_7z
tags:
- linux
script:
- 7z x -y -ocontents dist/KoishiPro-$CI_COMMIT_REF_NAME-win32-zh-CN.7z
- cd contents/update-koishipro
- chmod +x *.sh
- mono update.exe -ci
- sed -i "/git/d" filelist.txt
- cd ../..
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete contents/ s3://mycard/koishipro/contents/
only:
- master
upload_to_minio:
stage: deploy
dependencies:
- pack_windows_zh-CN_7z
#- pack_windows_zh-CN_gz
#- pack_windows_zh-CN_zst
- pack_linux_zh-CN_gz
#- pack_linux_zh-CN_zst
- pack_macos_zh-CN_gz
#- pack_macos_zh-CN_zst
- pack_windows_en-US_7z
#- pack_windows_en-US_gz
#- pack_windows_en-US_zst
- pack_linux_en-US_gz
#- pack_linux_en-US_zst
- pack_macos_en-US_gz
#- pack_macos_en-US_zst
- pack_windows_dlc_zh-CN
- pack_linux_dlc_zh-CN
- pack_macos_dlc_zh-CN
- pack_windows_dlc_en-US
- pack_linux_dlc_en-US
- pack_macos_dlc_en-US
tags:
- linux
script:
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync dist/ s3://mycard/koishipro/archive
only:
- tags
- master
upload_mycard:
stage: deploy
dependencies:
- pack_windows_dlc_zh-CN
- pack_linux_dlc_zh-CN
- pack_macos_dlc_zh-CN
- pack_windows_dlc_en-US
- pack_linux_dlc_en-US
- pack_macos_dlc_en-US
tags:
- linux
variables:
appVersion: $CI_COMMIT_TAG
script: ./.ci/upload-packager.sh
only:
- tags