feat(updater): stage3 resilient gui update flow
Some checks failed
Desktop Dev Pre-release / prerelease (push) Failing after 2m18s
Some checks failed
Desktop Dev Pre-release / prerelease (push) Failing after 2m18s
- added retry-based file copy, rollback restart, and version marker validation in updater GUI - added build step to write dist/version.txt for post-update validation - added unit tests for updater helpers
This commit is contained in:
13
build.py
13
build.py
@@ -24,6 +24,18 @@ REMOVE_LIST = [
|
||||
]
|
||||
|
||||
|
||||
def write_version_marker():
|
||||
marker_path = os.path.join(DIST_DIR, "version.txt")
|
||||
try:
|
||||
os.makedirs(DIST_DIR, exist_ok=True)
|
||||
with open(marker_path, "w", encoding="utf-8") as f:
|
||||
f.write(str(VERSION).strip() + "\n")
|
||||
print(f"[OK] Обновлен маркер версии: {marker_path}")
|
||||
except Exception as e:
|
||||
print(f"[ERROR] Не удалось записать version.txt: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def ensure_project_root():
|
||||
missing = [name for name in SAFE_CLEAN_ROOT_FILES if not os.path.exists(name)]
|
||||
if missing:
|
||||
@@ -126,6 +138,7 @@ if __name__ == "__main__":
|
||||
run_build()
|
||||
run_updater_build()
|
||||
run_cleanup()
|
||||
write_version_marker()
|
||||
create_archive()
|
||||
|
||||
print("\n" + "=" * 30)
|
||||
|
||||
Reference in New Issue
Block a user