Repository navigation
339 lines (289 loc) · 17.8 KB
/
Copy pathrelease.yml
File metadata and controls
339 lines (289 loc) · 17.8 KB
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
name: 🚀 Create Release
on:
workflow_call:
inputs:
base-branch:
description: 'Base branch to use for the builds'
type: string
lto:
description: 'LTO mode. Options: "none", "thin", "full"'
type: string
repo:
description: 'Repository to use for the build'
type: string
release_repo:
description: 'Repository to use for the release'
type: string
default: ''
tag:
description: 'tag to use for the build'
type: string
tag_release:
description: 'tag to use for releasing the build'
type: string
module_flags:
description: 'Extra module flags, e.g. module_webm_enabled=no'
type: string
template_module_flags:
description: 'Extra module flags for template build, e.g. module_webm_enabled=no'
type: string
# Global Settings
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: ${{ inputs.base-branch }}
SCONSFLAGS: verbose=yes warnings=extra werror=yes strict_checks=yes debug_symbols=no ${{ inputs.module_flags }}
jobs:
release:
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_SIGNING_IDENTITY: ''
name: 🚀 Create Release
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v6
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.tag }}
submodules: recursive
- uses: actions/download-artifact@v8
with:
path: bin
merge-multiple: true
- name: List downloaded bin
run: ls -R bin
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps
- name: Setup Vulkan SDK
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
# https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
- name: Install the Apple certificate
if: ${{ env.BUILD_CERTIFICATE_BASE64 != '' }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
SIGNING_IDENTITY=$(security find-identity -v -p codesigning | awk -F'"' 'NR==1 {print $2}')
echo "APPLE_SIGNING_IDENTITY=$SIGNING_IDENTITY" >> $GITHUB_ENV
- name: Mac Create Editor Bundle
if: ${{ env.BUILD_CERTIFICATE_BASE64 != '' }}
run: |
cp -r misc/dist/macos_tools.app ./bin/Godot.app
mkdir -p bin/Godot.app/Contents/MacOS
cp bin/godot.macos.editor.universal bin/Godot.app/Contents/MacOS/Godot
chmod +x bin/Godot.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements --sign "${{ env.APPLE_SIGNING_IDENTITY }}" bin/Godot.app
# Package the application into a zip file
zip -q -9 -r "Godot.universal.zip" bin/Godot.app
/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool store-credentials "AppleID" --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APP_SPECIFIC_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}"
/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool submit Godot.universal.zip --wait --keychain-profile "AppleID"
xcrun stapler staple bin/Godot.app
- name: Mac Create Mono Editor Bundle
if: ${{ env.BUILD_CERTIFICATE_BASE64 != '' }}
run: |
set -e
if [ ! -f bin/godot.macos.editor.mono.universal ]; then
echo "Mono macOS editor binary not found, skipping."
exit 0
fi
cp -r misc/dist/macos_tools.app ./bin/Godot_mono.app
cp -r bin/GodotSharp bin/Godot_mono.app/Contents/Resources
mkdir -p bin/Godot_mono.app/Contents/MacOS
cp bin/godot.macos.editor.mono.universal bin/Godot_mono.app/Contents/MacOS/Godot
chmod +x bin/Godot_mono.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements --sign "${{ env.APPLE_SIGNING_IDENTITY }}" bin/Godot_mono.app
zip -q -9 -r "Godot_mono.universal.zip" bin/Godot_mono.app
/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool store-credentials "AppleID" --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APP_SPECIFIC_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}"
/Applications/Xcode.app/Contents/Developer/usr/bin/notarytool submit Godot_mono.universal.zip --wait --keychain-profile "AppleID"
xcrun stapler staple bin/Godot_mono.app
- name: Mac Create Editor Bundle (w/o Signing)
if: ${{ env.BUILD_CERTIFICATE_BASE64 == '' }}
run: |
cp -r misc/dist/macos_tools.app ./bin/Godot.app
mkdir -p bin/Godot.app/Contents/MacOS
cp bin/godot.macos.editor.universal bin/Godot.app/Contents/MacOS/Godot
chmod +x bin/Godot.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements -s - bin/Godot.app
- name: Mac Create Mono Editor Bundle (w/o Signing)
if: ${{ env.BUILD_CERTIFICATE_BASE64 == '' }}
run: |
set -e
if [ ! -f bin/godot.macos.editor.mono.universal ]; then
echo "Mono macOS editor binary not found, skipping."
exit 0
fi
cp -r misc/dist/macos_tools.app ./bin/Godot_mono.app
cp -r bin/GodotSharp bin/Godot_mono.app/Contents/Resources
mkdir -p bin/Godot_mono.app/Contents/MacOS
cp bin/godot.macos.editor.mono.universal bin/Godot_mono.app/Contents/MacOS/Godot
chmod +x bin/Godot_mono.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements -s - bin/Godot_mono.app
- name: Mac Create Template Bundle
run: |
cp -r misc/dist/macos_template.app ./bin
mkdir -p bin/macos_template.app/Contents/MacOS
cp bin/godot.macos.template_release.universal bin/macos_template.app/Contents/MacOS/godot_macos_release.universal
cp bin/godot.macos.template_debug.universal bin/macos_template.app/Contents/MacOS/godot_macos_debug.universal
chmod +x bin/macos_template.app/Contents/MacOS/godot_macos*
cd bin && zip -q -9 -r macos.zip macos_template.app && cd ..
- name: Mac Create Template Bundle (Mono)
run: |
set -e
if [ ! -f bin/godot.macos.template_release.mono.universal ]; then
echo "Mono macOS template binaries not found, skipping."
exit 0
fi
cp -r misc/dist/macos_template.app ./bin/macos_template.app
mkdir -p bin/macos_template.app/Contents/MacOS
cp bin/godot.macos.template_release.mono.universal bin/macos_template.app/Contents/MacOS/godot_macos_release.universal
cp bin/godot.macos.template_debug.mono.universal bin/macos_template.app/Contents/MacOS/godot_macos_debug.universal
chmod +x bin/macos_template.app/Contents/MacOS/godot_macos*
cd bin && zip -q -9 -r macos_mono.zip macos_template.app && cd ..
- name: Assemble Android sources (debug + release) into one zip
run: |
mkdir -p work/android_release work/android_debug work/android_src
unzip -q bin/android_source.release.zip -d work/android_release
unzip -q bin/android_source.debug.zip -d work/android_debug
cp -a work/android_release/. work/android_src/
mkdir -p work/android_src/libs/debug work/android_src/libs/release
cp -a work/android_debug/libs/debug/. work/android_src/libs/debug/
( cd work/android_src && zip -q -9 -r ../../bin/android_source.zip . )
- name: Assemble Android mono sources (debug + release) into one zip
run: |
mkdir -p work/android_mono_release work/android_mono_debug work/android_mono_src
unzip -q bin/android_source.mono.release.zip -d work/android_mono_release
unzip -q bin/android_source.mono.debug.zip -d work/android_mono_debug
cp -a work/android_mono_release/. work/android_mono_src/
mkdir -p work/android_mono_src/libs/debug work/android_mono_src/libs/release
cp -a work/android_mono_debug/libs/debug/. work/android_mono_src/libs/debug/
( cd work/android_mono_src && zip -q -9 -r ../../bin/android_source.mono.zip . )
- name: Package per-platform editors and templates
run: |
set -e
mkdir -p release release/templates release/templates_mono
VERSION=${{ inputs.tag_release }}
VERSION_CLEAN=${VERSION//-/.}
# --- Non-mono editors ---
mv bin/godot.linuxbsd.editor.x86_64 bin/Godot_v${VERSION}_linux.x86_64
mv bin/godot.windows.editor.x86_64.exe bin/Godot_v${VERSION}_win64.exe
mv bin/godot.windows.editor.arm64.exe bin/Godot_v${VERSION}_windows_arm64.exe
echo "Non-mono editors renamed; listing bin:"
ls bin
cd bin
zip -q -9 -r ../release/Godot_v${VERSION}_linux.x86_64.zip Godot_v${VERSION}_linux.x86_64
zip -q -9 -r ../release/Godot_v${VERSION}_win64.exe.zip Godot_v${VERSION}_win64.exe
zip -q -9 -r ../release/Godot_v${VERSION}_windows_arm64.exe.zip Godot_v${VERSION}_windows_arm64.exe
zip -q -9 -r ../release/Godot_v${VERSION}_macos.universal.zip Godot.app
cd ..
# --- Templates (non-mono) ---
cp bin/godot.linuxbsd.template_debug.x86_64 "release/templates/linux_debug.x86_64"
cp bin/godot.linuxbsd.template_release.x86_64 "release/templates/linux_release.x86_64"
chmod +x release/templates/linux_debug.x86_64 release/templates/linux_release.x86_64
cp bin/godot.windows.template_debug.x86_64.exe "release/templates/windows_debug_x86_64.exe"
cp bin/godot.windows.template_release.x86_64.exe "release/templates/windows_release_x86_64.exe"
cp bin/godot.windows.template_debug.x86_32.exe "release/templates/windows_debug_x86_32.exe"
cp bin/godot.windows.template_release.x86_32.exe "release/templates/windows_release_x86_32.exe"
cp bin/godot.windows.template_debug.arm64.exe "release/templates/windows_debug_arm64.exe"
cp bin/godot.windows.template_release.arm64.exe "release/templates/windows_release_arm64.exe"
cp bin/godot.windows.template_debug.x86_64.console.exe "release/templates/windows_debug_x86_64_console.exe"
cp bin/godot.windows.template_release.x86_64.console.exe "release/templates/windows_release_x86_64_console.exe"
cp bin/godot.windows.template_debug.x86_32.console.exe "release/templates/windows_debug_x86_32_console.exe"
cp bin/godot.windows.template_release.x86_32.console.exe "release/templates/windows_release_x86_32_console.exe"
cp bin/godot.windows.template_debug.arm64.console.exe "release/templates/windows_debug_arm64_console.exe"
cp bin/godot.windows.template_release.arm64.console.exe "release/templates/windows_release_arm64_console.exe"
cp bin/macos.zip "release/templates/macos.zip"
cp bin/godot_ios.zip "release/templates/ios.zip"
cp -f bin/android_source.zip "release/templates/android_source.zip"
cp -f bin/android_release.apk "release/templates/android_release.apk"
cp -f bin/android_debug.apk "release/templates/android_debug.apk"
cp bin/godot.web.template_release.wasm64.zip "release/templates/web_release.zip"
cp bin/godot.web.template_debug.wasm64.zip "release/templates/web_debug.zip"
cp bin/godot.web.template_release.wasm32.nothreads.zip "release/templates/web_nothreads_release.zip"
cp bin/godot.web.template_debug.wasm32.nothreads.zip "release/templates/web_nothreads_debug.zip"
cp bin/godot.web.template_release.wasm32.dlink.zip "release/templates/web_dlink_release.zip"
cp bin/godot.web.template_debug.wasm32.dlink.zip "release/templates/web_dlink_debug.zip"
cp bin/godot.web.template_release.wasm32.nothreads.dlink.zip "release/templates/web_dlink_nothreads_release.zip"
cp bin/godot.web.template_debug.wasm32.nothreads.dlink.zip "release/templates/web_dlink_nothreads_debug.zip"
printf "%s" "${VERSION_CLEAN}" > release/templates/version.txt
# --- Mono editors (official Godot-style names) ---
mv bin/godot.windows.editor.x86_64.mono.exe bin/Godot_v${VERSION}_mono_win64.exe
mv bin/godot.windows.editor.arm64.mono.exe bin/Godot_v${VERSION}_mono_windows_arm64.exe
mv bin/godot.linuxbsd.editor.x86_64.mono bin/Godot_v${VERSION}_mono_linux.x86_64
cd bin
mkdir -p Godot_v${VERSION}_mono_win64
cp Godot_v${VERSION}_mono_win64.exe Godot_v${VERSION}_mono_win64/
cp -R GodotSharp Godot_v${VERSION}_mono_win64/
zip -q -9 -r ../release/Godot_v${VERSION}_mono_win64.zip Godot_v${VERSION}_mono_win64
mkdir -p Godot_v${VERSION}_mono_windows_arm64
cp Godot_v${VERSION}_mono_windows_arm64.exe Godot_v${VERSION}_mono_windows_arm64/
cp -R GodotSharp Godot_v${VERSION}_mono_windows_arm64/
zip -q -9 -r ../release/Godot_v${VERSION}_mono_windows_arm64.zip Godot_v${VERSION}_mono_windows_arm64
zip -q -9 -r ../release/Godot_v${VERSION}_mono_macos.universal.zip Godot_mono.app
mkdir -p Godot_v${VERSION}_mono_linux_x86_64
cp Godot_v${VERSION}_mono_linux.x86_64 Godot_v${VERSION}_mono_linux_x86_64/
chmod +x Godot_v${VERSION}_mono_linux_x86_64/Godot_v${VERSION}_mono_linux.x86_64
cp -R GodotSharp Godot_v${VERSION}_mono_linux_x86_64/
zip -q -9 -r ../release/Godot_v${VERSION}_mono_linux_x86_64.zip Godot_v${VERSION}_mono_linux_x86_64
cd ..
# --- Templates (Mono) ---
cp bin/godot.windows.template_release.x86_64.mono.exe "release/templates_mono/windows_release_x86_64.exe"
cp bin/godot.windows.template_release.x86_64.mono.console.exe "release/templates_mono/windows_release_x86_64_console.exe"
cp bin/godot.windows.template_debug.x86_64.mono.exe "release/templates_mono/windows_debug_x86_64.exe"
cp bin/godot.windows.template_debug.x86_64.mono.console.exe "release/templates_mono/windows_debug_x86_64_console.exe"
cp bin/macos_mono.zip "release/templates_mono/macos.zip"
cp bin/godot.linuxbsd.template_release.x86_64.mono "release/templates_mono/linux_release.x86_64"
cp bin/godot.linuxbsd.template_debug.x86_64.mono "release/templates_mono/linux_debug.x86_64"
chmod +x release/templates_mono/linux_release.x86_64 release/templates_mono/linux_debug.x86_64
cp -f bin/android_source.mono.zip "release/templates_mono/android_source.zip"
cp -f bin/android_monoRelease.apk "release/templates_mono/android_release.apk"
cp -f bin/android_monoDebug.apk "release/templates_mono/android_debug.apk"
cp -f bin/godot_ios_mono.zip "release/templates_mono/ios.zip"
printf "%s" "${VERSION_CLEAN}" > release/templates_mono/version.txt
ls -R release/templates
ls -R release/templates_mono
cd release
zip -q -r Godot_v${VERSION}_export_templates.tpz templates
rm -rf mono_tpz_payload
mkdir -p mono_tpz_payload/templates
cp -a templates_mono/. mono_tpz_payload/templates/
(cd mono_tpz_payload && zip -q -r ../Godot_v${VERSION}_mono_export_templates.tpz templates)
cd ..
- name: List release directory
run: ls -R release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}-${{ inputs.tag_release }}_${{ inputs.template_module_flags }}
name: "Gonuts ${{ inputs.tag_release }} - ${{ inputs.template_module_flags }}"
repository: ${{ inputs.release_repo != '' && inputs.release_repo || github.repository }}
token: ${{ secrets.GH_TOKEN }}
body: |
- Repo: [${{ inputs.repo }}](https://github.com/${{ inputs.repo }})
- Base Version: ${{ inputs.tag_release }}
- Optimization: ${{ inputs.lto }}
- Template Module Flags: ${{ inputs.template_module_flags }}
- Build Branch: ${{ inputs.base-branch }}
files: |
release/Godot_v${{ inputs.tag_release }}_linux.x86_64.zip
release/Godot_v${{ inputs.tag_release }}_win64.exe.zip
release/Godot_v${{ inputs.tag_release }}_windows_arm64.exe.zip
release/Godot_v${{ inputs.tag_release }}_macos.universal.zip
release/Godot_v${{ inputs.tag_release }}_export_templates.tpz
release/Godot_v${{ inputs.tag_release }}_mono_win64.zip
release/Godot_v${{ inputs.tag_release }}_mono_windows_arm64.zip
release/Godot_v${{ inputs.tag_release }}_mono_macos.universal.zip
release/Godot_v${{ inputs.tag_release }}_mono_linux_x86_64.zip
release/Godot_v${{ inputs.tag_release }}_mono_export_templates.tpz