55 lines
2.9 KiB
Python
55 lines
2.9 KiB
Python
|
|
from pathlib import Path
|
||
|
|
import hashlib, json, shutil, zipfile
|
||
|
|
|
||
|
|
root=Path(__file__).resolve().parent.parent
|
||
|
|
src=root/'Demon_v0.13.1'
|
||
|
|
win=root/'Demon_v0.13.1_Windows'
|
||
|
|
qa=root/'qa_v131'
|
||
|
|
markers={
|
||
|
|
'release-tests.log':'ALL WORKSHOP TESTS PASSED',
|
||
|
|
'release-ui.log':'PASS: actual mouse input',
|
||
|
|
'release-audio.log':'22 nonverbal voice variants',
|
||
|
|
'release-capture.log':'CAPTURE_BUILD:',
|
||
|
|
'probe.log':'BUILD_PROBE:',
|
||
|
|
}
|
||
|
|
for name,marker in markers.items():
|
||
|
|
log=(qa/name).read_text(encoding='utf-8-sig')
|
||
|
|
assert marker in log,name
|
||
|
|
assert not any(word in log for word in ['ERROR:','Assertion failed','QA check failed']),name
|
||
|
|
|
||
|
|
probe=json.loads(next(line.split('BUILD_PROBE: ',1)[1] for line in (qa/'probe.log').read_text(encoding='utf-8-sig').splitlines() if 'BUILD_PROBE: ' in line))
|
||
|
|
assert probe['id'].startswith('0.13.1-') and probe['id']!='0.13-editor'
|
||
|
|
assert 'CAPTURE_BUILD: '+probe['id'] in (qa/'release-capture.log').read_text(encoding='utf-8-sig')
|
||
|
|
def sha(path):return hashlib.sha256(path.read_bytes()).hexdigest()
|
||
|
|
for name in ['README_RU.md','README_0.13.md','AUDIO_CREDITS.md','MODEL_CREDITS.md','MODEL_LICENSE_CC0.txt','GODOT_LICENSE.txt']:
|
||
|
|
shutil.copy2(src/name,win/name)
|
||
|
|
for name in ['KellySlab-OFL.txt','RuslanDisplay-OFL.txt']:
|
||
|
|
shutil.copy2(src/'art/fonts'/name,win/name)
|
||
|
|
(win/'QA').mkdir(exist_ok=True)
|
||
|
|
for name in markers:shutil.copy2(qa/name,win/'QA'/name)
|
||
|
|
for shot in (win/'captures/v013').glob('*.png'):shutil.copy2(shot,src/'captures/v013'/shot.name)
|
||
|
|
manifest={
|
||
|
|
'version':'0.13.1','date':'2026-10-27','build_id':probe['id'],
|
||
|
|
'engine':'Godot 4.3.stable.official.77dcf97d8',
|
||
|
|
'binary_sha256':sha(win/'Demon.exe'),
|
||
|
|
'validation':{'release_gameplay':'passed','release_mouse_ui':'passed','release_audio':'passed','release_capture':'passed'},
|
||
|
|
'starting_gold':240,'arrival_interval_seconds':3,'queue_warning_threshold':10,
|
||
|
|
'skill_columns':3,'maximum_helpers':3,
|
||
|
|
}
|
||
|
|
(win/'BUILD_MANIFEST.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2),encoding='utf-8')
|
||
|
|
for folder,label in [(win,'Windows'),(src,'Source')]:
|
||
|
|
dest=root/f'Demon_v0.13.1_{label}.zip'
|
||
|
|
with zipfile.ZipFile(dest,'w',zipfile.ZIP_DEFLATED,compresslevel=6) as archive:
|
||
|
|
for path in sorted(folder.rglob('*')):
|
||
|
|
if not path.is_file() or '.godot' in path.parts:continue
|
||
|
|
if path.suffix=='.log' and path.parent!=win/'QA':continue
|
||
|
|
rel=path.relative_to(folder)
|
||
|
|
if label=='Source' and rel.parts[0]=='captures' and 'v013' not in rel.parts:continue
|
||
|
|
archive.write(path,Path(folder.name)/rel)
|
||
|
|
if label=='Source':
|
||
|
|
for name in ['build_v131.ps1','fetch_windows_template.py','package_v131.py']:
|
||
|
|
archive.write(root/'tools'/name,Path('tools')/name)
|
||
|
|
with zipfile.ZipFile(dest) as archive:assert archive.testzip() is None
|
||
|
|
print(f'VERIFIED {dest.name} {dest.stat().st_size} bytes SHA256 {sha(dest)}')
|
||
|
|
print('BUILD_ID '+probe['id'])
|