forked from etlegacy/etlegacy
-
Notifications
You must be signed in to change notification settings - Fork 0
1114 lines (985 loc) · 42.5 KB
/
build.yml
File metadata and controls
1114 lines (985 loc) · 42.5 KB
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
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ______ _______ _
#| ____| |__ __| | |
#| |__ | | | | ___ __ _ __ _ ___ _ _
#| __| | | | | / _ \ / _` | / _` | / __| | | | |
#| |____ | | | |____ | __/ | (_| | | (_| | | (__ | |_| |
#|______| |_| |______| \___| \__, | \__,_| \___| \__, |
# __/ | __/ |
# |___/ |___/
# 2024 Legacy team
name: ETLBuild
on:
push:
tags:
- "v*"
workflow_dispatch:
schedule:
- cron: "0 0 * * FRI"
jobs:
# Try to figure out the build version information only once
pre-build:
runs-on: ubuntu-latest
outputs:
describe: ${{ steps.git.outputs.describe }}
tag: ${{ steps.git.outputs.tag }}
uid: ${{ steps.git.outputs.uid }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
fetch-tags: true
- name: Fetch git version information
id: git
run: |
git fetch --tags --force
git_describe=$(git describe --abbrev=7 2>/dev/null | awk '{$1=$1};1')
git_tag=$(git describe --abbrev=0 2>/dev/null | awk '{$1=$1};1')
ci_id=$(uuidgen)
echo "Version info: $git_describe ?? $git_tag"
{
echo "describe=$git_describe"
echo "tag=$git_tag"
echo "uid=$ci_id"
} >> "$GITHUB_OUTPUT"
# __ __ _ _ _
# | \/ | | | | | (_)
# | \ / | ___ __| | __ _ ___ _ __ ___ _ __ __ _ | |_ _ ___ _ __
# | |\/| | / _ \ / _` | / _` | / _ \ | '_ \ / _ \ | '__| / _` | | __| | | / _ \ | '_ \
# | | | | | (_) | | (_| | | (_| | | __/ | | | | | __/ | | | (_| | | |_ | | | (_) | | | | |
# |_| |_| \___/ \__,_| \__, | \___| |_| |_| \___| |_| \__,_| \__| |_| \___/ |_| |_|
# __/ |
# |___/
lnx64-mod:
runs-on: ubuntu-24.04
needs: pre-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI_ETL_UID=${{needs.pre-build.outputs.uid}} -e CI=true
run: |
git config --global --add safe.directory /code
./easybuild.sh build -64 -mod
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx64-mod
path: |
build/legacy/cgame*.so
build/legacy/ui*.so
build/legacy/qagame*.so
build/legacy/tvgame*.so
if-no-files-found: error
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: incomplete-mod-pk3
path: build/legacy/legacy_*.pk3
if-no-files-found: error
lnx32-mod:
runs-on: ubuntu-24.04
needs: pre-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI_ETL_UID=${{needs.pre-build.outputs.uid}} -e CI=true
run: |
git config --global --add safe.directory /code
./easybuild.sh build -mod
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx32-mod
path: |
build/legacy/cgame*.so
build/legacy/ui*.so
build/legacy/qagame*.so
build/legacy/tvgame*.so
if-no-files-found: error
lnx-aarch64-mod:
runs-on: ubuntu-24.04
needs: pre-build
container:
image: etlegacy/lnx-aarch64-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./easybuild.sh build -RPIT -mod -ninja
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx-aarch64-mod
path: |
build/legacy/cgame*.so
build/legacy/ui*.so
build/legacy/qagame*.so
build/legacy/tvgame*.so
if-no-files-found: error
osx-mod:
runs-on: macos-14
needs: pre-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Install dependencies
run: brew bundle
- name: List dev tools
run: |
# shellcheck disable=SC2010
ls -la /Applications/ | grep Xcode
ls -la /Library/Developer/CommandLineTools/SDKs/
xcode-select --print-path
xcrun -sdk macosx --show-sdk-path
- name: Build
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Library/Developer/CommandLineTools
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
shell: bash
run: |
./easybuild.sh build -64 -mod --osx=10.10 --osx-arc="x86_64;arm64" -j
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: osx-mod
path: |
build/legacy/cgame_mac
build/legacy/ui_mac
build/legacy/qagame_mac
build/legacy/tvgame_mac
if-no-files-found: error
win-mod:
runs-on: windows-2022
needs: pre-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
shell: cmd
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
run: |
call .\easybuild.bat build -mod
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: win-mod
path: |
build/legacy/cgame*.dll
build/legacy/ui*.dll
build/legacy/qagame*.dll
build/legacy/tvgame*.dll
if-no-files-found: error
win64-mod:
runs-on: windows-2022
needs: pre-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
shell: cmd
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
run: |
call .\easybuild.bat build -mod -64
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: win64-mod
path: |
build/legacy/cgame*.dll
build/legacy/ui*.dll
build/legacy/qagame*.dll
build/legacy/tvgame*.dll
if-no-files-found: error
android-mod:
runs-on: ubuntu-24.04
needs: pre-build
env:
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGN_APK_ALLIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGN_APK_PASS }}
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGN_APK_PASS }}
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
ANDROID_SDK_ROOT: /opt/android-sdk
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4 -Dkotlin.incremental=false
container:
image: etlegacy/android-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
distribution: "temurin"
java-version: "21"
cache: "gradle"
cache-dependency-path: |
**/*.gradle*
app/libs/joystick/**/*.gradle*
- name: Build JoyStick Dependency
working-directory: ./app/libs/joystick
run: |
./gradlew --no-daemon clean --stacktrace --warning-mode all
./gradlew --no-daemon assembleRelease --stacktrace --warning-mode all
./gradlew --no-daemon publishToMavenLocal --stacktrace --warning-mode all
- name: Upload JoyStick Dependency Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: android-joystick-packages
path: "/root/.m2/repository/com/etlegacy/android/joystick/"
if-no-files-found: error
- name: Build Release
if: github.repository == 'etlegacy/etlegacy'
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./gradlew --no-daemon lintDebug testDebugUnitTest --stacktrace --warning-mode all
./gradlew --no-daemon clean assembleRelease --stacktrace --warning-mode all
ls -R
- name: Build Debug
if: github.repository != 'etlegacy/etlegacy'
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./gradlew --no-daemon lintDebug testDebugUnitTest --stacktrace --warning-mode all
./gradlew --no-daemon clean assembleDebug --stacktrace --warning-mode all
ls -R
- name: Prepare artifacts
run: |
set -euo pipefail
for arch in arm64-v8a x86 x86_64; do
for kind in libcgame libui; do
f="$(find app/build/intermediates/merged_native_libs -path "*/out/lib/${arch}/${kind}*.so" -print -quit)"
if [[ -z "${f}" ]]; then
echo "Missing merged native lib ${kind}*.so for ${arch}" >&2
exit 1
fi
mv "${f}" .
done
done
ls -ltrah
- name: Upload arm64-v8a
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: android-arm64-mod
path: |
libcgame*arm64*.so
libui*arm64*.so
if-no-files-found: error
- name: Upload x86
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: android-x86-mod
path: |
libcgame*i386.so
libui*i386.so
if-no-files-found: error
- name: Upload x86_64
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: android-x86_64-mod
path: |
libcgame*x86_64.so
libui*x86_64.so
if-no-files-found: error
# __ __ _
# | \/ | | |
# | \ / | ___ _ __ __ _ ___ _ __ ___ ___ __| | ___
# | |\/| | / _ \ | '__| / _` | / _ \ | '_ ` _ \ / _ \ / _` | / __|
# | | | | | __/ | | | (_| | | __/ | | | | | | | (_) | | (_| | \__ \
# |_| |_| \___| |_| \__, | \___| |_| |_| |_| \___/ \__,_| |___/
# __/ |
# |___/
# Since lnx32 is installing the most, use it as the step that combines all the other steps mod files.
# This step also generates the final packages for 32 bit lnx.
mod-merger:
runs-on: ubuntu-24.04
needs:
[
pre-build,
lnx64-mod,
lnx32-mod,
osx-mod,
win-mod,
win64-mod,
lnx-aarch64-mod,
android-mod,
]
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: incomplete-mod-pk3
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: "*-mod"
path: platforms
merge-multiple: true
- name: Create supported platform manifest
shell: bash
run: |
echo "win_x86 win_x86_64 lnx_x86 lnx_x86_64 macos_x86_64 macos_aarch64 lnx_armv8_64 android_aarch64 android_x86 android_x86_64" > platforms.manifest
- name: Merge mod files
shell: bash
run: |
zip -rvj -MM legacy_*.pk3 platforms.manifest platforms/cgame* platforms/ui* platforms/libcgame* platforms/libui*
- name: Create mod zip
shell: bash
run: |
zip -rvj -MM etlegacy-mod-${{needs.pre-build.outputs.describe}}.zip legacy_*.pk3 platforms/qagame* platforms/tvgame*
- name: Remove old artifacts
uses: geekyeggo/delete-artifact@65041433121f7239077fa20be14c0690f70569de # v4
with:
failOnError: false
name: |
incomplete-mod-pk3
*-mod
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: All-mods
path: legacy_*.pk3
if-no-files-found: error
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: mod-zip
path: etlegacy-mod-*.zip
if-no-files-found: error
# ______ _ _ _
# | ____| (_) | | | |
# | |__ _ _ __ __ _ | | _ __ __ _ ___ | | __ __ _ __ _ ___ ___
# | __| | | | '_ \ / _` | | | | '_ \ / _` | / __| | |/ / / _` | / _` | / _ \ / __|
# | | | | | | | | | (_| | | | | |_) | | (_| | | (__ | < | (_| | | (_| | | __/ \__ \
# |_| |_| |_| |_| \__,_| |_| | .__/ \__,_| \___| |_|\_\ \__,_| \__, | \___| |___/
# | | __/ |
# |_| |___/
# Generate the final packages for Lnx, macOS, Windows and Android
lnx64:
runs-on: ubuntu-24.04
needs: [pre-build, mod-merger]
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI_ETL_UID=${{needs.pre-build.outputs.uid}} -e CI=true
run: |
git config --global --add safe.directory /code
./easybuild.sh build -64
- name: Change Owner of Container Working Directory
run: |
action_name=$(whoami)
action_group=$(groups "$action_name" | awk '{print $3}')
sudo chown "${action_name}:${action_group}" -R .
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: ls -R
working-directory: build/legacy
- name: Generate packages
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI=true
run: |
cd build/
cpack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx64-packages
path: |
build/etlegacy-*.tar.gz
build/etlegacy-*.sh
if-no-files-found: error
lnx32:
runs-on: ubuntu-24.04
needs: [pre-build, mod-merger]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI_ETL_UID=${{needs.pre-build.outputs.uid}} -e CI=true
run: |
git config --global --add safe.directory /code
./easybuild.sh build -32
- name: Change Owner of Container Working Directory
run: |
action_name=$(whoami)
action_group=$(groups "$action_name" | awk '{print $3}')
sudo chown "${action_name}:${action_group}" -R .
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: ls -R
working-directory: build/legacy
- name: Generate packages
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
with:
image: etlegacy/lnx-build:latest
options: -v ${{ github.workspace }}:/code -e CI_ETL_DESCRIBE=${{needs.pre-build.outputs.describe}} -e CI_ETL_TAG=${{needs.pre-build.outputs.tag}} -e CI=true
run: |
cd build/
cpack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx32-packages
path: |
build/etlegacy-*.tar.gz
build/etlegacy-*.sh
if-no-files-found: error
lnx-aarch64:
runs-on: ubuntu-latest
needs: [pre-build, mod-merger]
container:
image: etlegacy/lnx-aarch64-build
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
run: |
./easybuild.sh build -RPIT -ninja
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: ls -R
working-directory: build/legacy
- name: Generate packages
shell: bash
working-directory: build
run: cpack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: lnx-aarch64-packages
path: |
build/etlegacy-*.tar.gz
build/etlegacy-*.sh
if-no-files-found: error
osx:
runs-on: macos-14
needs: [pre-build, mod-merger]
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Install dependencies
run: |
brew bundle
brew install freetype librsvg graphicsmagick imagemagick
- name: Build
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Library/Developer/CommandLineTools
shell: bash
run: |
./easybuild.sh build -64 --osx=10.10 --osx-arc="x86_64;arm64" -j
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: ls -R
working-directory: build/legacy
- name: Generate packages
shell: bash
run: ./easybuild.sh package -64 --osx=10.10 --osx-arc="x86_64;arm64" -j
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: osx-packages
path: |
build/etlegacy-*.tar.gz
build/etlegacy-*.dmg
if-no-files-found: error
win:
runs-on: windows-2022
needs: [pre-build, mod-merger]
outputs:
win: ${{ steps.artifact-upload-step.outputs.artifact-id }}
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
shell: cmd
run: |
call .\easybuild.bat build
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: dir
working-directory: build/legacy
- name: Upload Win etl.exe
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
id: artifact-exe-upload-step
with:
name: win-exe
path: |
build/etl.exe
if-no-files-found: error
- name: SignPath Win Exe Snapshot
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "test-signing"
github-artifact-id: "${{steps.artifact-exe-upload-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: "win-exe"
- name: SignPath Win Exe Release
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: github.ref_type == 'tag'
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "release-signing"
github-artifact-id: "${{steps.artifact-exe-upload-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: "win-exe"
- name: Generate packages
shell: cmd
working-directory: build
run: |
cp D:\a\etlegacy\etlegacy\win-exe\etl.exe .
cpack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
id: artifact-upload-step
with:
name: win-packages
path: |
build/etlegacy-*.exe
build/etlegacy-*.zip
if-no-files-found: error
win64:
runs-on: windows-2022
needs: [pre-build, mod-merger]
outputs:
win64: ${{ steps.artifact-upload-step.outputs.artifact-id }}
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
- name: Build
shell: cmd
run: |
call .\easybuild.bat build -64
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: build/legacy
- name: Display structure of downloaded files
run: dir
working-directory: build/legacy
- name: Upload Win64 etl.exe
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
id: artifact-exe-upload-step
with:
name: win64-exe
path: |
build/etl.exe
if-no-files-found: error
- name: SignPath Win64 Exe Snapshot
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "test-signing"
github-artifact-id: "${{steps.artifact-exe-upload-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: "win64-exe"
- name: SignPath Win64 Exe Release
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: github.ref_type == 'tag'
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "release-signing"
github-artifact-id: "${{steps.artifact-exe-upload-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: "win64-exe"
- name: Generate packages
shell: cmd
working-directory: build
run: |
cp D:\a\etlegacy\etlegacy\win64-exe\etl.exe .
cpack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
id: artifact-upload-step
with:
name: win64-packages
path: |
build/etlegacy-*.exe
build/etlegacy-*.zip
if-no-files-found: error
android:
runs-on: ubuntu-24.04
env:
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGN_APK_ALLIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGN_APK_PASS }}
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGN_APK_PASS }}
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
CI_ETL_UID: ${{needs.pre-build.outputs.uid}}
ANDROID_SDK_ROOT: /opt/android-sdk
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4 -Dkotlin.incremental=false
needs: [pre-build, mod-merger]
container:
image: etlegacy/android-build
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: true
fetch-depth: 0
fetch-tags: true
- name: Setup JDK
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
distribution: "temurin"
java-version: "21"
cache: "gradle"
cache-dependency-path: |
**/*.gradle*
app/libs/joystick/**/*.gradle*
- name: Download JoyStick Dependency Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: android-joystick-packages
path: "/root/.m2/repository/com/etlegacy/android/joystick/"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: All-mods
path: app/src/main/assets
- name: Display structure of downloaded files
run: ls -R
working-directory: app/src/main/assets
- name: Build Release and Generate Package
if: github.repository == 'etlegacy/etlegacy'
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./gradlew --no-daemon lintDebug testDebugUnitTest --stacktrace --warning-mode all
./gradlew --no-daemon clean assembleRelease --stacktrace --warning-mode all
ls -R
- name: Build Debug and Generate Package
if: github.repository != 'etlegacy/etlegacy'
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
./gradlew --no-daemon lintDebug testDebugUnitTest --stacktrace --warning-mode all
./gradlew --no-daemon clean assembleDebug --stacktrace --warning-mode all
ls -R
- name: Rename APK
shell: bash
run: |
shopt -s nullglob globstar
for FILE in ./app/build/outputs/apk/**/*.apk; do mv "$FILE" "${FILE%-*}.apk"; done
ls -R app/build/outputs/apk
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: android-packages
path: app/build/outputs/apk/*/etlegacy*.apk
if-no-files-found: error
# ____ _ ____ _ _
# / ___|(_) __ _ _ __ | _ \ __ _| |_| |__
# \___ \| |/ _` | '_ \| |_) / _` | __| '_ \
# ___) | | (_| | | | | __/ (_| | |_| | | |
# |____/|_|\__, |_| |_|_| \__,_|\__|_| |_|
# |___/
sign:
if: github.repository == 'etlegacy/etlegacy'
runs-on: ubuntu-24.04
needs: [pre-build, win, win64]
steps:
- name: Get version status
id: vars
run: |
echo "hash_exists=$(curl -s -o /dev/null -w "%{http_code}" ${{ secrets.LEGACY_UPLOAD_CHECK_URL }}${{ github.sha }} 2>/dev/null)" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
if: ${{ steps.vars.outputs.hash_exists == '404' }}
with:
pattern: win*
- name: SignPath Win Snapshot
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: ${{ steps.vars.outputs.hash_exists == '404' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "test-signing"
github-artifact-id: "${{needs.win.outputs.win}}"
wait-for-completion: true
output-artifact-directory: "win-packages"
- name: SignPath Win64 Snapshot
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: ${{ steps.vars.outputs.hash_exists == '404' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "test-signing"
github-artifact-id: "${{needs.win64.outputs.win64}}"
wait-for-completion: true
output-artifact-directory: "win64-packages"
- name: SignPath Win Release
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: github.ref_type == 'tag'
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "release-signing"
github-artifact-id: "${{needs.win.outputs.win}}"
wait-for-completion: true
output-artifact-directory: "win-packages"
- name: SignPath Win64 Release
uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3
if: github.ref_type == 'tag'
with:
api-token: "${{ secrets.SIGNPATH_API_TOKEN }}"
organization-id: "${{ secrets.SIGNPATH_ORGANIZATION_ID }}"
project-slug: "etlegacy"
signing-policy-slug: "release-signing"
github-artifact-id: "${{needs.win64.outputs.win64}}"
wait-for-completion: true
output-artifact-directory: "win64-packages"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ steps.vars.outputs.hash_exists == '404' }}
with:
name: win-packages
path: |
win-packages/etlegacy-*-x86.exe
win-packages/etlegacy-*-x86.zip
overwrite: true
if-no-files-found: error
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: ${{ steps.vars.outputs.hash_exists == '404' }}
with:
name: win64-packages
path: |
win64-packages/etlegacy-*-x64.exe
win64-packages/etlegacy-*-x64.zip
overwrite: true
if-no-files-found: error
# _ _ _ _ _ _____ _
# | | | | | | | | | | / ____| | |
# | | | | _ __ | | ___ __ _ __| | __ _ _ __ __| | | | | | ___ __ _ _ __ _ _ _ __
# | | | | | '_ \ | | / _ \ / _` | / _` | / _` | | '_ \ / _` | | | | | / _ \ / _` | | '_ \ | | | | | '_ \
# | |__| | | |_) | | | | (_) | | (_| | | (_| | | (_| | | | | | | (_| | | |____ | | | __/ | (_| | | | | | | |_| | | |_) |
# \____/ | .__/ |_| \___/ \__,_| \__,_| \__,_| |_| |_| \__,_| \_____| |_| \___| \__,_| |_| |_| \__,_| | .__/
# | | | |
# |_| |_|
upload:
runs-on: ubuntu-24.04
needs: [pre-build, sign, lnx32, lnx64, osx, lnx-aarch64, android]
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: geekyeggo/delete-artifact@65041433121f7239077fa20be14c0690f70569de # v4
with:
name: |
All-mods
- name: Get version status
id: vars
run: |
echo "hash_exists=$(curl -s -o /dev/null -w "%{http_code}" ${{ secrets.LEGACY_UPLOAD_CHECK_URL }}${{ github.sha }} 2>/dev/null)" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
if: ${{ steps.vars.outputs.hash_exists == '404' }}
with:
path: packages
- name: Register version
if: ${{ steps.vars.outputs.hash_exists == '404' }}
run: |
curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -F"sha=${{ github.sha }}" -F"uid=${{needs.pre-build.outputs.uid}}" -F"desc=${{needs.pre-build.outputs.describe}}" ${{ secrets.LEGACY_VERSION_REGISTER_URL }}
- name: Upload packages
if: ${{ steps.vars.outputs.hash_exists == '404' }}
shell: bash
working-directory: packages
run: |
find lnx64-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=ouJ8LoD4tpFE" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find lnx32-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=3Eib0F0HiVcY" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find osx-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=zrm0gXDJ0vvQ" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find win-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=qkKkqKmiKHul" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find win64-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=1EM7l2e6pqpA" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find android-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=pqxx51ioaosg" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find lnx-aarch64-packages/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=r3tqepamenlf" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
find mod-zip/ -name '*' -type f -exec curl --fail -H "Authorization: Bearer ${{ secrets.LEGACY_AUTH }}" -X POST -H "Content-Type: multipart/form-data" -F "data=@{}" -F "upload_id=eacan4jn14wt" -F"sha=${{ github.sha }}" ${{ secrets.LEGACY_UPLOAD_URL }} \;
- name: Discord notification
if: ${{ steps.vars.outputs.hash_exists == '404' && needs.pre-build.outputs.describe != needs.pre-build.outputs.tag }}
env:
DISCORD_WEBHOOK: ${{ secrets.PUBLISH_DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # 0.3.2
with:
args: "<@&673533235887865879> Build from ETLegacy: ${{ needs.pre-build.outputs.describe }} (${{ github.sha }}) has been published.\nDownload at: https://www.etlegacy.com/workflow-files"
docker:
runs-on: ubuntu-24.04
needs: [pre-build, upload] # only upload to docker if the upload to the site was successfully completed
# only run on main/master default branch
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
env:
CI_ETL_DESCRIBE: ${{needs.pre-build.outputs.describe}}
CI_ETL_TAG: ${{needs.pre-build.outputs.tag}}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
submodules: false
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4