forked from godotengine/godot-build-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-release.sh
executable file
·555 lines (464 loc) · 21.1 KB
/
build-release.sh
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
#!/bin/bash
set -e
# Config
# For signing keystore and password.
source ./config.sh
can_sign_windows=0
if [ ! -z "${SIGN_KEYSTORE}" ] && [ ! -z "${SIGN_PASSWORD}" ] && [[ $(type -P "osslsigncode") ]]; then
can_sign_windows=1
else
echo "Disabling Windows binary signing as config.sh does not define the required data (SIGN_KEYSTORE, SIGN_PASSWORD), or osslsigncode can't be found in PATH."
fi
sign_windows() {
if [ $can_sign_windows == 0 ]; then
return
fi
osslsigncode sign -pkcs12 ${SIGN_KEYSTORE} -pass "${SIGN_PASSWORD}" -n "${SIGN_NAME}" -i "${SIGN_URL}" -t http://timestamp.comodoca.com -in $1 -out $1-signed
mv $1-signed $1
}
sign_macos() {
if [ -z "${OSX_HOST}" ]; then
return
fi
_macos_tmpdir=$(ssh "${OSX_HOST}" "mktemp -d")
_reldir="$1"
_binname="$2"
_is_mono="$3"
if [[ "${_is_mono}" == "1" ]]; then
_appname="Godot_mono.app"
_sharpdir="${_appname}/Contents/Resources/GodotSharp"
else
_appname="Godot.app"
fi
scp "${_reldir}/${_binname}.zip" "${OSX_HOST}:${_macos_tmpdir}"
scp "${basedir}/git/misc/dist/macos/editor.entitlements" "${OSX_HOST}:${_macos_tmpdir}"
ssh "${OSX_HOST}" "
cd ${_macos_tmpdir} && \
unzip ${_binname}.zip && \
codesign --force --timestamp \
--options=runtime --entitlements editor.entitlements \
-s ${OSX_KEY_ID} -v ${_appname} && \
zip -r ${_binname}_signed.zip ${_appname}"
_request_uuid=$(ssh "${OSX_HOST}" "xcrun altool --notarize-app --primary-bundle-id \"${OSX_BUNDLE_ID}\" --username \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\" --file ${_macos_tmpdir}/${_binname}_signed.zip")
_request_uuid=$(echo ${_request_uuid} | sed -e 's/.*RequestUUID = //')
ssh "${OSX_HOST}" "while xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\" | grep -q Status:\ in\ progress; do echo Waiting on Apple notarization...; sleep 30s; done"
if ! ssh "${OSX_HOST}" "xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\" | grep -q Status:\ success"; then
echo "Notarization failed."
_notarization_log=$(ssh "${OSX_HOST}" "xcrun altool --notarization-info ${_request_uuid} -u \"${APPLE_ID}\" -p \"${APPLE_ID_PASSWORD}\"")
echo "${_notarization_log}"
ssh "${OSX_HOST}" "rm -rf ${_macos_tmpdir}"
exit 1
else
ssh "${OSX_HOST}" "
cd ${_macos_tmpdir} && \
xcrun stapler staple ${_appname} && \
zip -r ${_binname}_stapled.zip ${_appname}"
scp "${OSX_HOST}:${_macos_tmpdir}/${_binname}_stapled.zip" "${_reldir}/${_binname}.zip"
ssh "${OSX_HOST}" "rm -rf ${_macos_tmpdir}"
fi
}
sign_macos_template() {
if [ -z "${OSX_HOST}" ]; then
return
fi
_macos_tmpdir=$(ssh "${OSX_HOST}" "mktemp -d")
_reldir="$1"
_is_mono="$2"
scp "${_reldir}/macos.zip" "${OSX_HOST}:${_macos_tmpdir}"
ssh "${OSX_HOST}" "
cd ${_macos_tmpdir} && \
unzip macos.zip && \
codesign --force -s - \
--options=linker-signed \
-v macos_template.app/Contents/MacOS/* && \
zip -r macos_signed.zip macos_template.app"
scp "${OSX_HOST}:${_macos_tmpdir}/macos_signed.zip" "${_reldir}/macos.zip"
ssh "${OSX_HOST}" "rm -rf ${_macos_tmpdir}"
}
can_publish_nuget=0
if [ ! -z "${NUGET_SOURCE}" ] && [ ! -z "${NUGET_API_KEY}" ] && [[ $(type -P "dotnet") ]]; then
can_publish_nuget=1
else
echo "Disabling NuGet package publishing as config.sh does not define the required data (NUGET_SOURCE, NUGET_API_KEY), or dotnet can't be found in PATH."
fi
publish_nuget_packages() {
if [ $can_publish_nuget == 0 ]; then
return
fi
for pkg in "$@"; do
dotnet nuget push $pkg --source "${NUGET_SOURCE}" --api-key "${NUGET_API_KEY}" --skip-duplicate
done
}
godot_version=""
templates_version=""
do_cleanup=1
make_tarball=1
build_classical=1
build_mono=1
publish_nuget=0
while getopts "h?v:t:b:n-:" opt; do
case "$opt" in
h|\?)
echo "Usage: $0 [OPTIONS...]"
echo
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
echo " -b build target: all|classical|mono|none (default: all)"
echo " -n publish nuget packages (default: false)"
echo " --no-cleanup disable deleting pre-existing output folders (default: false)"
echo " --no-tarball disable generating source tarball (default: false)"
echo
exit 1
;;
v)
godot_version=$OPTARG
;;
t)
templates_version=$OPTARG
;;
b)
if [ "$OPTARG" == "classical" ]; then
build_mono=0
elif [ "$OPTARG" == "mono" ]; then
build_classical=0
elif [ "$OPTARG" == "none" ]; then
build_classical=0
build_mono=0
fi
;;
n)
publish_nuget=1
;;
-)
case "${OPTARG}" in
no-cleanup)
do_cleanup=0
;;
no-tarball)
make_tarball=0
;;
*)
if [ "$OPTERR" == 1 ] && [ "${optspec:0:1}" != ":" ]; then
echo "Unknown option --${OPTARG}."
exit 1
fi
;;
esac
;;
esac
done
if [ -z "${godot_version}" -o -z "${templates_version}" ]; then
echo "Mandatory argument -v or -t missing."
exit 1
elif [[ "{$templates_version}" == *"-"* ]]; then
echo "Templates version (-t) shouldn't contain '-'. It should use a dot to separate version from status."
exit 1
fi
export basedir=$(pwd)
export webdir="${basedir}/web/${templates_version}"
export reldir="${basedir}/releases/${godot_version}"
export reldir_mono="${reldir}/mono"
export tmpdir="${basedir}/tmp"
export templatesdir="${tmpdir}/templates"
export templatesdir_mono="${tmpdir}/mono/templates"
export godot_basename="Godot_v${godot_version}"
# Cleanup and setup
if [ "${do_cleanup}" == "1" ]; then
rm -rf ${webdir}
rm -rf ${reldir}
rm -rf ${tmpdir}
mkdir -p ${webdir}
mkdir -p ${reldir}
mkdir -p ${reldir_mono}
mkdir -p ${templatesdir}
mkdir -p ${templatesdir_mono}
fi
# Tarball
if [ "${make_tarball}" == "1" ]; then
zcat godot-${godot_version}.tar.gz | xz -c > ${reldir}/godot-${godot_version}.tar.xz
pushd ${reldir}
sha256sum godot-${godot_version}.tar.xz > godot-${godot_version}.tar.xz.sha256
popd
fi
# Classical
if [ "${build_classical}" == "1" ]; then
## Linux (Classical) ##
# Editor
binname="${godot_basename}_linux.x86_64"
cp out/linux/x86_64/tools/godot.linuxbsd.editor.x86_64 ${binname}
strip ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
binname="${godot_basename}_linux.x86_32"
cp out/linux/x86_32/tools/godot.linuxbsd.editor.x86_32 ${binname}
strip ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
# Templates
cp out/linux/x86_64/templates/godot.linuxbsd.template_release.x86_64 ${templatesdir}/linux_release.x86_64
cp out/linux/x86_64/templates/godot.linuxbsd.template_debug.x86_64 ${templatesdir}/linux_debug.x86_64
cp out/linux/x86_32/templates/godot.linuxbsd.template_release.x86_32 ${templatesdir}/linux_release.x86_32
cp out/linux/x86_32/templates/godot.linuxbsd.template_debug.x86_32 ${templatesdir}/linux_debug.x86_32
strip ${templatesdir}/linux*
## Windows (Classical) ##
# Editor
binname="${godot_basename}_win64.exe"
wrpname="${godot_basename}_win64_console.exe"
cp out/windows/x86_64/tools/godot.windows.editor.x86_64.exe ${binname}
strip ${binname}
sign_windows ${binname}
cp out/windows/x86_64/tools/godot.windows.editor.x86_64.console.exe ${wrpname}
strip ${wrpname}
sign_windows ${wrpname}
zip -q -9 "${reldir}/${binname}.zip" ${binname} ${wrpname}
rm ${binname} ${wrpname}
binname="${godot_basename}_win32.exe"
wrpname="${godot_basename}_win32_console.exe"
cp out/windows/x86_32/tools/godot.windows.editor.x86_32.exe ${binname}
strip ${binname}
sign_windows ${binname}
cp out/windows/x86_32/tools/godot.windows.editor.x86_32.console.exe ${wrpname}
strip ${wrpname}
sign_windows ${wrpname}
zip -q -9 "${reldir}/${binname}.zip" ${binname} ${wrpname}
rm ${binname} ${wrpname}
# Templates
cp out/windows/x86_64/templates/godot.windows.template_release.x86_64.exe ${templatesdir}/windows_release_x86_64.exe
cp out/windows/x86_64/templates/godot.windows.template_debug.x86_64.exe ${templatesdir}/windows_debug_x86_64.exe
cp out/windows/x86_32/templates/godot.windows.template_release.x86_32.exe ${templatesdir}/windows_release_x86_32.exe
cp out/windows/x86_32/templates/godot.windows.template_debug.x86_32.exe ${templatesdir}/windows_debug_x86_32.exe
cp out/windows/x86_64/templates/godot.windows.template_release.x86_64.console.exe ${templatesdir}/windows_release_x86_64_console.exe
cp out/windows/x86_64/templates/godot.windows.template_debug.x86_64.console.exe ${templatesdir}/windows_debug_x86_64_console.exe
cp out/windows/x86_32/templates/godot.windows.template_release.x86_32.console.exe ${templatesdir}/windows_release_x86_32_console.exe
cp out/windows/x86_32/templates/godot.windows.template_debug.x86_32.console.exe ${templatesdir}/windows_debug_x86_32_console.exe
strip ${templatesdir}/windows*.exe
## macOS (Classical) ##
# Editor
binname="${godot_basename}_macos.universal"
rm -rf Godot.app
cp -r git/misc/dist/macos_tools.app Godot.app
mkdir -p Godot.app/Contents/MacOS
cp out/macos/tools/godot.macos.editor.universal Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
zip -q -9 -r "${reldir}/${binname}.zip" Godot.app
rm -rf Godot.app
sign_macos ${reldir} ${binname} 0
# Templates
rm -rf macos_template.app
cp -r git/misc/dist/macos_template.app .
mkdir -p macos_template.app/Contents/MacOS
cp out/macos/templates/godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal
cp out/macos/templates/godot.macos.template_debug.universal macos_template.app/Contents/MacOS/godot_macos_debug.universal
chmod +x macos_template.app/Contents/MacOS/godot_macos*
zip -q -9 -r "${templatesdir}/macos.zip" macos_template.app
rm -rf macos_template.app
sign_macos_template ${templatesdir} 0
## Web (Classical) ##
# Editor
unzip out/web/tools/godot.web.editor.wasm32.zip -d ${webdir}/
brotli --keep --force --quality=11 ${webdir}/*
binname="${godot_basename}_web_editor.zip"
cp out/web/tools/godot.web.editor.wasm32.zip ${reldir}/${binname}
# Templates
cp out/web/templates/godot.web.template_release.wasm32.zip ${templatesdir}/web_release.zip
cp out/web/templates/godot.web.template_debug.wasm32.zip ${templatesdir}/web_debug.zip
cp out/web/templates/godot.web.template_release.wasm32.dlink.zip ${templatesdir}/web_dlink_release.zip
cp out/web/templates/godot.web.template_debug.wasm32.dlink.zip ${templatesdir}/web_dlink_debug.zip
## Android (Classical) ##
# Lib for direct download
cp out/android/templates/godot-lib.template_release.aar ${reldir}/godot-lib.${templates_version}.template_release.aar
# Editor
binname="${godot_basename}_android_editor.apk"
cp out/android/tools/android_editor.apk ${reldir}/${binname}
binname="${godot_basename}_android_editor.aab"
cp out/android/tools/android_editor.aab ${reldir}/${binname}
# Templates
cp out/android/templates/*.apk ${templatesdir}/
cp out/android/templates/android_source.zip ${templatesdir}/
## iOS (Classical) ##
rm -rf ios_xcode
cp -r git/misc/dist/ios_xcode ios_xcode
cp out/ios/templates/libgodot.ios.simulator.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp out/ios/templates/libgodot.ios.debug.simulator.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp out/ios/templates/libgodot.ios.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
cp out/ios/templates/libgodot.ios.debug.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
cp -r deps/vulkansdk-macos/MoltenVK/MoltenVK.xcframework ios_xcode/
rm -rf ios_xcode/MoltenVK.xcframework/{macos,tvos}*
cd ios_xcode
zip -q -9 -r "${templatesdir}/ios.zip" *
cd ..
rm -rf ios_xcode
# ## UWP (Classical) ##
#
# if [ ! -d "deps/angle" ]; then
# echo "Downloading ANGLE binaries from https://github.com/GodotBuilder/godot-builds/releases/tag/_tools"
# mkdir -p deps && cd deps
# curl -LO https://github.com/GodotBuilder/godot-builds/releases/download/_tools/angle.7z
# 7z x angle.7z && rm -f angle.7z
# cd ..
# fi
#
# rm -rf uwp_template_*
# for arch in ARM Win32 x64; do
# cp -r git/misc/dist/uwp_template uwp_template_${arch}
# cp deps/angle/winrt/10/src/Release_${arch}/libEGL.dll \
# deps/angle/winrt/10/src/Release_${arch}/libGLESv2.dll \
# uwp_template_${arch}/
# cp -r uwp_template_${arch} uwp_template_${arch}_debug
# done
#
# cp out/uwp/arm/godot.uwp.template_release.32.arm.exe uwp_template_ARM/godot.uwp.exe
# cp out/uwp/arm/godot.uwp.template_debug.32.arm.exe uwp_template_ARM_debug/godot.uwp.exe
# cd uwp_template_ARM && zip -q -9 -r "${templatesdir}/uwp_arm_release.zip" * && cd ..
# cd uwp_template_ARM_debug && zip -q -9 -r "${templatesdir}/uwp_arm_debug.zip" * && cd ..
# rm -rf uwp_template_ARM*
#
# cp out/uwp/x86/godot.uwp.template_release.32.x86.exe uwp_template_Win32/godot.uwp.exe
# cp out/uwp/x86/godot.uwp.template_debug.32.x86.exe uwp_template_Win32_debug/godot.uwp.exe
# cd uwp_template_Win32 && zip -q -9 -r "${templatesdir}/uwp_x86_release.zip" * && cd ..
# cd uwp_template_Win32_debug && zip -q -9 -r "${templatesdir}/uwp_x86_debug.zip" * && cd ..
# rm -rf uwp_template_Win32*
#
# cp out/uwp/x64/godot.uwp.template_release.64.x64.exe uwp_template_x64/godot.uwp.exe
# cp out/uwp/x64/godot.uwp.template_debug.64.x64.exe uwp_template_x64_debug/godot.uwp.exe
# cd uwp_template_x64 && zip -q -9 -r "${templatesdir}/uwp_x64_release.zip" * && cd ..
# cd uwp_template_x64_debug && zip -q -9 -r "${templatesdir}/uwp_x64_debug.zip" * && cd ..
# rm -rf uwp_template_x64*
## Templates TPZ (Classical) ##
echo "${templates_version}" > ${templatesdir}/version.txt
pushd ${templatesdir}/..
zip -q -9 -r -D "${reldir}/${godot_basename}_export_templates.tpz" templates/*
popd
## SHA-512 sums (Classical) ##
pushd ${reldir}
sha512sum [Gg]* > SHA512-SUMS.txt
mkdir -p ${basedir}/sha512sums/${godot_version}
cp SHA512-SUMS.txt ${basedir}/sha512sums/${godot_version}/
popd
fi
# Mono
if [ "${build_mono}" == "1" ]; then
## Linux (Mono) ##
# Editor
binbasename="${godot_basename}_mono_linux"
mkdir -p ${binbasename}_x86_64
cp out/linux/x86_64/tools-mono/godot.linuxbsd.editor.x86_64.mono ${binbasename}_x86_64/${binbasename}.x86_64
strip ${binbasename}_x86_64/${binbasename}.x86_64
cp -rp out/linux/x86_64/tools-mono/GodotSharp ${binbasename}_x86_64/
zip -r -q -9 "${reldir_mono}/${binbasename}_x86_64.zip" ${binbasename}_x86_64
rm -rf ${binbasename}_x86_64
binbasename="${godot_basename}_mono_linux"
mkdir -p ${binbasename}_x86_32
cp out/linux/x86_32/tools-mono/godot.linuxbsd.editor.x86_32.mono ${binbasename}_x86_32/${binbasename}.x86_32
strip ${binbasename}_x86_32/${binbasename}.x86_32
cp -rp out/linux/x86_32/tools-mono/GodotSharp/ ${binbasename}_x86_32/
zip -r -q -9 "${reldir_mono}/${binbasename}_x86_32.zip" ${binbasename}_x86_32
rm -rf ${binbasename}_x86_32
# Templates
cp out/linux/x86_64/templates-mono/godot.linuxbsd.template_debug.x86_64.mono ${templatesdir_mono}/linux_debug.x86_64
cp out/linux/x86_64/templates-mono/godot.linuxbsd.template_release.x86_64.mono ${templatesdir_mono}/linux_release.x86_64
cp out/linux/x86_32/templates-mono/godot.linuxbsd.template_debug.x86_32.mono ${templatesdir_mono}/linux_debug.x86_32
cp out/linux/x86_32/templates-mono/godot.linuxbsd.template_release.x86_32.mono ${templatesdir_mono}/linux_release.x86_32
strip ${templatesdir_mono}/linux*
## Windows (Mono) ##
# Editor
binname="${godot_basename}_mono_win64"
wrpname="${godot_basename}_mono_win64_console"
mkdir -p ${binname}
cp out/windows/x86_64/tools-mono/godot.windows.editor.x86_64.mono.exe ${binname}/${binname}.exe
strip ${binname}/${binname}.exe
sign_windows ${binname}/${binname}.exe
cp -rp out/windows/x86_64/tools-mono/GodotSharp ${binname}/
cp out/windows/x86_64/tools-mono/godot.windows.editor.x86_64.mono.console.exe ${binname}/${wrpname}.exe
strip ${binname}/${wrpname}.exe
sign_windows ${binname}/${wrpname}.exe
zip -r -q -9 "${reldir_mono}/${binname}.zip" ${binname}
rm -rf ${binname}
binname="${godot_basename}_mono_win32"
wrpname="${godot_basename}_mono_win32_console"
mkdir -p ${binname}
cp out/windows/x86_32/tools-mono/godot.windows.editor.x86_32.mono.exe ${binname}/${binname}.exe
strip ${binname}/${binname}.exe
sign_windows ${binname}/${binname}.exe
cp -rp out/windows/x86_32/tools-mono/GodotSharp ${binname}/
cp out/windows/x86_32/tools-mono/godot.windows.editor.x86_32.mono.console.exe ${binname}/${wrpname}.exe
strip ${binname}/${wrpname}.exe
sign_windows ${binname}/${wrpname}.exe
zip -r -q -9 "${reldir_mono}/${binname}.zip" ${binname}
rm -rf ${binname}
# Templates
cp out/windows/x86_64/templates-mono/godot.windows.template_debug.x86_64.mono.exe ${templatesdir_mono}/windows_debug_x86_64.exe
cp out/windows/x86_64/templates-mono/godot.windows.template_release.x86_64.mono.exe ${templatesdir_mono}/windows_release_x86_64.exe
cp out/windows/x86_32/templates-mono/godot.windows.template_debug.x86_32.mono.exe ${templatesdir_mono}/windows_debug_x86_32.exe
cp out/windows/x86_32/templates-mono/godot.windows.template_release.x86_32.mono.exe ${templatesdir_mono}/windows_release_x86_32.exe
cp out/windows/x86_64/templates-mono/godot.windows.template_debug.x86_64.mono.console.exe ${templatesdir_mono}/windows_debug_x86_64_console.exe
cp out/windows/x86_64/templates-mono/godot.windows.template_release.x86_64.mono.console.exe ${templatesdir_mono}/windows_release_x86_64_console.exe
cp out/windows/x86_32/templates-mono/godot.windows.template_debug.x86_32.mono.console.exe ${templatesdir_mono}/windows_debug_x86_32_console.exe
cp out/windows/x86_32/templates-mono/godot.windows.template_release.x86_32.mono.console.exe ${templatesdir_mono}/windows_release_x86_32_console.exe
strip ${templatesdir_mono}/windows*.exe
## macOS (Mono) ##
# Editor
binname="${godot_basename}_mono_macos.universal"
rm -rf Godot_mono.app
cp -r git/misc/dist/macos_tools.app Godot_mono.app
mkdir -p Godot_mono.app/Contents/{MacOS,Resources}
cp out/macos/tools-mono/godot.macos.editor.universal.mono Godot_mono.app/Contents/MacOS/Godot
cp -rp out/macos/tools-mono/GodotSharp Godot_mono.app/Contents/Resources/GodotSharp
chmod +x Godot_mono.app/Contents/MacOS/Godot
zip -q -9 -r "${reldir_mono}/${binname}.zip" Godot_mono.app
rm -rf Godot_mono.app
sign_macos ${reldir_mono} ${binname} 1
# Templates
rm -rf macos_template.app
cp -r git/misc/dist/macos_template.app .
mkdir -p macos_template.app/Contents/{MacOS,Resources}
cp out/macos/templates-mono/godot.macos.template_debug.universal.mono macos_template.app/Contents/MacOS/godot_macos_debug.universal
cp out/macos/templates-mono/godot.macos.template_release.universal.mono macos_template.app/Contents/MacOS/godot_macos_release.universal
chmod +x macos_template.app/Contents/MacOS/godot_macos*
zip -q -9 -r "${templatesdir_mono}/macos.zip" macos_template.app
rm -rf macos_template.app
sign_macos_template ${templatesdir_mono} 1
# No .NET support for those platforms yet.
if false; then
## Web (Mono) ##
# Templates
cp out/web/templates-mono/godot.web.template_debug.wasm32.mono.zip ${templatesdir_mono}/web_debug.zip
cp out/web/templates-mono/godot.web.template_release.wasm32.mono.zip ${templatesdir_mono}/web_release.zip
## Android (Mono) ##
# Lib for direct download
cp out/android/templates-mono/godot-lib.template_release.aar ${reldir_mono}/godot-lib.${templates_version}.mono.template_release.aar
# Templates
cp out/android/templates-mono/*.apk ${templatesdir_mono}/
cp out/android/templates-mono/android_source.zip ${templatesdir_mono}/
## iOS (Mono) ##
rm -rf ios_xcode
cp -r git/misc/dist/ios_xcode ios_xcode
cp out/ios/templates-mono/libgodot.ios.simulator.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp out/ios/templates-mono/libgodot.ios.debug.simulator.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp out/ios/templates-mono/libgodot.ios.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
cp out/ios/templates-mono/libgodot.ios.debug.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
cp -r deps/vulkansdk-macos/MoltenVK/MoltenVK.xcframework ios_xcode/
rm -rf ios_xcode/MoltenVK.xcframework/{macos,tvos}*
cd ios_xcode
zip -q -9 -r "${templatesdir_mono}/ios.zip" *
cd ..
rm -rf ios_xcode
fi
## Templates TPZ (Mono) ##
echo "${templates_version}.mono" > ${templatesdir_mono}/version.txt
pushd ${templatesdir_mono}/..
zip -q -9 -r -D "${reldir_mono}/${godot_basename}_mono_export_templates.tpz" templates/*
popd
## SHA-512 sums (Mono) ##
pushd ${reldir_mono}
sha512sum [Gg]* >> SHA512-SUMS.txt
mkdir -p ${basedir}/sha512sums/${godot_version}/mono
cp SHA512-SUMS.txt ${basedir}/sha512sums/${godot_version}/mono/
popd
fi
# NuGet packages
if [ "${publish_nuget}" == "1" ]; then
echo "Publishing NuGet packages..."
publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/*.nupkg
fi
echo "All editor binaries and templates prepared successfully for release"