feat: improve updater flow and release channels
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 dedicated GUI updater executable and integrated launch path from main app - added stable/beta update channel selection with persisted settings and checker support - expanded CI/release validation to include updater and full test discovery
This commit is contained in:
28
build.py
28
build.py
@@ -6,12 +6,14 @@ from app_version import APP_VERSION
|
||||
|
||||
# --- Конфигурация ---
|
||||
APP_NAME = "AnabasisManager"
|
||||
UPDATER_NAME = "AnabasisUpdater"
|
||||
VERSION = APP_VERSION # Единая версия приложения
|
||||
MAIN_SCRIPT = "main.py"
|
||||
UPDATER_SCRIPT = "updater_gui.py"
|
||||
ICON_PATH = "icon.ico"
|
||||
DIST_DIR = os.path.join("dist", APP_NAME)
|
||||
ARCHIVE_NAME = f"{APP_NAME}-{VERSION}" # Формат Название-Версия
|
||||
SAFE_CLEAN_ROOT_FILES = {"main.py", "requirements.txt", "build.py"}
|
||||
SAFE_CLEAN_ROOT_FILES = {"main.py", "updater_gui.py", "requirements.txt", "build.py"}
|
||||
REMOVE_LIST = [
|
||||
"Qt6Pdf.dll", "Qt6PdfQuick.dll", "Qt6PdfWidgets.dll",
|
||||
"Qt6VirtualKeyboard.dll", "Qt6Positioning.dll",
|
||||
@@ -58,6 +60,29 @@ def run_build():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def run_updater_build():
|
||||
print(f"\n--- 1.2 Сборка {UPDATER_NAME} ---")
|
||||
command = [
|
||||
"pyinstaller",
|
||||
"--noconfirm",
|
||||
"--onefile",
|
||||
"--windowed",
|
||||
f"--name={UPDATER_NAME}",
|
||||
"--distpath", DIST_DIR,
|
||||
"--workpath", os.path.join("build", "updater"),
|
||||
"--specpath", os.path.join("build", "updater_spec"),
|
||||
f"--icon={ICON_PATH}" if os.path.exists(ICON_PATH) else "",
|
||||
UPDATER_SCRIPT,
|
||||
]
|
||||
command = [arg for arg in command if arg]
|
||||
try:
|
||||
subprocess.check_call(command)
|
||||
print(f"[OK] {UPDATER_NAME} собран.")
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"[ERROR] Ошибка при сборке {UPDATER_NAME}: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def run_cleanup():
|
||||
print(f"\n--- 2. Оптимизация папки {APP_NAME} ---")
|
||||
|
||||
@@ -99,6 +124,7 @@ if __name__ == "__main__":
|
||||
shutil.rmtree(folder)
|
||||
|
||||
run_build()
|
||||
run_updater_build()
|
||||
run_cleanup()
|
||||
create_archive()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user