fixed # 将资源文件迁移到Service仓库中

This commit is contained in:
2026-10-26 18:53:41 +08:00
parent e5ec38e9d9
commit e7c6eac07f
34 changed files with 1335 additions and 52 deletions
+13 -6
View File
@@ -3,8 +3,14 @@
import hashlib
import json
from pathlib import Path
import sys
from zipfile import ZipFile
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'src'))
from farm_core.catalogue_release import parse_manifest
from farm_render.catalogue_bundle import ROOTS
def check(root):
data = Path(root) / 'src/farm_render/data'
@@ -19,12 +25,13 @@ def check(root):
with ZipFile(bundle) as archive:
if set(archive.namelist()) != set(metadata['images']):
raise ValueError('Asset manifest and layout differ')
for source, prefix in (
('github', 'https://raw.githubusercontent.com/Shu-Ying/'
'farm_service/main/assets/assets.zip'),
('gitea', 'https://gitea.diuse.work/Diuse/farm_service/'
'raw/branch/main/assets/assets.zip'),
):
bootstrap = parse_manifest((Path(root) / 'src/farm_core/data/'
'catalogue-manifest.json').read_bytes())
if manifest.get('catalogue_release') != bootstrap['release']:
raise ValueError('Bootstrap and asset release differ')
for name, base in ROOTS.items():
source = name.lower()
prefix = base + '/releases/' + bootstrap['release'] + '/assets.zip'
if manifest['sources'][source] != prefix:
raise ValueError('Asset source must use service repository')
print('Verified external asset manifest and development ZIP')