-
Notifications
You must be signed in to change notification settings - Fork 297
117 lines (116 loc) · 6.48 KB
/
buildLinux.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
name: Build Linux
on:
workflow_call:
inputs:
runner-label:
required: true
type: string
unreal-engine-version:
required: true
type: string
unreal-engine-zip:
required: true
type: string
unreal-program-name:
required: true
type: string
upload-package-base-name:
required: true
type: string
extra-choco-packages:
required: false
type: string
default: ''
clang-version:
required: true
type: string
jobs:
build:
runs-on: ${{ inputs.runner-label }}
steps:
- name: Display system info
run: |
sudo swapon --show
cat /proc/meminfo
apt list --installed
sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
sudo snap list
- name: Removed unneeded packages to gain disk space
run: |
sudo apt update
sudo apt remove google-chrome-stable clang-13 clang-14 clang-15 llvm-13-dev llvm-13-linker-tools llvm-13-runtime llvm-13-tools llvm-13 llvm-14-dev llvm-14-linker-tools llvm-14-runtime llvm-14-tools llvm-14 llvm-15-dev llvm-15-linker-tools llvm-15-runtime llvm-15-tools llvm-15 x11-common xserver-common aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 aspnetcore-runtime-8.0 aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 aspnetcore-targeting-pack-8.0 docker-ce-cli docker-ce dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-apphost-pack-8.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-hostfxr-8.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-8.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-runtime-deps-8.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 dotnet-targeting-pack-8.0 eatmydata emacsen-common firebird3.0-common-doc firebird3.0-common firefox kubectl mercurial-common mercurial microsoft-edge-stable mssql-tools mysql-client-8.0 mysql-client-core-8.0 mysql-client mysql-common mysql-server-8.0 php8.1 postgresql-14 azure-cli microsoft-edge-stable google-cloud-cli temurin-21-jdk temurin-17-jdk temurin-11-jdk temurin-8-jdk powershell google-cloud-cli-anthoscli mysql-server-core-8.0 containerd.io libllvm15 libllvm14 libllvm13 mono-devel libclang-common-15-dev libclang-common-14-dev libclang-common-13-dev
df -h
- name: Create some space to work in /mnt
run: |
sudo mkdir /mnt/work
sudo chown $(whoami) /mnt/work
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure vcpkg caching
uses: ./.github/actions/vcpkg-cache
with:
id: ${{ inputs.upload-package-base-name }}
- name: Install Unreal Engine
uses: ./.github/actions/install-unreal-linux
with:
unreal-engine-zip: ${{ inputs.unreal-engine-zip }}
unreal-program-name: ${{ inputs.unreal-program-name }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install nasm
uses: ilammy/[email protected]
- name: Install Ninja and patchelf
run: |
sudo apt install -y ninja-build patchelf
- name: Set environment variables
run: |
echo "CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME" >> "$GITHUB_ENV"
echo "BUILD_CESIUM_UNREAL_PACKAGE_NAME=${{ inputs.upload-package-base-name }}-$GITHUB_REF_NAME" >> "$GITHUB_ENV"
echo "UNREAL_ENGINE_ROOT=/mnt/work/${{ inputs.unreal-program-name }}" >> "$GITHUB_ENV"
echo "LINUX_MULTIARCH_ROOT=/mnt/work/${{ inputs.unreal-program-name }}/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/${{ inputs.clang-version }}/" >> "$GITHUB_ENV"
- name: Build cesium-native
run: |
export UNREAL_ENGINE_COMPILER_DIR="${LINUX_MULTIARCH_ROOT}x86_64-unknown-linux-gnu"
export UNREAL_ENGINE_LIBCXX_DIR="${UNREAL_ENGINE_ROOT}/Engine/Source/ThirdParty/Unix/LibCxx"
export CESIUM_VCPKG_RELEASE_ONLY=TRUE
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: Make more swap space available
run: |
sudo swapoff -a
sudo fallocate -l 10G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
sudo swapon --show
- name: Customize BuildConfiguration.xml
run: |
mkdir -p ~/.config/Unreal\ Engine/UnrealBuildTool
# - We limit parallel actions because our builds use a lot more memory than UBT thinks they will.
# - We set the source code control Provider to None so UBT includes all files in the unity build.
printf '<?xml version="1.0" encoding="utf-8" ?>\n<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">\n <BuildConfiguration>\n <MaxParallelActions>2</MaxParallelActions>\n </BuildConfiguration>\n <SourceFileWorkingSet><Provider>None</Provider></SourceFileWorkingSet>\n</Configuration>\n' > ~/.config/Unreal\ Engine/UnrealBuildTool/BuildConfiguration.xml
- name: Build plugin
run: |
sed -i 's/\"EngineVersion\": \"5.3.0\"/\"EngineVersion\": \"${{ inputs.unreal-engine-version }}\"/g' CesiumForUnreal.uplugin
cd $UNREAL_ENGINE_ROOT/Engine/Build/BatchFiles
./RunUAT.sh BuildPlugin -Plugin="$GITHUB_WORKSPACE/CesiumForUnreal.uplugin" -Package="$GITHUB_WORKSPACE/packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux
- name: Fix RPATH
run: |
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: Print disk space free
run: |
df -h
- name: Publish plugin package artifact
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_CESIUM_UNREAL_PACKAGE_NAME}}
path: packages