#!/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 (Qt6 experimental track — omitted entirely if empty): INSTALLER_QT6_URL, PORTABLE_QT6_URL, MSI_QT6_URL """ 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", "") installer_qt6_url = os.environ.get("INSTALLER_QT6_URL", "") portable_qt6_url = os.environ.get("PORTABLE_QT6_URL", "") msi_qt6_url = os.environ.get("MSI_QT6_URL", "") msi_block = "" if msi_url: msi_block = f""" Windows Installer .msi.msi — for enterprise / GPO deployment """ # Qt6 experimental section — only rendered if at least one Qt6 asset exists. qt6_block = "" if installer_qt6_url or portable_qt6_url or msi_qt6_url: qt6_msi_btn = "" if msi_qt6_url: qt6_msi_btn = f""" Windows Installer .msi (Qt6).msi — experimental, for enterprise / GPO deployment """ qt6_installer_btn = "" if installer_qt6_url: qt6_installer_btn = f""" Windows Installer (Qt6).exe — experimental, includes all dependencies """ qt6_portable_btn = "" if portable_qt6_url: qt6_portable_btn = f""" 📦 Windows Portable (Qt6).zip — experimental, no installation required """ qt6_block = f"""

🧪 Windows — x86_64 — Qt6 track

⚠️ Experimental. These Qt6-based installer, portable and MSI builds are new and not as thoroughly tested as the Qt5 track above. Expect rough edges; please report issues and mention "Qt6" explicitly.
{qt6_installer_btn} {qt6_msi_btn} {qt6_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 — Qt5 track

{qt6_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")