-
Notifications
You must be signed in to change notification settings - Fork 295
773 lines (773 loc) · 36.3 KB
/
build.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
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
name: Cesium for Unreal
on: [push]
jobs:
QuickChecks:
name: "Quick Checks"
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Check source formatting
run: |
npm install
npm run format -- --dry-run -Werror
Windows50:
uses: ./.github/workflows/buildWindows.yml
with:
unreal-engine-version: "5.0.0"
unreal-runner-label: "unreal-50"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles"
upload-package-base-name: "CesiumForUnreal-50-windows"
secrets: inherit
TestWindows50:
needs: [Windows50]
uses: ./.github/workflows/testWindows.yml
with:
unreal-runner-label: "unreal-50"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Binaries/Win64"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-50-windows"
secrets: inherit
Android50:
runs-on: ["self-hosted","windows","x64","unreal-50"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
$ENV:CESIUM_UNREAL_VERSION=$(git describe)
$ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-50-android-${ENV:CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${ENV:CESIUM_UNREAL_VERSION}" >> $ENV:GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
cd extern
cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-android --config Release --target install -j8
- name: Build plugin
run: |
cd "C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles"
./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Linux50:
runs-on: ["self-hosted","windows","x64","unreal-50"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
$ENV:CESIUM_UNREAL_VERSION=$(git describe)
$ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-50-linux-${ENV:CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${ENV:CESIUM_UNREAL_VERSION}" >> $ENV:GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
$ENV:UNREAL_ENGINE_DIR="C:/Program Files/Epic Games/UE_5.0"
$ENV:LINUX_MULTIARCH_ROOT="C:/UnrealToolchains/v19_clang-11.0.1-centos7/"
$ENV:UNREAL_ENGINE_COMPILER_DIR="${ENV:LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu"
$ENV:UNREAL_ENGINE_LIBCXX_DIR="${ENV:UNREAL_ENGINE_DIR}/Engine/Source/ThirdParty/Unix/LibCxx"
cd extern
cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-from-windows-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target install -j8
- name: Build plugin
run: |
cd "C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles"
./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
macOS50:
runs-on: macos-11
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/5.0.1/macOS/UE501.zip .
unzip -q UE501.zip -d $HOME
rm UE501.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-50-macos-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build
cd extern/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
cmake --build . -j4 --target install
cd ../..
rm -rf extern
- name: Build plugin
run: |
export UNREAL_ENGINE_DIR=$HOME/UE_5.0
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
iOS50:
runs-on: macos-11
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/5.0.1/macOS/UE501.zip .
unzip -q UE501.zip -d $HOME
rm UE501.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-50-ios-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build-ios
cd extern
cmake -B build-ios -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fembed-bitcode" -DCMAKE_C_FLAGS="-fembed-bitcode"
cmake --build build-ios -j 4 --target install --config Release -- -quiet # XCode output maxes out Travis log - Need to make it quiet
cd ..
rm -rf extern
- name: Build plugin
run: |
export UNREAL_ENGINE_DIR=$HOME/UE_5.0
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Combine50:
runs-on: ubuntu-latest
needs: [Windows50, Android50, Linux50, macOS50, iOS50]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-50-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV
- name: Download iOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-50-ios-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download macOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-50-macos-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Android build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-50-android-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Linux build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-50-linux-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Windows build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-50-windows-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Unreal Marketplace Workaround
run: |
# The UE Marketplace deletes our Intermediates directory and fails to produces new
# intermediates for the Linux platform. The Marketplace team has suggested we copy
# them to the LinuxIntermediate directory instead, as a workaround. Users still have
# to move these files to the correct place manually, though, in order for Linux builds
# to succeed.
mkdir -p combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
cp -r combine/CesiumForUnreal/Intermediate/Build/Linux/* combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
- name: Publish combined package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: combine
TestPackage50:
needs: [Combine50]
uses: ./.github/workflows/testPackageOnWindows.yml
with:
unreal-engine-association: "5.0"
unreal-runner-label: "unreal-50"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Binaries/Win64"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.0/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-50"
secrets: inherit
Windows51:
uses: ./.github/workflows/buildWindows.yml
with:
unreal-engine-version: "5.1.0"
unreal-runner-label: "unreal-51"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles"
upload-package-base-name: "CesiumForUnreal-51-windows"
secrets: inherit
TestWindows51:
needs: [Windows51]
uses: ./.github/workflows/testWindows.yml
with:
unreal-runner-label: "unreal-51"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Binaries/Win64"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-51-windows"
secrets: inherit
Android51:
runs-on: ["self-hosted","windows","x64","unreal-51"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
$ENV:CESIUM_UNREAL_VERSION=$(git describe)
$ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-51-android-${ENV:CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${ENV:CESIUM_UNREAL_VERSION}" >> $ENV:GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
cd extern
cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-android --config Release --target install -j8
- name: Build plugin
run: |
((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.0.0"','"EngineVersion": "5.1.0"') | Set-Content -Path CesiumForUnreal.uplugin
cd "C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles"
./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Linux51:
runs-on: ["self-hosted","windows","x64","unreal-51"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
$ENV:CESIUM_UNREAL_VERSION=$(git describe)
$ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-51-linux-${ENV:CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${ENV:CESIUM_UNREAL_VERSION}" >> $ENV:GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
$ENV:UNREAL_ENGINE_DIR="C:/Program Files/Epic Games/UE_5.1"
$ENV:LINUX_MULTIARCH_ROOT="C:/UnrealToolchains/v20_clang-13.0.1-centos7/"
$ENV:UNREAL_ENGINE_COMPILER_DIR="${ENV:LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu"
$ENV:UNREAL_ENGINE_LIBCXX_DIR="${ENV:UNREAL_ENGINE_DIR}/Engine/Source/ThirdParty/Unix/LibCxx"
cd extern
cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-from-windows-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target install -j8
- name: Build plugin
run: |
((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.0.0"','"EngineVersion": "5.1.0"') | Set-Content -Path CesiumForUnreal.uplugin
$ENV:LINUX_MULTIARCH_ROOT="C:/UnrealToolchains/v20_clang-13.0.1-centos7/"
cd "C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles"
./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
macOS51:
runs-on: macos-12
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/5.1.0/macOS/UE_51_macOS.zip .
unzip -q UE_51_macOS.zip -d $HOME
rm UE_51_macOS.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-51-macos-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build
cd extern/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
cmake --build . -j4 --target install
cd ../..
rm -rf extern
- name: Build plugin
run: |
sed -i '' 's/\"EngineVersion\": \"5.0.0\"/\"EngineVersion\": \"5.1.0\"/g' CesiumForUnreal.uplugin
export UNREAL_ENGINE_DIR=$HOME/UE_5.1
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
iOS51:
runs-on: macos-12
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Use Xcode 13
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '^13.4.1'
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/5.1.0/macOS/UE_51_macOS.zip .
unzip -q UE_51_macOS.zip -d $HOME
rm UE_51_macOS.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-51-ios-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build-ios
cd extern
cmake -B build-ios -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fembed-bitcode" -DCMAKE_C_FLAGS="-fembed-bitcode"
cmake --build build-ios -j 4 --target install --config Release -- -quiet # XCode output maxes out Travis log - Need to make it quiet
cd ..
rm -rf extern
- name: Build plugin
run: |
sed -i '' 's/\"EngineVersion\": \"5.0.0\"/\"EngineVersion\": \"5.1.0\"/g' CesiumForUnreal.uplugin
export UNREAL_ENGINE_DIR=$HOME/UE_5.1
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Combine51:
runs-on: ubuntu-latest
needs: [Windows51, Linux51, Android51, macOS51, iOS51]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-51-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV
- name: Download iOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-51-ios-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download macOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-51-macos-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Android build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-51-android-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Linux build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-51-linux-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Windows build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-51-windows-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Unreal Marketplace Workaround
run: |
# The UE Marketplace deletes our Intermediates directory and fails to produces new
# intermediates for the Linux platform. The Marketplace team has suggested we copy
# them to the LinuxIntermediate directory instead, as a workaround. Users still have
# to move these files to the correct place manually, though, in order for Linux builds
# to succeed.
mkdir -p combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
cp -r combine/CesiumForUnreal/Intermediate/Build/Linux/* combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
- name: Publish combined package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: combine
TestPackage51:
needs: [Combine51]
uses: ./.github/workflows/testPackageOnWindows.yml
with:
unreal-engine-association: "5.1"
unreal-runner-label: "unreal-51"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Binaries/Win64"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.1/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-51"
secrets: inherit
Windows52:
uses: ./.github/workflows/buildWindows.yml
with:
unreal-engine-version: "5.2.0"
unreal-runner-label: "unreal-52"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Build/BatchFiles"
upload-package-base-name: "CesiumForUnreal-52-windows"
TestWindows52:
needs: [Windows52]
uses: ./.github/workflows/testWindows.yml
with:
unreal-runner-label: "unreal-52"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Binaries/Win64"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-52-windows"
secrets: inherit
Android52:
runs-on: ["self-hosted","windows","x64","unreal-52"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
$ENV:CESIUM_UNREAL_VERSION=$(git describe)
$ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-52-android-${ENV:CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${ENV:CESIUM_UNREAL_VERSION}" >> $ENV:GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${ENV:BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $ENV:GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
cd extern
cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build-android --config Release --target install -j8
- name: Build plugin
run: |
((Get-Content -path CesiumForUnreal.uplugin -Raw) -replace '"EngineVersion": "5.0.0"','"EngineVersion": "5.2.0"') | Set-Content -Path CesiumForUnreal.uplugin
cd "C:/Program Files/Epic Games/UE_5.2/Engine/Build/BatchFiles"
./RunUAT.bat BuildPlugin -Plugin="$ENV:GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$ENV:GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Android -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Linux52:
runs-on: ["self-hosted","linux","x64","unreal-52"]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-52-linux-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> "$GITHUB_ENV"
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> "$GITHUB_ENV"
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
export UNREAL_ENGINE_DIR="/opt/ue52"
export LINUX_MULTIARCH_ROOT="/opt/ue52/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v21_clang-15.0.1-centos7/"
export UNREAL_ENGINE_COMPILER_DIR="${LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu"
export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_DIR}/Engine/Source/ThirdParty/Unix/LibCxx"
# TODO: Move this to the image instead
export PATH=$PATH:/usr/local/bin
cd extern
cmake -B build -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target install -j8
cd ..
rm -rf extern
- name: Build plugin
run: |
sed -i 's/\"EngineVersion\": \"5.0.0\"/\"EngineVersion\": \"5.2.0\"/g' CesiumForUnreal.uplugin
export LINUX_MULTIARCH_ROOT="/opt/ue52/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v21_clang-15.0.1-centos7/"
cd /opt/ue52/Engine/Build/BatchFiles
# UnrealBuildTool writes to write to ~/.config and loses its mind if it doesn't exist. So create it.
# TODO: move this to the image instead
mkdir -p ~/.config
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux
- name: Fix RPATH
run: |
sudo yum install -y patchelf
cd $GITHUB_WORKSPACE/packages/CesiumForUnreal/Binaries/Linux
patchelf --print-rpath libUnrealEditor-CesiumRuntime.so
export UPDATED_RPATH=`patchelf --print-rpath libUnrealEditor-CesiumRuntime.so | sed 's/${ORIGIN}[^:]*\/SunPosition\/Binaries\/Linux/${ORIGIN}\/..\/..\/..\/..\/Runtime\/SunPosition\/Binaries\/Linux/'`
patchelf --force-rpath --set-rpath "$UPDATED_RPATH" libUnrealEditor-CesiumRuntime.so
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
macOS52:
runs-on: macos-12
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/UE_52_macOS.zip .
unzip -q UE_52_macOS.zip -d $HOME
rm UE_52_macOS.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-52-macos-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build
cd extern/build
INSTALL_LIBDIR=`cmake .. -LA | grep CMAKE_INSTALL_LIBDIR`
INSTALL_LIBDIR=${INSTALL_LIBDIR##CMAKE_INSTALL_LIBDIR:PATH=}
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=arm64
cmake --build . -j4 --target install
mv $INSTALL_LIBDIR ${INSTALL_LIBDIR}-silicon
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build . -j4 --target install
for f in ${INSTALL_LIBDIR}/*.a
do
lipo -create -output $f ${INSTALL_LIBDIR}-silicon/$(basename -- $f) $f
done
rm -r -f ${INSTALL_LIBDIR}-silicon
cd ../..
rm -rf extern
- name: Build plugin
run: |
sed -i '' 's/\"EngineVersion\": \"5.0.0\"/\"EngineVersion\": \"5.2.0\"/g' CesiumForUnreal.uplugin
export UNREAL_ENGINE_DIR=$HOME/UE_5.2
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Mac
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
iOS52:
runs-on: macos-12
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- name: Get Unreal Engine
run: |
aws s3 cp s3://cesium-unreal-engine/UE_52_macOS.zip .
unzip -q UE_52_macOS.zip -d $HOME
rm UE_52_macOS.zip
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-52-ios-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=${CESIUM_UNREAL_VERSION}" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${BUILD_CESIUM_UNREAL_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Install nasm
uses: ilammy/[email protected]
- name: Build cesium-native
run: |
mkdir -p extern/build-ios
cd extern
cmake -B build-ios -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fembed-bitcode" -DCMAKE_C_FLAGS="-fembed-bitcode"
cmake --build build-ios -j 4 --target install --config Release -- -quiet # XCode output maxes out Travis log - Need to make it quiet
cd ..
rm -rf extern
- name: Build plugin
run: |
sed -i '' 's/\"EngineVersion\": \"5.0.0\"/\"EngineVersion\": \"5.2.0\"/g' CesiumForUnreal.uplugin
export UNREAL_ENGINE_DIR=$HOME/UE_5.2
cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=iOS -NoHostPlatform
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages
Combine52:
runs-on: ubuntu-latest
needs: [Windows52, Linux52, Android52, MacOS52, iOS52]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0 # so that `git describe` works.
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$(git describe)
export BUILD_CESIUM_UNREAL_PACKAGE_NAME="CesiumForUnreal-52-${CESIUM_UNREAL_VERSION}"
# Make these available to subsequent steps
echo "CESIUM_UNREAL_VERSION=$CESIUM_UNREAL_VERSION" >> $GITHUB_ENV
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=$BUILD_CESIUM_UNREAL_PACKAGE_NAME" >> $GITHUB_ENV
- name: Download iOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-52-ios-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download macOS build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-52-macos-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Android build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-52-android-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Linux build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-52-linux-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Download Windows build
uses: actions/download-artifact@v3
with:
name: CesiumForUnreal-52-windows-${{ env.CESIUM_UNREAL_VERSION}}
path: combine
- name: Unreal Marketplace Workaround
run: |
# The UE Marketplace deletes our Intermediates directory and fails to produces new
# intermediates for the Linux platform. The Marketplace team has suggested we copy
# them to the LinuxIntermediate directory instead, as a workaround. Users still have
# to move these files to the correct place manually, though, in order for Linux builds
# to succeed.
mkdir -p combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
cp -r combine/CesiumForUnreal/Intermediate/Build/Linux/* combine/CesiumForUnreal/LinuxIntermediate/Build/Linux
- name: Publish combined package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: combine
TestPackage52:
needs: [Combine52]
uses: ./.github/workflows/testPackageOnWindows.yml
with:
unreal-engine-association: "5.2"
unreal-runner-label: "unreal-52"
unreal-binaries-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Binaries/Win64"
unreal-batch-files-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Build/BatchFiles"
unreal-plugins-path: "C:/Program Files/Epic Games/UE_5.2/Engine/Plugins"
test-package-base-name: "CesiumForUnreal-52"
secrets: inherit