mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-15 07:09:58 +02:00
Update windows-build.yml
This commit is contained in:
226
.github/workflows/windows-build.yml
vendored
226
.github/workflows/windows-build.yml
vendored
@@ -407,6 +407,8 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Generate download page (index.html)
|
- name: Generate download page (index.html)
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
||||||
SHORT="${{ github.sha }}"
|
SHORT="${{ github.sha }}"
|
||||||
@@ -417,191 +419,59 @@ jobs:
|
|||||||
INSTALLER_URL="https://github.com/$REPO/releases/download/nightly/$EXE_NAME"
|
INSTALLER_URL="https://github.com/$REPO/releases/download/nightly/$EXE_NAME"
|
||||||
ZIP_NAME=$(ls downloaded/portable/*.zip | xargs -I{} basename {})
|
ZIP_NAME=$(ls downloaded/portable/*.zip | xargs -I{} basename {})
|
||||||
PORTABLE_URL="https://github.com/$REPO/releases/download/nightly/$ZIP_NAME"
|
PORTABLE_URL="https://github.com/$REPO/releases/download/nightly/$ZIP_NAME"
|
||||||
# MSI — may not exist if windows-msi.yml has not been run yet
|
|
||||||
MSI_NAME=$(gh release view nightly --json assets --jq '.assets[].name' 2>/dev/null \
|
MSI_NAME=$(gh release view nightly --json assets --jq '.assets[].name' 2>/dev/null \
|
||||||
| grep '\.msi$' | head -1 || echo "")
|
| grep '\.msi$' | head -1 || echo "")
|
||||||
if [ -n "$MSI_NAME" ]; then
|
if [ -n "$MSI_NAME" ]; then
|
||||||
MSI_URL="https://github.com/$REPO/releases/download/nightly/$MSI_NAME"
|
MSI_URL="https://github.com/$REPO/releases/download/nightly/$MSI_NAME"
|
||||||
MSI_BLOCK='<a class="btn btn-msi" href="'"$MSI_URL"'">
|
|
||||||
<span class="btn-icon">⬇</span>
|
|
||||||
<span class="btn-text">
|
|
||||||
Windows Installer
|
|
||||||
<small>.msi — for enterprise / GPO deployment</small>
|
|
||||||
</span>
|
|
||||||
</a>'
|
|
||||||
else
|
else
|
||||||
MSI_BLOCK=''
|
MSI_URL=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p gh-pages
|
mkdir -p gh-pages
|
||||||
cat > gh-pages/index.html << HTMLEOF
|
python3 -c "
|
||||||
<!DOCTYPE html>
|
import os, sys
|
||||||
<html lang="en">
|
date=os.environ['DATE']; short=os.environ['SHORT']; repo=os.environ['REPO']
|
||||||
<head>
|
run_url=os.environ['RUN_URL']; run_num='${{ github.run_number }}'; sha='${{ github.sha }}'
|
||||||
<meta charset="UTF-8">
|
inst=os.environ['INSTALLER_URL']; port=os.environ['PORTABLE_URL']; msi_url=os.environ.get('MSI_URL','')
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
msi_block=f'''<a class=\"btn btn-msi\" href=\"{msi_url}\"><span class=\"btn-icon\">⬇</span><span class=\"btn-text\">Windows Installer .msi<small>.msi - for enterprise/GPO deployment</small></span></a>''' if msi_url else ''
|
||||||
<title>QElectroTech – Nightly Builds</title>
|
html=f'''<!DOCTYPE html>
|
||||||
<style>
|
<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">
|
||||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
<title>QElectroTech - Nightly Builds</title>
|
||||||
body {
|
<style>
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
*,*::before,*::after{{box-sizing:border-box;margin:0;padding:0}}
|
||||||
background: #f0f4f8;
|
body{{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#f0f4f8;color:#2d3748;min-height:100vh}}
|
||||||
color: #2d3748;
|
header{{background:linear-gradient(135deg,#1a365d 0%,#2b6cb0 100%);color:white;padding:48px 24px 40px;text-align:center}}
|
||||||
min-height: 100vh;
|
header h1{{font-size:2.2em;margin-bottom:8px}} header p{{opacity:.8;font-size:1.05em}}
|
||||||
}
|
main{{max-width:680px;margin:40px auto;padding:0 20px 60px}}
|
||||||
header {
|
.card{{background:white;border-radius:12px;padding:28px;margin-bottom:24px;box-shadow:0 2px 12px rgba(0,0,0,.08)}}
|
||||||
background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
|
.card h2{{font-size:1em;text-transform:uppercase;color:#718096;margin-bottom:16px}}
|
||||||
color: white;
|
.meta{{font-size:.875em;color:#4a5568;line-height:1.8;margin-bottom:20px}}
|
||||||
padding: 48px 24px 40px;
|
.meta a{{color:#2b6cb0;text-decoration:none}} .badge{{display:inline-block;background:#ebf8ff;color:#2b6cb0;border-radius:4px;font-size:.8em;font-weight:600;padding:2px 8px;margin-left:6px}}
|
||||||
text-align: center;
|
.warning{{background:#fffbeb;border-left:4px solid #f6ad55;border-radius:4px;padding:12px 16px;font-size:.875em;color:#744210;margin-bottom:24px}}
|
||||||
}
|
.downloads{{display:flex;flex-direction:column;gap:12px}}
|
||||||
header h1 { font-size: 2.2em; letter-spacing: -0.5px; margin-bottom: 8px; }
|
.btn{{display:flex;align-items:center;gap:12px;padding:14px 20px;border-radius:8px;font-size:.95em;font-weight:600;text-decoration:none;transition:transform .1s,box-shadow .1s}}
|
||||||
header p { opacity: 0.8; font-size: 1.05em; }
|
.btn:hover{{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.15)}}
|
||||||
main {
|
.btn-primary{{background:#2b6cb0;color:white}} .btn-msi{{background:#6b46c1;color:white}} .btn-secondary{{background:#edf2f7;color:#2d3748}}
|
||||||
max-width: 680px;
|
.btn-icon{{font-size:1.3em}} .btn-text small{{display:block;font-weight:400;font-size:.8em;opacity:.75;margin-top:1px}}
|
||||||
margin: 40px auto;
|
footer{{text-align:center;font-size:.8em;color:#a0aec0;padding:32px 0 0}} footer a{{color:#718096;text-decoration:none}}
|
||||||
padding: 0 20px 60px;
|
</style></head><body>
|
||||||
}
|
<header><h1>⚡ QElectroTech</h1><p>Nightly Windows Builds</p></header>
|
||||||
.card {
|
<main>
|
||||||
background: white;
|
<div class=\"card\"><h2>Build info</h2>
|
||||||
border-radius: 12px;
|
<div class=\"meta\">📅 <strong>{date}</strong><br>
|
||||||
padding: 28px;
|
🔀 Commit <a href=\"https://github.com/{repo}/commit/{sha}\"><code>{short}</code></a><br>
|
||||||
margin-bottom: 24px;
|
🔧 <a href=\"{run_url}\">CI Run #{run_num}</a> <span class=\"badge\">nightly</span></div>
|
||||||
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
|
<div class=\"warning\">⚠ This is a development version. For production use, download a <a href=\"https://github.com/{repo}/releases\">stable release</a>.</div></div>
|
||||||
}
|
<div class=\"card\"><h2>🏹 Windows x86_64</h2><div class=\"downloads\">
|
||||||
.card h2 {
|
<a class=\"btn btn-primary\" href=\"{inst}\"><span class=\"btn-icon\">⬇</span><span class=\"btn-text\">Windows Installer .exe<small>.exe - recommended, includes all dependencies</small></span></a>
|
||||||
font-size: 1em;
|
{msi_block}
|
||||||
text-transform: uppercase;
|
<a class=\"btn btn-secondary\" href=\"{port}\"><span class=\"btn-icon\">📦</span><span class=\"btn-text\">Windows Portable .zip<small>no installation required, run Lancer QET.bat</small></span></a>
|
||||||
letter-spacing: 0.06em;
|
<a class=\"btn btn-secondary\" href=\"https://github.com/{repo}/releases/tag/nightly\"><span class=\"btn-icon\">📦</span><span class=\"btn-text\">All nightly files on GitHub<small>Release page with checksums</small></span></a>
|
||||||
color: #718096;
|
</div></div></main>
|
||||||
margin-bottom: 16px;
|
<footer>Auto-generated by GitHub Actions · <a href=\"https://github.com/{repo}\">Source on GitHub</a> · <a href=\"https://qelectrotech.org\">qelectrotech.org</a></footer>
|
||||||
}
|
</body></html>'''
|
||||||
.meta {
|
open('gh-pages/index.html','w',encoding='utf-8').write(html)
|
||||||
font-size: 0.875em;
|
print('index.html written OK')
|
||||||
color: #4a5568;
|
"
|
||||||
line-height: 1.8;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.meta a { color: #2b6cb0; text-decoration: none; }
|
|
||||||
.meta a:hover { text-decoration: underline; }
|
|
||||||
.badge {
|
|
||||||
display: inline-block;
|
|
||||||
background: #ebf8ff;
|
|
||||||
color: #2b6cb0;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.8em;
|
|
||||||
font-weight: 600;
|
|
||||||
padding: 2px 8px;
|
|
||||||
margin-left: 6px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.warning {
|
|
||||||
background: #fffbeb;
|
|
||||||
border-left: 4px solid #f6ad55;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 12px 16px;
|
|
||||||
font-size: 0.875em;
|
|
||||||
color: #744210;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.warning a { color: #c05621; }
|
|
||||||
.downloads { display: flex; flex-direction: column; gap: 12px; }
|
|
||||||
.btn {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 12px;
|
|
||||||
padding: 14px 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 0.95em;
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
transition: transform 0.1s, box-shadow 0.1s;
|
|
||||||
}
|
|
||||||
.btn:hover {
|
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
||||||
}
|
|
||||||
.btn-primary { background: #2b6cb0; color: white; }
|
|
||||||
.btn-msi { background: #6b46c1; color: white; }
|
|
||||||
.btn-secondary { background: #edf2f7; color: #2d3748; }
|
|
||||||
.btn-icon { font-size: 1.3em; }
|
|
||||||
.btn-text small {
|
|
||||||
display: block;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 0.8em;
|
|
||||||
opacity: 0.75;
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: #a0aec0;
|
|
||||||
padding: 32px 0 0;
|
|
||||||
}
|
|
||||||
footer a { color: #718096; text-decoration: none; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<h1>⚡ QElectroTech</h1>
|
|
||||||
<p>Nightly Windows Builds</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main>
|
|
||||||
<div class="card">
|
|
||||||
<h2>Build info</h2>
|
|
||||||
<div class="meta">
|
|
||||||
📅 <strong>$DATE</strong><br>
|
|
||||||
🔀 Commit <a href="https://github.com/$REPO/commit/${{ github.sha }}"><code>$SHORT</code></a><br>
|
|
||||||
🔧 <a href="$RUN_URL">CI Run #${{ github.run_number }}</a>
|
|
||||||
<span class="badge">nightly</span>
|
|
||||||
</div>
|
|
||||||
<div class="warning">
|
|
||||||
⚠️ This is a development version; it introduces new features you want,
|
|
||||||
but may cause bugs that have not yet been identified yet in <code>master</code>.
|
|
||||||
For production use, download a
|
|
||||||
<a href="https://github.com/$REPO/releases">stable release</a>.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h2>🪟 Windows — x86_64</h2>
|
|
||||||
<div class="downloads">
|
|
||||||
<a class="btn btn-primary" href="$INSTALLER_URL">
|
|
||||||
<span class="btn-icon">⬇</span>
|
|
||||||
<span class="btn-text">
|
|
||||||
Windows Installer
|
|
||||||
<small>.exe — recommended, includes all dependencies</small>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
$MSI_BLOCK
|
|
||||||
<a class="btn btn-secondary" href="$PORTABLE_URL">
|
|
||||||
<span class="btn-icon">📦</span>
|
|
||||||
<span class="btn-text">
|
|
||||||
Windows Portable
|
|
||||||
<small>.zip — no installation required, extract and run the file "Lancer QET.bat"</small>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
<a class="btn btn-secondary" href="https://github.com/$REPO/releases/tag/nightly">
|
|
||||||
<span class="btn-icon">📦</span>
|
|
||||||
<span class="btn-text">
|
|
||||||
All nightly files on GitHub
|
|
||||||
<small>Release page with checksums</small>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
Auto-generated by GitHub Actions ·
|
|
||||||
<a href="https://github.com/$REPO">Source on GitHub</a> ·
|
|
||||||
<a href="https://qelectrotech.org">qelectrotech.org</a>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
HTMLEOF
|
|
||||||
|
|
||||||
- name: Add .nojekyll to disable Jekyll processing
|
- name: Add .nojekyll to disable Jekyll processing
|
||||||
run: touch gh-pages/.nojekyll
|
run: touch gh-pages/.nojekyll
|
||||||
|
|||||||
Reference in New Issue
Block a user