Skip to content

Commit f2b1da7

Browse files
committed
fix(build): CI 拉子模块 + 跑 configure.py 拷 OCR 模型到 resource
打包缺 OCR 模型(det.onnx/keys.txt/rec.onnx)。根因:CI checkout 默认不拉 submodule(MaaCommonAssets),也没跑 tools/configure.py,导致 resource/base/ model/ocr 为空,打包进包的 resource 缺 OCR。 release.yml + package-check.yml: - checkout 加 submodules: true(拉 MaaCommonAssets) - Build 前加 uv run python tools/configure.py(从子模块拷 OCR 到 resource) OCR 模型本身 gitignore 不入库,靠子模块+configure 生成,Stage 步骤的 cp -r resource 会连带拷到 dist。
1 parent a42cb15 commit f2b1da7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/package-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
runs-on: windows-latest
3131
steps:
3232
- uses: actions/checkout@v6
33+
with:
34+
submodules: true # 拉取 MaaCommonAssets(OCR 模型来源)
3335
- uses: actions/setup-python@v6
3436
with:
3537
python-version: '3.13'
@@ -49,6 +51,8 @@ jobs:
4951
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
5052
Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE" -ErrorAction SilentlyContinue
5153
Write-Host "Defender realtime monitoring disabled for build"
54+
- name: Configure OCR model
55+
run: uv run python tools/configure.py
5256
- name: Convert logo.png to ico
5357
shell: bash
5458
run: uv run python -c "from PIL import Image; Image.open('logo.png').save('logo.ico', format='ICO', sizes=[(256,256),(128,128),(64,64),(48,48),(32,32),(16,16)])"

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
runs-on: windows-latest
1414
steps:
1515
- uses: actions/checkout@v6
16+
with:
17+
submodules: true # 拉取 MaaCommonAssets(OCR 模型来源)
1618
- uses: actions/setup-python@v6
1719
with:
1820
python-version: '3.13'
@@ -33,6 +35,8 @@ jobs:
3335
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
3436
Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE" -ErrorAction SilentlyContinue
3537
Write-Host "Defender realtime monitoring disabled for build"
38+
- name: Configure OCR model
39+
run: uv run python tools/configure.py
3640
- name: Convert logo.png to ico
3741
shell: bash
3842
run: uv run python -c "from PIL import Image; Image.open('logo.png').save('logo.ico', format='ICO', sizes=[(256,256),(128,128),(64,64),(48,48),(32,32),(16,16)])"

0 commit comments

Comments
 (0)