diff --git a/build-aux/windows/generate-page.py b/build-aux/windows/generate-page.py new file mode 100644 index 000000000..df58664d4 --- /dev/null +++ b/build-aux/windows/generate-page.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +""" +generate-page.py — Generates gh-pages/index.html for QElectroTech nightly builds. +Called from windows-build.yml deploy-pages job. +Environment variables required: + DATE, SHORT, REPO, SHA, RUN_URL, RUN_NUMBER, + INSTALLER_URL, PORTABLE_URL, MSI_URL (optional) +""" +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", "") + +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")