#!/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: NIGHTLY_TAG tag of the rolling nightly release (default: "nightly-qt6") NOTE: Qt6 is the sole Windows track. The frozen Qt5 legacy build and the old "nightly" release that held it were removed in Oct. 2026, after that release became immutable (see windows-build.yml, publish-nightly-assets). """ 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", "") nightly_tag = os.environ.get("NIGHTLY_TAG", "") or "nightly-qt6" msi_block = "" if msi_url: msi_block = f""" ⬇ Windows Installer .msi.msi — for enterprise / GPO deployment """ 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

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