-
Notifications
You must be signed in to change notification settings - Fork 3
241 lines (235 loc) · 11.4 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
name: Build-Samples
on: push
jobs:
build-linux:
name: Build Samples for Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y lsb-release wget software-properties-common apt-utils
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update -y
sudo apt remove build-essential -y
sudo apt-get install cmake g++-13 fuse libfuse2 ninja-build vulkan-sdk libgl1-mesa-dev libgtk-3-dev libasound2-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libegl1-mesa-dev libvulkan-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev mesa-common-dev -y --no-install-recommends
- name: Configure
run: |
mkdir -p build
mkdir -p build/linux
cd build/linux
export CC=/usr/bin/gcc-13
export CXX=/usr/bin/g++-13
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DRAVENGINE_BUILD_TESTS=OFF ../..
- name: Build
run: cd build/linux && cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linux64
path: build/linux/Release/*.AppImage
- name: Prepare Transfer upload
run: cd build/linux/Release ; zip -r -9 Samples.zip *.AppImage
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/linux/Release/Samples.zip https://transfer.sh/RavEngine_Samples_linux.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-linux-arm:
name: Build Samples for Linux arm64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Repositories
run: sudo mv config/crosscomp-sources.list /etc/apt/sources.list;
- name: Check apt sources
run: cat /etc/apt/sources.list
- name: Add arm64 as architecture
run: sudo dpkg --add-architecture arm64
- name: Update APT
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
- name: Install Host Dependencies
run: sudo apt-get install cmake:amd64 fuse:amd64 libfuse2:amd64 ninja-build:amd64 libx11-dev:amd64 libgl1-mesa-dev gcc-12:amd64 g++-12:amd64 gcc-12-aarch64-linux-gnu:amd64 g++-12-aarch64-linux-gnu:amd64 -y --no-install-recommends
- name: Install Target Dependencies
run: sudo apt-get install libgl1-mesa-dev:arm64 uuid-dev:arm64 libasound2-dev:arm64 libx11-dev:arm64 libxext-dev:arm64 libxrender-dev:arm64 libxrandr-dev:arm64 libxtst-dev:arm64 libxt-dev:arm64 libegl1-mesa-dev:arm64 libx11-xcb-dev:arm64 libxcb-dri2-0-dev:arm64 libxcb-glx0-dev:arm64 libxcb-icccm4-dev:arm64 libxcb-keysyms1-dev:arm64 libxcb-randr0-dev:arm64 libxrandr-dev:arm64 libxxf86vm-dev:arm64 mesa-common-dev:arm64 libwayland-dev:arm64 -y --no-install-recommends
- name: Configure
run: |
mkdir -p build
mkdir -p build/linuxarm
cd build/linuxarm
CC=/usr/bin/aarch64-linux-gnu-gcc-12 CXX=/usr/bin/aarch64-linux-gnu-g++-12 cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_SYSTEM_NAME=Linux -DRAVENGINE_BUILD_TESTS=OFF ../..
- name: Build
run: cd build/linuxarm && cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_linuxARM
path: build/linuxarm/Release/*.AppImage
- name: Prepare Transfer upload
run: cd build/linuxarm/Release ; zip -r -9 Samples.zip *.AppImage
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/linuxarm/Release/Samples.zip https://transfer.sh/RavEngine_Samples_linuxARM.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-emscripten:
name: Build samples for Emscripten-Linux
runs-on: ubuntu-latest
if: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install cmake clang python3 libgl1-mesa-dev libwayland-dev libxkbcommon-dev libegl-dev -y --no-install-recommends
- name: Setup Emscripten
run: git clone https://github.com/emscripten-core/emsdk.git --depth=1 && cd emsdk && ./emsdk install latest && ./emsdk activate latest && source ./emsdk_env.sh
- name: Configure
run: mkdir -p build && cd build; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ..
- name: Build
run: cd build; cmake --build . --config Release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Web
path: |
build/Release/*.js
build/Release/*.html
build/Release/*.wasm
build/Release/*.data
- name: Prepare Transfer upload
run: cd build/Release ; zip -r -9 Samples.zip *.js *.html *.wasm *.data
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/Release/Samples.zip https://transfer.sh/RavEngine_Samples_Web.zip` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-apple:
name: Build Samples for Apple Platforms (unsigned)
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform: [iOS, tvOS, '']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
with:
xcode-version: "15.3"
- name: Configure
run: |
mkdir -p build
cd build
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=${{ matrix.platform }} -DRAVENGINE_BUILD_TESTS=OFF -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED="NO" ..
- name: Build
run: cd build; cmake --build . --config release --target install -- -quiet
- name: Free space
run: |
cd build
rm -rf build RavEngine host-tools *.build/ release/protoc release/rglc
- name: Create DMG
run: |
cd build
touch release/.Trash
hdiutil create -size 2g -srcfolder release -volname RavEngine_Samples_Apple_${{ matrix.platform }} RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Apple_${{ matrix.platform }}
path: build/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg
- name: Upload to Transfer.sh
run: URL=`curl --upload-file build/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg https://transfer.sh/RavEngine_Samples_Apple_${{ matrix.platform }}.dmg` ; echo "::notice file=.github/workflows/build.yml::$URL" | sed "s/.sh/.sh\/get/g"
continue-on-error: true
build-windows:
name: Build samples for Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, ARM64]
sdk: [Windows]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: |
mkdir build
cd build
mkdir win
cd win
cmake -A${{ matrix.arch }} -DCMAKE_SYSTEM_NAME=${{ matrix.sdk }} -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_BUILD_TYPE=Release -DRAVENGINE_BUILD_TESTS=OFF ..\..
cmake -Wno-dev ..\..
- name: Build
run: cd build; cd win; cmake --build . --config release --target install
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_Win${{ matrix.arch }}
path: |
build\win\release\RavEngine*.exe
build\win\release\RavEngine*.rvedata
build\win\release\D3D12\*
build\win\release\RavEngine*Streaming\*
- name: Prepare Transfer.sh upload
run: Compress-Archive -Path build\win\release\*.exe,build\win\release\*.rvedata,build\win\release\*Streaming\ -DestinationPath Samples${{ matrix.arch }}.zip
- name: Upload to Transfer.sh
run: $URL = Invoke-RestMethod -Uri https://transfer.sh/RavEngine_Samples_Win${{ matrix.arch }}.zip -Method PUT -InFile Samples${{ matrix.arch }}.zip -UseDefaultCredentials ; echo "::notice file=.github/workflows/build.yml::$URL" | %{$_ -replace ".sh",".sh/get"}
continue-on-error: true
build-uwp:
name: Build samples for UWP
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, ARM64]
sdk: [WindowsStore]
steps:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: |
mkdir build
cd build
mkdir uwp
cd uwp
cmake -A${{ matrix.arch }} -DCMAKE_SYSTEM_NAME=${{ matrix.sdk }} -DCMAKE_SYSTEM_VERSION="10.0" -DCMAKE_BUILD_TYPE=Release -Wno-dev -DRAVENGINE_BUILD_TESTS=OFF ..\..
cmake -Wno-dev ..\..;
- name: Build & Publish
run: |
cd build\uwp
& "MSbuild.exe" "RavEngine_Samples_WindowsStore.sln" /p:Configuration=Release /p:AppxBundle=Always /p:AppxBundlePlatforms="${{ matrix.arch }}"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: RavEngine_Samples_${{ matrix.sdk }}_${{ matrix.arch }}
path: build\uwp\AppPackages
- name: Prepare Transfer.sh upload
run: |
Move-Item -Path build\uwp\AppPackages\ -Destination .
Remove-Item -Path build -Recurse
Compress-Archive -Path AppPackages\ -DestinationPath Samples${{ matrix.sdk }}_${{ matrix.arch }}.zip
- name: Upload to Transfer.sh
run: $URL = Invoke-RestMethod -Uri https://transfer.sh/RavEngine_Samples_${{ matrix.sdk }}_${{ matrix.arch }}.zip -Method PUT -InFile Samples${{ matrix.sdk }}_${{ matrix.arch }}.zip -UseDefaultCredentials ; echo "::notice file=.github/workflows/build.yml::$URL" | %{$_ -replace ".sh",".sh/get"}
continue-on-error: true