-
Notifications
You must be signed in to change notification settings - Fork 0
276 lines (243 loc) · 9.71 KB
/
windows_builder.yml
File metadata and controls
276 lines (243 loc) · 9.71 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
name: 🏁 Windows No Mono Builds
on:
workflow_call:
inputs:
targets:
description: 'build targets, e.g. editor,template_release,template_debug'
type: string
archs:
description: 'build archs, e.g. x86,x86_64,arm64'
type: string
base-branch:
description: 'Base branch to use for the builds'
type: string
lto:
description: 'LTO mode. Options: "none", "full"'
type: string
repo:
description: 'Repository to use for the build'
type: string
tag:
description: 'tag to use for 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
accesskit-version:
description: 'godot-accesskit-static eversion to use for setup'
type: string
default: '0.21.2'
required: true
angle-version:
description: 'godot-angle-static eversion to use for setup'
type: string
default: '6601.2'
required: true
retention-days:
description: 'retention days'
type: string
default: '1'
required: true
custom-file-data:
description: 'custom file zip base64 data'
type: string
encrypt-iter:
description: 'use encrypt and set aes iter'
type: string
encrypt-pass:
description: 'encrypt passwod'
type: string
encrypt-data:
description: 'encrypt data'
type: string
save-cache:
description: 'Save Cache yes or no'
type: string
# Global Settings
# SCONS_CACHE for windows must be set in the build environment
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
d3d12=yes
strict_checks=yes
debug_symbols=no
use_static_cpp=yes
"angle_libs=${{ github.workspace }}/"
"accesskit_sdk_path=${{ github.workspace }}/accesskit-c-${{inputs.accesskit-version}}/"
SCONS_CACHE_MSVC_CONFIG: true
jobs:
build-windows:
# Windows 10 with latest image
runs-on: windows-latest
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Editor (target=editor, arch=x86_64)
target: editor
arch: x86_64
scons-flags: production=yes
- name: Editor (target=editor, arch=arm64)
target: editor
arch: arm64
scons-flags: production=yes
- name: Template (target=template_release, arch=x86_64)
target: template_release
arch: x86_64
scons-flags: production=yes ${{ inputs.lto }}
- name: Template (target=template_release, arch=x86)
target: template_release
arch: x86
scons-flags: production=yes ${{ inputs.lto }}
- name: Template (target=template_release, arch=arm64)
target: template_release
arch: arm64
scons-flags: production=yes ${{ inputs.lto }}
- name: Template (target=template_debug, arch=x86_64)
target: template_debug
arch: x86_64
scons-flags: ''
- name: Template (target=template_debug, arch=x86)
target: template_debug
arch: x86
scons-flags: ''
- name: Template (target=template_debug, arch=arm64)
target: template_debug
arch: arm64
scons-flags: ''
env:
build-windows-can-run: ${{ contains(inputs.archs, format('{0},',matrix.arch)) && contains(inputs.targets, matrix.target) || '' }}
build-windows-out-filename: windows-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.scons-flags }}
steps:
- name: Checkout
if: env.build-windows-can-run
uses: actions/checkout@v6
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.tag }}
submodules: recursive
- name: Checkout builder repo (cache purge script)
if: env.build-windows-can-run
uses: actions/checkout@v6
with:
path: builder_repo
fetch-depth: 1
- name: Unzip Decrypt
if: inputs.encrypt-iter && env.build-windows-can-run
uses: ./builder_repo/.github/actions/unzip-decrypt
with:
encrypt-data: ${{secrets.ZIPENCDATA}}${{inputs.encrypt-data}}
encrypt-pass: ${{secrets.AESK}}${{inputs.encrypt-pass}}
encrypt-iter: ${{inputs.encrypt-iter}}
unzip-pass: ${{secrets.ZIPK}}${{inputs.encrypt-pass}}
- name: Unzip Custom File
if: inputs.custom-file-data && env.build-windows-can-run
uses: ./builder_repo/.github/actions/unzip-decode
with:
zip-data: ${{inputs.custom-file-data}}
unzip-pass: ${{inputs.encrypt-pass}}
- name: Restore Godot build cache
if: env.build-windows-can-run && inputs.save-cache != 'no'
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ env.build-windows-out-filename }}
continue-on-error: true
- name: Setup Python and SCons
if: env.build-windows-can-run
uses: ./.github/actions/godot-deps
- name: Download Direct3D 12 SDK components
if: env.build-windows-can-run
run: python ./misc/scripts/install_d3d12_sdk_windows.py
- name: Download pre-built ANGLE static libraries (x86_64)
if: matrix.arch == 'x86_64' && env.build-windows-can-run
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: godotengine/godot-angle-static
version: tags/chromium/${{inputs.angle-version}}
file: godot-angle-static-x86_64-msvc-release.zip
target: angle/angle_x86_64.zip
- name: Extract pre-built ANGLE static libraries (x86_64)
if: matrix.arch == 'x86_64' && env.build-windows-can-run
run: Expand-Archive -Force angle/angle_x86_64.zip ${{ github.workspace }}/
- name: Download pre-built ANGLE static libraries (x86_32)
if: matrix.arch == 'x86' && env.build-windows-can-run
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: godotengine/godot-angle-static
version: tags/chromium/${{inputs.angle-version}}
file: godot-angle-static-x86_32-msvc-release.zip
target: angle/angle_x86_32.zip
- name: Extract pre-built ANGLE static libraries (x86_32)
if: matrix.arch == 'x86' && env.build-windows-can-run
run: Expand-Archive -Force angle/angle_x86_32.zip ${{ github.workspace }}/
- name: Download pre-built ANGLE static libraries (arm64)
if: matrix.arch == 'arm64' && env.build-windows-can-run
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: godotengine/godot-angle-static
version: tags/chromium/${{inputs.angle-version}}
file: godot-angle-static-arm64-msvc-release.zip
target: angle/angle_arm64.zip
- name: Extract pre-built ANGLE static libraries (arm64)
if: matrix.arch == 'arm64' && env.build-windows-can-run
run: Expand-Archive -Force angle/angle_arm64.zip ${{ github.workspace }}/
- name: Download pre-built AccessKit
if: env.build-windows-can-run
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: AccessKit/accesskit-c
version: tags/${{inputs.accesskit-version}}
file: accesskit-c-${{inputs.accesskit-version}}.zip
target: accesskit-c-${{inputs.accesskit-version}}/accesskit_c.zip
- name: Extract pre-built AccessKit
if: env.build-windows-can-run
run: unzip -o accesskit-c-${{inputs.accesskit-version}}/accesskit_c.zip
# Compilation
- name: Compilation (editor)
if: matrix.target == 'editor' && env.build-windows-can-run
uses: ./.github/actions/godot-build
with:
scons-flags: ${{ env.SCONSFLAGS }} ${{ inputs.module_flags }} ${{ matrix.scons-flags }} arch=${{ matrix.arch }}
platform: windows
target: ${{ matrix.target }}
- name: Compilation (template)
if: matrix.target != 'editor' && env.build-windows-can-run
uses: ./.github/actions/godot-build
with:
scons-flags: ${{ env.SCONSFLAGS }} ${{ matrix.scons-flags }} ${{ inputs.module_flags }} ${{ inputs.template_module_flags }} arch=${{ matrix.arch }}
platform: windows
target: ${{ matrix.target }}
# - name: Checkout builder repo (cache purge script)
# if: env.build-windows-can-run
# uses: actions/checkout@v6
# with:
# # repository: appsinacup/action_godot_builder
# repository: ${{ github.repository }}
# path: builder_repo
# fetch-depth: 1
- name: Save Godot build cache
if: env.build-windows-can-run && inputs.save-cache != 'no'
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ env.build-windows-out-filename }}
purge-cache-script: builder_repo/misc/scripts/purge_cache.py
continue-on-error: true
- name: Prepare artifact
if: env.build-windows-can-run
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
- name: Upload artifact
if: env.build-windows-can-run
uses: actions/upload-artifact@v7
with:
name: ${{ env.build-windows-out-filename }}
path: bin
retention-days: ${{inputs.retention-days}}