Skip to content

Commit effe9e1

Browse files
调整eos sdk 版本号检查,当大于 1.18.1.2 时禁止 32 位 windows 与 Android 的编译(含 CI)。
1 parent 8401917 commit effe9e1

4 files changed

Lines changed: 41 additions & 25 deletions

File tree

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Check EOS SDK Version
2-
description: Check EOS SDK version and determine if 32-bit Windows build should be skipped
2+
description: Check EOS SDK version and determine if 32-bit builds should be skipped
33

44
outputs:
55
major:
@@ -11,9 +11,12 @@ outputs:
1111
patch:
1212
description: EOS SDK patch version
1313
value: ${{ steps.check.outputs.patch }}
14-
skip_32bit_windows:
15-
description: Whether to skip 32-bit Windows build (SDK >= 1.19.0)
16-
value: ${{ steps.check.outputs.skip_32bit_windows }}
14+
hotfix:
15+
description: EOS SDK hotfix version
16+
value: ${{ steps.check.outputs.hotfix }}
17+
skip_32bit:
18+
description: Whether to skip 32-bit builds (SDK > 1.18.1.2)
19+
value: ${{ steps.check.outputs.skip_32bit }}
1720

1821
runs:
1922
using: composite
@@ -26,22 +29,24 @@ runs:
2629
import re
2730
2831
version_file = "thirdparty/eos-sdk/SDK/Include/eos_version.h"
29-
version = {"MAJOR": 0, "MINOR": 0, "PATCH": 0}
30-
pattern = re.compile(r"#define\s+EOS_(MAJOR|MINOR|PATCH)_VERSION\s+(\d+)")
32+
version = {"MAJOR": 0, "MINOR": 0, "PATCH": 0, "HOTFIX": 0}
33+
pattern = re.compile(r"#define\s+EOS_(MAJOR|MINOR|PATCH|HOTFIX)_VERSION\s+(\d+)")
3134
3235
with open(version_file, "r", encoding="utf-8") as f:
3336
for line in f:
3437
match = pattern.match(line.strip())
3538
if match:
3639
version[match.group(1)] = int(match.group(2))
3740
38-
major, minor, patch = version["MAJOR"], version["MINOR"], version["PATCH"]
39-
print(f"EOS SDK version: {major}.{minor}.{patch}")
41+
major, minor, patch, hotfix = version["MAJOR"], version["MINOR"], version["PATCH"], version["HOTFIX"]
42+
print(f"EOS SDK version: {major}.{minor}.{patch}.{hotfix}")
4043
41-
skip_32bit_windows = major > 1 or (major == 1 and minor >= 19)
44+
# Skip 32-bit builds if version > 1.18.1.2
45+
skip_32bit = (major, minor, patch, hotfix) > (1, 18, 1, 2)
4246
4347
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
4448
f.write(f"major={major}\n")
4549
f.write(f"minor={minor}\n")
4650
f.write(f"patch={patch}\n")
47-
f.write(f"skip_32bit_windows={str(skip_32bit_windows).lower()}\n")
51+
f.write(f"hotfix={hotfix}\n")
52+
f.write(f"skip_32bit={str(skip_32bit).lower()}\n")

.github/workflows/builds.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ jobs:
167167
id: sdk_version
168168
uses: ./.github/actions/check-sdk-version
169169

170-
- name: Skip 32-bit Windows build
171-
if: matrix.platform == 'windows' && matrix.arch == 'x86_32' && steps.sdk_version.outputs.skip_32bit_windows == 'true'
170+
- name: Skip 32-bit build (Windows/Android)
171+
if: "((matrix.platform == 'windows' && matrix.arch == 'x86_32') || (matrix.platform == 'android' && contains(matrix.arch, '32'))) && steps.sdk_version.outputs.skip_32bit == 'true'"
172172
run: |
173-
echo "⚠️ Skipping 32-bit Windows build: EOS SDK ${{ steps.sdk_version.outputs.major }}.${{ steps.sdk_version.outputs.minor }}.${{ steps.sdk_version.outputs.patch }} does not support 32-bit Windows platform."
174-
echo "Please use 64-bit architecture or downgrade EOS SDK to version 1.18.x or earlier."
173+
echo "⚠️ Skipping 32-bit ${{ matrix.platform }} build: EOS SDK ${{ steps.sdk_version.outputs.major }}.${{ steps.sdk_version.outputs.minor }}.${{ steps.sdk_version.outputs.patch }}.${{ steps.sdk_version.outputs.hotfix }} does not support 32-bit ${{ matrix.platform }} platform."
174+
echo "Please use 64-bit architecture or downgrade EOS SDK to version 1.18.1.2 or earlier."
175175
176176
# ─── Platform Dependencies ─────────────────────────────────────────────
177177
- name: (Linux) Install dependencies
@@ -201,7 +201,7 @@ jobs:
201201

202202
# ─── Compile ───────────────────────────────────────────────────────────
203203
- name: Compile extension
204-
if: "matrix.platform != 'ios' && !(matrix.platform == 'windows' && matrix.arch == 'x86_32' && steps.sdk_version.outputs.skip_32bit_windows == 'true')"
204+
if: "matrix.platform != 'ios' && !((matrix.platform == 'windows' && matrix.arch == 'x86_32' || matrix.platform == 'android' && contains(matrix.arch, '32')) && steps.sdk_version.outputs.skip_32bit == 'true')"
205205
shell: sh
206206
run: |
207207
scons target='template_${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' ${{ matrix.additional_sconsflags }} ${{ inputs.sconsflags }}
@@ -216,7 +216,7 @@ jobs:
216216
217217
# ─── Documentation ─────────────────────────────────────────────────────
218218
- name: Generate documents and recompile extension
219-
if: "inputs.compatibility_minimum == '4.3' && matrix.target == 'debug' && !contains(matrix.arch, '32') && matrix.godot_editor_suffix != '' && !(matrix.platform == 'windows' && matrix.arch == 'x86_32' && steps.sdk_version.outputs.skip_32bit_windows == 'true')"
219+
if: "inputs.compatibility_minimum == '4.3' && matrix.target == 'debug' && !contains(matrix.arch, '32') && matrix.godot_editor_suffix != '' && !((matrix.platform == 'windows' && matrix.arch == 'x86_32' || matrix.platform == 'android' && contains(matrix.arch, '32')) && steps.sdk_version.outputs.skip_32bit == 'true')"
220220
uses: ./.github/actions/generate_documents_and_recompile
221221
with:
222222
godot_branch_for_generate_documents: ${{ env.GODOT_BRANCH_FOR_GENERATE_DOCUMENTS }}
@@ -229,12 +229,12 @@ jobs:
229229

230230
# ─── Artifacts ─────────────────────────────────────────────────────────
231231
- name: Copy to artifacts directory
232-
if: "!(matrix.platform == 'windows' && matrix.arch == 'x86_32' && steps.sdk_version.outputs.skip_32bit_windows == 'true')"
232+
if: "!((matrix.platform == 'windows' && matrix.arch == 'x86_32' || matrix.platform == 'android' && contains(matrix.arch, '32')) && steps.sdk_version.outputs.skip_32bit == 'true')"
233233
shell: bash
234234
run: python ./misc/copy_dir.py ./demo/addons/ ./artifacts/GD-EOS/addons/
235235

236236
- name: Upload artifact
237-
if: "!(matrix.platform == 'windows' && matrix.arch == 'x86_32' && steps.sdk_version.outputs.skip_32bit_windows == 'true')"
237+
if: "!((matrix.platform == 'windows' && matrix.arch == 'x86_32' || matrix.platform == 'android' && contains(matrix.arch, '32')) && steps.sdk_version.outputs.skip_32bit == 'true')"
238238
uses: actions/upload-artifact@v4
239239
with:
240240
name: ${{ github.event.repository.name }}-min-godot-${{ inputs.compatibility_minimum }}${{ inputs.temporary_artifact_suffix }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}

SConstruct

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,20 @@ gd_eos_tool.generate(env)
3434

3535
# ─── SDK 版本检查 ─────────────────────────────────────────────────────────
3636

37-
# 当 EOS SDK 版本大于等于 1.19.0 时禁止为 32 位 Windows 平台编译
38-
_eos_major, _eos_minor, _eos_patch, _ = env.GD_EOS_GET_SDK_VERSION()
37+
# 当 EOS SDK 版本大于 1.18.1.2 时禁止为 32 位 Windows 和 Android 平台编译
38+
_eos_major, _eos_minor, _eos_patch, _hotfix = env.GD_EOS_GET_SDK_VERSION()
39+
_skip_32bit = (_eos_major, _eos_minor, _eos_patch, _hotfix) > (1, 18, 1, 2)
40+
3941
if env["platform"] == "windows" and "64" not in env["arch"]:
40-
if _eos_major > 1 or (_eos_major == 1 and _eos_minor >= 19):
41-
print(f"Error: EOS SDK {_eos_major}.{_eos_minor}.{_eos_patch} does not support 32-bit Windows platform.")
42-
print("Please use 64-bit architecture or downgrade EOS SDK to version 1.18.x or earlier.")
42+
if _skip_32bit:
43+
print(f"Error: EOS SDK {_eos_major}.{_eos_minor}.{_eos_patch}.{_hotfix} does not support 32-bit Windows platform.")
44+
print("Please use 64-bit architecture or downgrade EOS SDK to version 1.18.1.2 or earlier.")
45+
Exit(1)
46+
47+
if env["platform"] == "android" and "64" not in env["arch"]:
48+
if _skip_32bit:
49+
print(f"Error: EOS SDK {_eos_major}.{_eos_minor}.{_eos_patch}.{_hotfix} does not support 32-bit Android platform.")
50+
print("Please use 64-bit architecture or downgrade EOS SDK to version 1.18.1.2 or earlier.")
4351
Exit(1)
4452

4553
# ─── 路径配置 ─────────────────────────────────────────────────────────────

gd_eos/include/core/utils.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
#define EOS_HOTFIX_VERSION 0
88
#endif // EOS_HOTFIX_VERSION
99

10-
#define _EOS_VERSION_MIN_VERSION(major, minor, patch, hotfix) ( \
11-
EOS_MAJOR_VERSION > major || (EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION > minor) || (EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION == minor && EOS_PATCH_VERSION > patch) || (EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION == minor && EOS_PATCH_VERSION == patch && EOS_HOTFIX_VERSION >= hotfix))
10+
#define _EOS_VERSION_MIN_VERSION(major, minor, patch, hotfix) ( \
11+
EOS_MAJOR_VERSION > major || \
12+
(EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION > minor) || \
13+
(EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION == minor && EOS_PATCH_VERSION > patch) || \
14+
(EOS_MAJOR_VERSION == major && EOS_MINOR_VERSION == minor && EOS_PATCH_VERSION == patch && EOS_HOTFIX_VERSION >= hotfix))
1215

1316
#if _EOS_VERSION_MIN_VERSION(1, 18, 0, 0)
1417
#include <eos_presence_localized_types.h>

0 commit comments

Comments
 (0)