#!/usr/bin/env python3 """ generate-page.py — Generates gh-pages/index.html for QElectroTech nightly builds. Called from windows-msi.yml deploy-pages job. Environment variables required: DATE, SHORT, REPO, SHA, RUN_URL, RUN_NUMBER, INSTALLER_URL, PORTABLE_URL, MSI_URL (optional) Optional (frozen Qt5 legacy build — omitted entirely if empty): LEGACY_INSTALLER_URL, LEGACY_PORTABLE_URL, LEGACY_MSI_URL NOTE: Windows Qt5 CI build removed (Qt6 is now the sole track built and signed going forward). INSTALLER_URL / PORTABLE_URL / MSI_URL point to the Qt6 build artifacts. The LEGACY_* variables, when set, point to the last Qt5 nightly assets that were ever published — kept downloadable but frozen (windows-build.yml no longer regenerates or deletes them). """ import os date = os.environ.get("DATE", "") short = os.environ.get("SHORT", "") repo = os.environ.get("REPO", "") sha = os.environ.get("SHA", "") run_url = os.environ.get("RUN_URL", "") run_number = os.environ.get("RUN_NUMBER", "") installer_url = os.environ.get("INSTALLER_URL", "") portable_url = os.environ.get("PORTABLE_URL", "") msi_url = os.environ.get("MSI_URL", "") legacy_installer_url = os.environ.get("LEGACY_INSTALLER_URL", "") legacy_portable_url = os.environ.get("LEGACY_PORTABLE_URL", "") legacy_msi_url = os.environ.get("LEGACY_MSI_URL", "") msi_block = "" if msi_url: msi_block = f""" ⬇ Windows Installer .msi.msi — for enterprise / GPO deployment """ # Legacy Qt5 section — only rendered if at least one legacy asset exists. legacy_block = "" if legacy_installer_url or legacy_portable_url or legacy_msi_url: legacy_installer_btn = "" if legacy_installer_url: legacy_installer_btn = f""" ⬇ Windows Installer (Qt5, legacy).exe — frozen, no longer updated """ legacy_msi_btn = "" if legacy_msi_url: legacy_msi_btn = f""" ⬇ Windows Installer .msi (Qt5, legacy).msi — frozen, no longer updated """ legacy_portable_btn = "" if legacy_portable_url: legacy_portable_btn = f""" 📦 Windows Portable (Qt5, legacy).zip — frozen, no longer updated """ legacy_block = f"""

🗃 Windows — x86_64 — Qt5 (legacy, unmaintained)

🗃 Legacy build — frozen, no longer updated. This is the last Qt5 build published before Windows CI switched to Qt6 only. Kept available for anyone who still needs it, but it will not receive further fixes or security updates. Please migrate to the Qt6 build above when you can.
{legacy_installer_btn} {legacy_msi_btn} {legacy_portable_btn}
""" html = f""" QElectroTech – Nightly Builds

⚡ QElectroTech

Nightly Windows Builds

Build info

📅  {date}
🔀  Commit {short}
🔧  CI Run #{run_number} nightly
⚠️ This is a development version; it introduces new features you want, but may cause bugs that have not yet been identified yet in master. For production use, download a stable release.

🏹 Windows — x86_64

{legacy_block}
""" os.makedirs("gh-pages", exist_ok=True) with open("gh-pages/index.html", "w", encoding="utf-8") as f: f.write(html) print("index.html written OK")