-
Notifications
You must be signed in to change notification settings - Fork 6
335 lines (300 loc) · 12.3 KB
/
windows_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
name: 🏁 Windows Builds
on:
push:
branches:
- 'main'
pull_request:
env:
GODOT_VERSION: "4.2.1"
jobs:
build-ffmpeg:
runs-on: "ubuntu-20.04"
name: Build FFmpeg (${{ matrix.name }})
strategy:
matrix:
include:
- name: 32 Bits
cache_key: x86_32
arch: win32
- name: 64 Bits
cache_key: x86_64
arch: win64
steps:
- name: "Check cached build"
id: "cache_ffmpeg"
uses: actions/cache@v4
with:
path: cached_builds/ffmpeg
key: Windows-${{ matrix.cache_key }}-ffmpeg-build
restore-keys: Windows-${{ matrix.cache_key }}-ffmpeg-build
lookup-only: true
save-always: true
continue-on-error: true
- name: "Checkout FFmpeg"
if: steps.cache_ffmpeg.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: retrohub-org/FFmpeg-Builds
path: "ffmpeg"
- name: "Free space"
if: steps.cache_ffmpeg.outputs.cache-hit != 'true'
run: |
df -h
sudo apt-get clean
docker system prune -a -f
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: "Compilation"
if: steps.cache_ffmpeg.outputs.cache-hit != 'true'
working-directory: ./ffmpeg
run: |
./makeimage.sh ${{ matrix.arch }} lgpl-godot 6.0
./build.sh ${{ matrix.arch }} lgpl-godot 6.0
mkdir -p -v ../cached_builds/ffmpeg
tar -xvf artifacts/ffmpeg*${{ matrix.arch }}-lgpl-godot-6.0.tar.xz --directory=../cached_builds/ffmpeg --strip-components=1
ls -la ../cached_builds/ffmpeg
build-eirteam_ffmpeg:
runs-on: "windows-latest"
name: Build EIRTeam.FFmpeg (${{ matrix.name }})
needs: [build-ffmpeg]
strategy:
matrix:
include:
- name: 32 Bits
cache_key: x86_32
arch: x86_32
eirteam_arch: win32
- name: 64 Bits
cache_key: x86_64
arch: x86_64
eirteam_arch: win64
steps:
- name: "Check cached build"
uses: actions/cache@v4
id: "cache_eirteam_ffmpeg"
with:
path: cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_arch }}
key: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build
restore-keys: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build
lookup-only: true
save-always: true
enableCrossOsArchive: true
continue-on-error: true
- name: "Load FFmpeg build"
id: "cache_ffmpeg"
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: cached_builds/ffmpeg
key: Windows-${{ matrix.cache_key }}-ffmpeg-build
restore-keys: Windows-${{ matrix.cache_key }}-ffmpeg-build
fail-on-cache-miss: true
enableCrossOsArchive: true
continue-on-error: false
- name: "Checkout EIRTeam.FFmpeg"
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: retrohub-org/EIRTeam.FFmpeg
submodules: recursive
path: "eirteam_ffmpeg"
- name: "Install dependencies"
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true'
run: |
python -m pip install scons==4.4.0
- name: "Compilation"
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true'
working-directory: ./eirteam_ffmpeg
run: |
New-Item thirdparty -ItemType Directory -Force -ea 0
Move-Item -Path ../cached_builds/ffmpeg -Destination thirdparty
cd gdextension_build
scons arch=${{ matrix.arch }} verbose=yes target=template_release
scons arch=${{ matrix.arch }} verbose=yes target=template_debug
New-Item ../../cached_builds/eirteam_ffmpeg -ItemType Directory -Force -ea 0
Copy-Item -Path build/addons/ffmpeg/${{ matrix.eirteam_arch }} -Destination ../../cached_builds/eirteam_ffmpeg -Recurse
build-godot:
runs-on: "ubuntu-20.04"
name: Build Godot (${{ matrix.name }})
strategy:
matrix:
include:
- name: 32 Bits
cache_key: x86_32
arch: x86_32
bin_template: godot.windows.template_release.x86_32.exe
bin_editor: godot.linuxbsd.editor.x86_32
template: godot_32.exe
- name: 64 Bits
cache_key: x86_64
arch: x86_64
bin_template: godot.windows.template_release.x86_64.exe
bin_editor: godot.linuxbsd.editor.x86_64
template: godot_64.exe
steps:
- name: "Check cached build"
uses: actions/cache@v4
id: "cache_godot"
with:
path: |
cached_builds/editor/godot
cached_builds/template/${{ matrix.template }}
key: Windows-${{ matrix.cache_key }}-godot-build
restore-keys: Windows-${{ matrix.cache_key }}-godot-build
lookup-only: true
save-always: true
enableCrossOsArchive: true
continue-on-error: true
- name: "Checkout Custom Godot"
if: steps.cache_godot.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: retrohub-org/godot
ref: retrohub_patches_4x
path: "godot"
- name: "Install dependencies"
if: steps.cache_godot.outputs.cache-hit != 'true'
working-directory: ./godot
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get install -qq mesa-vulkan-drivers
sudo dpkg --add-architecture i386
sudo apt-get update
# The actual dependencies
sudo apt-get install build-essential gcc-multilib g++-multilib pkg-config libc6-dev-i386 libx11-dev libx11-dev:i386 \
libxcursor-dev libxcursor-dev:i386 libxinerama-dev libxinerama-dev:i386 libx11-dev:i386 libgl1-mesa-dev \
libgl1-mesa-dev:i386 libglu-dev libasound2-dev libpulse-dev libdbus-1-dev libudev-dev libxi-dev \
libxi-dev:i386 libxrandr-dev libxrandr-dev:i386 yasm xvfb wget unzip mingw-w64
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: "Setup Godot build cache"
if: steps.cache_godot.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-cache
with:
cache-name: windows-template
continue-on-error: true
- name: "Setup python and scons"
if: steps.cache_godot.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-deps
- name: "Compilation [editor]"
if: steps.cache_godot.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes werror=no production=yes arch=${{ matrix.arch }}
platform: linuxbsd
target: editor
- name: "Compilation [template]"
if: steps.cache_godot.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=no use_lto=yes optimize=size arch=${{ matrix.arch }}
platform: windows
target: template_release
- name: "Clean and cache template build"
if: steps.cache_godot.outputs.cache-hit != 'true'
run: |
mkdir -p -v cached_builds/editor
mkdir -p -v cached_builds/template
mv godot/bin/${{ matrix.bin_editor }} cached_builds/editor/godot
mv godot/bin/${{ matrix.bin_template }} cached_builds/template/${{ matrix.template }}
build-retrohub:
runs-on: "ubuntu-20.04"
name: Build RetroHub (${{ matrix.name }})
needs: [build-godot, build-eirteam_ffmpeg]
strategy:
matrix:
include:
- name: 32 Bits
cache_key: x86_32
arch: x86_32
template: godot_32.exe
eirteam_ffmpeg: win32
eirteam_ffmpeg_editor: linux32
- name: 64 Bits
cache_key: x86_64
arch: x86_64
template: godot_64.exe
eirteam_ffmpeg: win64
eirteam_ffmpeg_editor: linux64
steps:
- name: "Load EIRTeam.FFmpeg build"
uses: actions/cache@v4
id: "cache_eirteam_ffmpeg"
with:
path: cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg }}
key: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build
restore-keys: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build
fail-on-cache-miss: true
enableCrossOsArchive: true
continue-on-error: false
- name: "Load EIRTeam.FFmpeg build (for editor)"
uses: actions/cache@v4
id: "cache_eirteam_ffmpeg_linux"
with:
path: cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg_editor }}
key: Linux-${{ matrix.cache_key }}-eirteam_ffmpeg-build
restore-keys: Linux-${{ matrix.cache_key }}-eirteam_ffmpeg-build
enableCrossOsArchive: true
continue-on-error: true
- name: "Load Godot builds"
uses: actions/cache@v4
id: "cache_godot"
with:
path: |
cached_builds/editor/godot
cached_builds/template/${{ matrix.template }}
key: Windows-${{ matrix.cache_key }}-godot-build
restore-keys: Windows-${{ matrix.cache_key }}-godot-build
fail-on-cache-miss: true
continue-on-error: false
- name: "Checkout RetroHub"
uses: actions/checkout@v4
with:
path: "retrohub"
- name: "Setup templates and libraries"
env:
TEMPLATE_PATH: /home/runner/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.retrohub
run: |
mkdir -p -v $TEMPLATE_PATH
cp cached_builds/template/${{ matrix.template }} $TEMPLATE_PATH/windows_release_${{ matrix.arch }}.exe
ln -s ${{ github.workspace }}/cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg }} retrohub/addons/ffmpeg/${{ matrix.eirteam_ffmpeg }}
mkdir -p -v export/windows_${{ matrix.arch }}
- name: "Setup EIRTeam.FFmpeg editor build"
if: steps.cache_eirteam_ffmpeg_linux.outputs.cache-hit == 'true'
run: |
# The editor uses the debug versions of addons. If the Linux build is ready, use it.
ln -s ${{ github.workspace }}/cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg_editor }} retrohub/addons/ffmpeg/${{ matrix.eirteam_ffmpeg_editor }}
- name: "Package default themes"
uses: ./retrohub/.github/actions/get-default-themes
- name: "Import project"
working-directory: retrohub
env:
GODOT_PATH: ${{ github.workspace }}/cached_builds/editor/godot
run: |
# The first import loads EIRTeam.FFmpeg, an addon which blocks the editor as it requires a restart
timeout 30s $GODOT_PATH --headless --editor || true
$GODOT_PATH --headless --import || true
- name: "Setup rcedit"
run: |
sudo apt-get install wine-stable
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
echo "export/windows/wine = \"/usr/bin/wine\"" >> ~/.config/godot/editor_settings-4.tres
echo "export/windows/rcedit = \"$(pwd)/rcedit-x64.exe\"" >> ~/.config/godot/editor_settings-4.tres
tail -n2 ~/.config/godot/editor_settings-4.tres
- name: "Exporting RetroHub"
working-directory: retrohub
env:
GODOT_PATH: ${{ github.workspace }}/cached_builds/editor/godot
run: |
$GODOT_PATH --headless --export-release "Windows (${{ matrix.arch }})" ../export/windows_${{ matrix.arch }}/RetroHub.exe
- name: "Upload Artifacts"
uses: actions/upload-artifact@v4
with:
name: windows-${{ matrix.arch }}
path: export/windows_${{ matrix.arch }}