mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-10 04:43:15 +02:00
Compare commits
27 Commits
32733187b8
...
2ae9ec87bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ae9ec87bb | |||
| 76d311cb35 | |||
| b016cc9f54 | |||
| 526e39e909 | |||
| d781105dfd | |||
| f6b93c6b71 | |||
| 61319bbbd6 | |||
| 1b522c251b | |||
| acfdab77fa | |||
| 8e327448cc | |||
| 7a8cee0ce6 | |||
| 82b8e7947e | |||
| e542a05d3f | |||
| 0b337a1514 | |||
| 48fec1db98 | |||
| 31f946426b | |||
| efa74dd0f5 | |||
| 703797bb97 | |||
| ef75ee736a | |||
| 15e623ac5f | |||
| df82a1125d | |||
| 7edc2e0241 | |||
| 55ae3fc3c6 | |||
| 2f72e6164c | |||
| e40f9c6b72 | |||
| ef261a7afd | |||
| 1550944011 |
@@ -366,13 +366,17 @@ jobs:
|
||||
if: github.event_name != 'pull_request'
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout gh-pages branch
|
||||
- name: Checkout master (for build-aux scripts)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: gh-pages
|
||||
ref: master
|
||||
path: source
|
||||
sparse-checkout: build-aux/generate-page.py
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Download installer artifact
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -411,6 +415,9 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate download page (index.html)
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DATE: "placeholder"
|
||||
run: |
|
||||
DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
||||
SHORT="${{ github.sha }}"
|
||||
@@ -421,181 +428,25 @@ jobs:
|
||||
INSTALLER_URL="https://github.com/$REPO/releases/download/nightly/$EXE_NAME"
|
||||
ZIP_NAME=$(ls downloaded/portable/*.zip | xargs -I{} basename {})
|
||||
PORTABLE_URL="https://github.com/$REPO/releases/download/nightly/$ZIP_NAME"
|
||||
MSI_NAME=$(gh release view nightly --json assets --jq '.assets[].name' 2>/dev/null \
|
||||
| grep '\.msi$' | head -1 || echo "")
|
||||
MSI_URL=""
|
||||
[ -n "$MSI_NAME" ] && MSI_URL="https://github.com/$REPO/releases/download/nightly/$MSI_NAME"
|
||||
DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
||||
export DATE SHORT REPO SHA="${{ github.sha }}" RUN_URL
|
||||
export RUN_NUMBER="${{ github.run_number }}"
|
||||
export INSTALLER_URL PORTABLE_URL MSI_URL
|
||||
# Write the page generator script to /tmp (build-aux/ not available
|
||||
# in deploy-pages job which only checks out gh-pages branch)
|
||||
python3 source/build-aux/generate-page.py
|
||||
|
||||
mkdir -p gh-pages
|
||||
cat > gh-pages/index.html << HTMLEOF
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>QElectroTech – Nightly Builds</title>
|
||||
<style>
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
background: #f0f4f8;
|
||||
color: #2d3748;
|
||||
min-height: 100vh;
|
||||
}
|
||||
header {
|
||||
background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
|
||||
color: white;
|
||||
padding: 48px 24px 40px;
|
||||
text-align: center;
|
||||
}
|
||||
header h1 { font-size: 2.2em; letter-spacing: -0.5px; margin-bottom: 8px; }
|
||||
header p { opacity: 0.8; font-size: 1.05em; }
|
||||
main {
|
||||
max-width: 680px;
|
||||
margin: 40px auto;
|
||||
padding: 0 20px 60px;
|
||||
}
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 28px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
|
||||
}
|
||||
.card h2 {
|
||||
font-size: 1em;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: #718096;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.meta {
|
||||
font-size: 0.875em;
|
||||
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-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>
|
||||
- name: Add .nojekyll to disable Jekyll processing
|
||||
run: touch gh-pages/.nojekyll
|
||||
|
||||
<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>
|
||||
- name: Upload GitHub Pages artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: gh-pages/
|
||||
|
||||
<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>
|
||||
<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: Commit and push to gh-pages
|
||||
run: |
|
||||
cd gh-pages
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add index.html
|
||||
git diff --staged --quiet \
|
||||
|| git commit -m "nightly: build #${{ github.run_number }} (${{ github.sha }})"
|
||||
git push origin gh-pages
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
@@ -1,181 +1,238 @@
|
||||
name: Windows MSI (WiX v4)
|
||||
|
||||
# Ce workflow génère un installeur MSI pour QElectroTech.
|
||||
# Il s'appuie sur l'artifact produit par le job build-windows
|
||||
# (workflow windows-build.yml) et ne recompile pas le projet.
|
||||
#
|
||||
# Déclenchement :
|
||||
# - Automatiquement après un run réussi de windows-build.yml
|
||||
# - Manuellement (workflow_dispatch) pour tester
|
||||
name: Windows MSI (WiX v7)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Windows build"] # doit correspondre exactement au "name:" de windows-build.yml
|
||||
types: [completed]
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_id:
|
||||
description: "Run ID de windows-build.yml (laisse vide pour le dernier)"
|
||||
description: "Run ID of 'Windows Build' (leave empty for the latest successful run)"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
build-msi:
|
||||
name: Build MSI with WiX v4
|
||||
name: Build MSI with WiX v7
|
||||
runs-on: windows-latest
|
||||
# Ne tourne que si le build principal a réussi (ignoré en workflow_dispatch)
|
||||
if: >
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
|
||||
steps:
|
||||
# ----------------------------------------------------------------
|
||||
# 1. Checkout (pour récupérer QElectroTech.wxs)
|
||||
# 1. Checkout (to retrieve QElectroTech.wxs and sources)
|
||||
# ----------------------------------------------------------------
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
fetch-depth: 0
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 2. Télécharger l'artifact du build principal
|
||||
# L'artifact "qelectrotech-windows-installer-files" doit contenir
|
||||
# le dossier nsis_root/files/ (portable build).
|
||||
# Adapter le nom si nécessaire.
|
||||
# 2. Download the portable artifact from the main build
|
||||
# Requires windows-build.yml to upload an artifact named
|
||||
# "qelectrotech-windows-portable" (fixed name)
|
||||
# ----------------------------------------------------------------
|
||||
- name: Download build artifact (portable files)
|
||||
- name: Download portable artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: qelectrotech-windows-portable # nom de l'artifact dans windows-build.yml
|
||||
name: qelectrotech-windows-portable
|
||||
path: artifact\files
|
||||
# Si déclenchement manuel avec run_id précisé :
|
||||
run-id: ${{ github.event.inputs.run_id || github.event.workflow_run.id }}
|
||||
run-id: ${{ github.event.inputs.run_id || github.run_id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repository: ${{ github.repository }}
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 3. Lire la version depuis l'artifact ou le dépôt
|
||||
# 3. Extract version from sources
|
||||
# ----------------------------------------------------------------
|
||||
- name: Extract version
|
||||
id: version
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Lire la version dans CMakeLists.txt
|
||||
$cmake = Get-Content CMakeLists.txt -Raw
|
||||
if ($cmake -match 'project\s*\([^)]*VERSION\s+([\d]+\.[\d]+\.[\d]+)') {
|
||||
$ver = $Matches[1]
|
||||
# Version from qetversion.cpp (same logic as windows-build.yml)
|
||||
$src = Get-Content "sources\qetversion.cpp" -Raw -ErrorAction SilentlyContinue
|
||||
if ($src -match 'return QVersionNumber\{([^}]+)\}') {
|
||||
$ver = $Matches[1] -replace '\s','' -replace ',','.'
|
||||
} else {
|
||||
$ver = "0.0.0"
|
||||
# Fallback: CMakeLists.txt
|
||||
$cmake = Get-Content "CMakeLists.txt" -Raw
|
||||
if ($cmake -match 'project\s*\([^)]*VERSION\s+([\d]+\.[\d]+\.[\d]+)') {
|
||||
$ver = $Matches[1]
|
||||
} else {
|
||||
$ver = "0.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
# Version numérique MSI (4 chiffres obligatoire)
|
||||
# Numeric MSI version: 4 digits required (e.g. 0.100.1.0)
|
||||
$verMsi = "$ver.0"
|
||||
|
||||
# Version lisible avec git short SHA
|
||||
# Short SHA for the display version
|
||||
$sha = git rev-parse --short HEAD 2>$null
|
||||
if (-not $sha) { $sha = "unknown" }
|
||||
$verDisplay = "$ver+git$sha"
|
||||
|
||||
echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT
|
||||
echo "VERSION_DISPLAY=$verDisplay" >> $env:GITHUB_OUTPUT
|
||||
# Cumulative revision number (same calculation as windows-build.yml)
|
||||
$count = git rev-list HEAD --count 2>$null
|
||||
$rev = [int]$count + 473
|
||||
|
||||
$verDisplay = "${ver}-r${rev}-${sha}_x86_64-win64"
|
||||
|
||||
echo "VERSION_MSI=$verMsi" >> $env:GITHUB_OUTPUT
|
||||
echo "VERSION_DISPLAY=$verDisplay" >> $env:GITHUB_OUTPUT
|
||||
Write-Host "Version MSI : $verMsi"
|
||||
Write-Host "Version display : $verDisplay"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 4. Installer WiX v4 via dotnet tool
|
||||
# 4. Install WiX v7, accept EULA and install WixUI extension
|
||||
# All done in one step: PATH is updated within the same step
|
||||
# so wix is immediately available for eula and extension commands
|
||||
# ----------------------------------------------------------------
|
||||
- name: Install WiX v4
|
||||
- name: Install WiX v7
|
||||
shell: pwsh
|
||||
run: |
|
||||
dotnet tool install --global wix --version 4.*
|
||||
# Ajouter le chemin tools au PATH pour la session
|
||||
dotnet tool install --global wix --version 7.0.0
|
||||
# Update PATH immediately for the rest of this step
|
||||
$toolsPath = [System.IO.Path]::Combine($env:USERPROFILE, '.dotnet', 'tools')
|
||||
$env:PATH = "$toolsPath;$env:PATH"
|
||||
# Also export for subsequent steps
|
||||
echo $toolsPath >> $env:GITHUB_PATH
|
||||
# Accept OSMF EULA (official CI/CD method: writes a sentinel file)
|
||||
wix eula accept wix7
|
||||
# Install WixUI extension
|
||||
wix extension add WixToolset.UI.wixext/7.0.0
|
||||
Write-Host "WiX v7 installed, EULA accepted, UI extension added."
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 5. Installer l'extension WixUI (interface graphique MSI)
|
||||
# 5. Check that the WXS file exists in the repository
|
||||
# ----------------------------------------------------------------
|
||||
- name: Install WiX UI extension
|
||||
- name: Check WXS file
|
||||
shell: pwsh
|
||||
run: |
|
||||
wix extension add WixToolset.UI.wixext/4.*
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 6. Copier QElectroTech.wxs depuis build-aux/windows/
|
||||
# ----------------------------------------------------------------
|
||||
- name: Prepare WXS file
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Le fichier .wxs est versionné dans le dépôt
|
||||
$wxs = "build-aux\windows\QElectroTech.wxs"
|
||||
if (-not (Test-Path $wxs)) {
|
||||
Write-Error "Fichier WXS introuvable : $wxs"
|
||||
Write-Error "WXS file not found: $wxs"
|
||||
Write-Host "Contents of build-aux\windows\ :"
|
||||
Get-ChildItem "build-aux\windows\" -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
Copy-Item $wxs -Destination "QElectroTech.wxs"
|
||||
Write-Host "WXS prêt."
|
||||
Write-Host "WXS found: $wxs"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 7. Vérifier la structure de l'artifact
|
||||
# 6. Check the artifact structure and locate files/
|
||||
# ----------------------------------------------------------------
|
||||
- name: Check artifact structure
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Host "=== Contenu de artifact\files ==="
|
||||
Get-ChildItem -Path "artifact\files" -Recurse -Depth 2 |
|
||||
Write-Host "=== Contents of artifact\files (2 levels) ==="
|
||||
Get-ChildItem -Path "artifact\files" -Depth 2 |
|
||||
Select-Object FullName | Format-Table -AutoSize
|
||||
|
||||
# Search for qelectrotech.exe in the artifact
|
||||
$exe = Get-ChildItem -Path "artifact\files" -Filter "qelectrotech.exe" -Recurse | Select-Object -First 1
|
||||
if (-not $exe) {
|
||||
Write-Error "qelectrotech.exe introuvable dans l'artifact"
|
||||
Write-Error "qelectrotech.exe not found in artifact"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Executable : $($exe.FullName) ($([math]::Round($exe.Length/1MB,1)) MB)"
|
||||
Write-Host "Executable: $($exe.FullName) ($([math]::Round($exe.Length/1MB,1)) MB)"
|
||||
|
||||
# Identifier le dossier bin/ contenant l'exe
|
||||
$binDir = $exe.Directory.FullName
|
||||
echo "BIN_DIR=$binDir" >> $env:GITHUB_ENV
|
||||
|
||||
# FilesDir = parent de bin/ (équivalent de nsis_root\files\)
|
||||
# FilesDir = folder containing bin\
|
||||
$binDir = $exe.Directory.FullName
|
||||
$filesDir = Split-Path $binDir -Parent
|
||||
|
||||
echo "FILES_DIR=$filesDir" >> $env:GITHUB_ENV
|
||||
Write-Host "FILES_DIR : $filesDir"
|
||||
Write-Host "FILES_DIR: $filesDir"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 8. Construire le MSI avec wix build
|
||||
# 7. Convert LICENSE (GPL-2) to RTF for the WixUI licence screen
|
||||
# RTF is the only format accepted by Windows Installer.
|
||||
# The conversion wraps plain text lines in basic RTF markup.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Convert LICENSE to RTF
|
||||
shell: pwsh
|
||||
run: |
|
||||
$licSrc = "LICENSE"
|
||||
$licRtf = "$env:TEMP\License.rtf"
|
||||
|
||||
if (-not (Test-Path $licSrc)) {
|
||||
Write-Error "LICENSE file not found in repository root"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$lines = Get-Content $licSrc -Encoding UTF8
|
||||
|
||||
# RTF header — Courier New, 9pt, black
|
||||
$rtf = New-Object System.Text.StringBuilder
|
||||
[void]$rtf.AppendLine('{\rtf1\ansi\ansicpg1252\deff0')
|
||||
[void]$rtf.AppendLine('{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}}')
|
||||
[void]$rtf.AppendLine('{\colortbl;\red0\green0\blue0;}')
|
||||
[void]$rtf.AppendLine('\f0\fs18\cf1')
|
||||
|
||||
foreach ($line in $lines) {
|
||||
# Escape RTF special characters
|
||||
$escaped = $line `
|
||||
-replace '\\', '\\\\' `
|
||||
-replace '\{', '\{' `
|
||||
-replace '\}', '\}'
|
||||
[void]$rtf.AppendLine("$escaped\par")
|
||||
}
|
||||
|
||||
[void]$rtf.AppendLine('}')
|
||||
|
||||
[System.IO.File]::WriteAllText($licRtf, $rtf.ToString(), [System.Text.Encoding]::ASCII)
|
||||
echo "LICENSE_RTF=$licRtf" >> $env:GITHUB_ENV
|
||||
Write-Host "License.rtf generated: $licRtf ($([math]::Round((Get-Item $licRtf).Length/1KB,1)) KB)"
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 8. Replace Lancer QET.bat with the MSI-specific version
|
||||
# The portable version uses relative paths suited for the zip.
|
||||
# The MSI version uses %~dp0 to resolve paths relative to
|
||||
# the installation directory in Program Files.
|
||||
# ----------------------------------------------------------------
|
||||
- name: Replace Lancer QET.bat for MSI
|
||||
shell: pwsh
|
||||
run: |
|
||||
$bat = "$env:FILES_DIR\Lancer QET.bat"
|
||||
$content = "@echo off`r`nstart `"`" `"%~dp0bin\qelectrotech.exe`" --common-elements-dir=`"%~dp0elements/`" --common-tbt-dir=`"%~dp0titleblocks/`" --lang-dir=`"%~dp0lang/`" -style windowsvista`r`n"
|
||||
[System.IO.File]::WriteAllText($bat, $content, [System.Text.Encoding]::ASCII)
|
||||
Write-Host "Lancer QET.bat replaced for MSI installation."
|
||||
Write-Host "=== Content of new Lancer QET.bat ==="
|
||||
Get-Content $bat
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 9. Build the MSI
|
||||
# ----------------------------------------------------------------
|
||||
- name: Build MSI
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = "${{ steps.version.outputs.VERSION_MSI }}"
|
||||
$verDisplay = "${{ steps.version.outputs.VERSION_DISPLAY }}"
|
||||
$filesDir = $env:FILES_DIR
|
||||
$outputName = "QElectroTech-${verDisplay}_x86_64-win64.msi"
|
||||
$version = "${{ steps.version.outputs.VERSION_MSI }}"
|
||||
$verDisplay = "${{ steps.version.outputs.VERSION_DISPLAY }}"
|
||||
$filesDir = $env:FILES_DIR
|
||||
$licRtf = $env:LICENSE_RTF
|
||||
$wxs = "build-aux\windows\QElectroTech.wxs"
|
||||
$outputName = "QElectroTech-${verDisplay}.msi"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "dist" | Out-Null
|
||||
|
||||
Write-Host "=== wix build ==="
|
||||
Write-Host " WXS : $wxs"
|
||||
Write-Host " Version : $version"
|
||||
Write-Host " FilesDir : $filesDir"
|
||||
Write-Host " Output : $outputName"
|
||||
Write-Host " LicenseRtf : $licRtf"
|
||||
Write-Host " Output : dist\$outputName"
|
||||
|
||||
wix build QElectroTech.wxs `
|
||||
wix build $wxs `
|
||||
-arch x64 `
|
||||
-d "Version=$version" `
|
||||
-d "ProductVersion=$verDisplay" `
|
||||
-d "FilesDir=$filesDir" `
|
||||
-d "LicenseRtf=$licRtf" `
|
||||
-ext WixToolset.UI.wixext `
|
||||
-o "dist\$outputName"
|
||||
|
||||
if (-not (Test-Path "dist\$outputName")) {
|
||||
Write-Error "MSI non généré : dist\$outputName"
|
||||
Write-Error "MSI not generated: dist\$outputName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$size = [math]::Round((Get-Item "dist\$outputName").Length / 1MB, 1)
|
||||
Write-Host "MSI généré : dist\$outputName ($size MB)"
|
||||
Write-Host "MSI generated: dist\$outputName ($size MB) ✓"
|
||||
echo "MSI_NAME=$outputName" >> $env:GITHUB_ENV
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 9. Upload de l'artifact MSI
|
||||
# 10. Upload the MSI artifact
|
||||
# ----------------------------------------------------------------
|
||||
- name: Upload MSI artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -186,31 +243,33 @@ jobs:
|
||||
if-no-files-found: error
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 10. (Optionnel) Attacher le MSI à la release nightly
|
||||
# Décommenter si tu veux le MSI dans les releases GitHub
|
||||
# 11. Upload MSI to nightly release
|
||||
# The nightly release is created/updated by windows-build.yml.
|
||||
# The MSI is added here so the GitHub Pages can link to it.
|
||||
# ----------------------------------------------------------------
|
||||
# - name: Upload MSI to nightly release
|
||||
# uses: softprops/action-gh-release@v2
|
||||
# if: github.ref == 'refs/heads/master'
|
||||
# with:
|
||||
# tag_name: nightly
|
||||
# files: dist/*.msi
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload MSI to nightly release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: nightly
|
||||
files: dist/*.msi
|
||||
fail_on_unmatched_files: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# 11. Résumé
|
||||
# 12. Summary
|
||||
# ----------------------------------------------------------------
|
||||
- name: Summary
|
||||
if: always()
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Host "=== Résumé build MSI ==="
|
||||
Write-Host "=== MSI build summary ==="
|
||||
Write-Host "Version : ${{ steps.version.outputs.VERSION_DISPLAY }}"
|
||||
Write-Host "Image runner : ${{ runner.os }} / ${{ runner.arch }}"
|
||||
Write-Host "WiX : v7.0.0"
|
||||
Write-Host "Runner image : ${{ runner.os }} / ${{ runner.arch }}"
|
||||
if (Test-Path "dist\$env:MSI_NAME") {
|
||||
$size = [math]::Round((Get-Item "dist\$env:MSI_NAME").Length / 1MB, 1)
|
||||
Write-Host "MSI : $env:MSI_NAME ($size MB) ✓"
|
||||
} else {
|
||||
Write-Host "MSI : ÉCHEC ✗"
|
||||
Write-Host "MSI : FAILED ✗"
|
||||
}
|
||||
|
||||
@@ -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"""
|
||||
<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>"""
|
||||
|
||||
html = f"""<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>QElectroTech – Nightly Builds</title>
|
||||
<style>
|
||||
*,*::before,*::after{{box-sizing:border-box;margin:0;padding:0}}
|
||||
body{{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#f0f4f8;color:#2d3748;min-height:100vh}}
|
||||
header{{background:linear-gradient(135deg,#1a365d 0%,#2b6cb0 100%);color:white;padding:48px 24px 40px;text-align:center}}
|
||||
header h1{{font-size:2.2em;letter-spacing:-0.5px;margin-bottom:8px}}
|
||||
header p{{opacity:.8;font-size:1.05em}}
|
||||
main{{max-width:680px;margin:40px auto;padding:0 20px 60px}}
|
||||
.card{{background:white;border-radius:12px;padding:28px;margin-bottom:24px;box-shadow:0 2px 12px rgba(0,0,0,.08)}}
|
||||
.card h2{{font-size:1em;text-transform:uppercase;letter-spacing:.06em;color:#718096;margin-bottom:16px}}
|
||||
.meta{{font-size:.875em;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:.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:.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:.95em;font-weight:600;text-decoration:none;transition:transform .1s,box-shadow .1s}}
|
||||
.btn:hover{{transform:translateY(-1px);box-shadow:0 4px 12px rgba(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:.8em;opacity:.75;margin-top:1px}}
|
||||
footer{{text-align:center;font-size:.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/{sha}"><code>{short}</code></a><br>
|
||||
🔧 <a href="{run_url}">CI Run #{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 "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>"""
|
||||
|
||||
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")
|
||||
@@ -1,111 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
QElectroTech.wxs — WiX v4 installer definition
|
||||
Génère un MSI x64 pour QElectroTech (build MSYS2/UCRT64).
|
||||
QElectroTech.wxs - WiX v7 installer definition
|
||||
Generates a self-contained x64 MSI for QElectroTech (MSYS2/UCRT64 build).
|
||||
|
||||
Variables passées depuis la ligne de commande wix build :
|
||||
-d FilesDir=<chemin absolu vers nsis_root\files>
|
||||
-d Version=<version numérique ex. 0.100.1.0>
|
||||
-d ProductVersion=<version lisible ex. 0.100.1+git8754>
|
||||
Variables passed from the wix build command line:
|
||||
-d FilesDir=<absolute path to artifact\files>
|
||||
-d Version=<numeric version e.g. 0.100.1.0>
|
||||
-d ProductVersion=<display version e.g. 0.100.1-r8770-abc1234_x86_64-win64>
|
||||
-d LicenseRtf=<absolute path to License.rtf>
|
||||
-->
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||||
|
||||
<Package
|
||||
Name="QElectroTech"
|
||||
Manufacturer="QElectroTech Team"
|
||||
Version="!(bind.Variable.Version)"
|
||||
Version="$(var.Version)"
|
||||
UpgradeCode="A1B2C3D4-E5F6-7890-ABCD-EF1234567890"
|
||||
Language="1033"
|
||||
Codepage="1252"
|
||||
InstallerVersion="500"
|
||||
Scope="perMachine">
|
||||
|
||||
<!-- Permet la mise à jour en place (désinstalle l'ancienne version automatiquement) -->
|
||||
<!-- Embed all cabinet files inside the MSI (self-contained installer) -->
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<!-- In-place upgrade: automatically uninstalls the previous version -->
|
||||
<MajorUpgrade
|
||||
DowngradeErrorMessage="Une version plus récente de QElectroTech est déjà installée."
|
||||
DowngradeErrorMessage="A newer version of QElectroTech is already installed."
|
||||
Schedule="afterInstallInitialize" />
|
||||
|
||||
<!-- Répertoire d'installation par défaut -->
|
||||
<!-- Installation directory -->
|
||||
<StandardDirectory Id="ProgramFiles64Folder">
|
||||
<Directory Id="INSTALLDIR" Name="QElectroTech" />
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- ============================================================
|
||||
Composants : exe principal
|
||||
All application files harvested in one pass from files\**
|
||||
============================================================ -->
|
||||
<ComponentGroup Id="CG_Exe" Directory="INSTALLDIR">
|
||||
<Component Id="C_MainExe" Guid="B1C2D3E4-F5A6-7890-BCDE-F12345678901">
|
||||
<File Id="qelectrotech_exe"
|
||||
Source="!(bind.Variable.FilesDir)\bin\qelectrotech.exe"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C_LauncherBat" Guid="C2D3E4F5-A6B7-8901-CDEF-123456789012">
|
||||
<File Id="lancer_qet_bat"
|
||||
Source="!(bind.Variable.FilesDir)\..\Lancer QET.bat"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
<ComponentGroup Id="CG_AllFiles" Directory="INSTALLDIR">
|
||||
<Files Include="$(var.FilesDir)\**" />
|
||||
</ComponentGroup>
|
||||
|
||||
<!-- ============================================================
|
||||
Composants : DLLs (bin\)
|
||||
============================================================ -->
|
||||
<ComponentGroup Id="CG_Dlls" Directory="INSTALLDIR">
|
||||
<Component Id="C_Dlls" Guid="D3E4F5A6-B7C8-9012-DEF0-234567890123">
|
||||
<!-- Harvest automatique de tout bin\ sauf l'exe principal -->
|
||||
<Files Include="!(bind.Variable.FilesDir)\bin\**"
|
||||
Exclude="!(bind.Variable.FilesDir)\bin\qelectrotech.exe" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<!-- ============================================================
|
||||
Composants : données applicatives
|
||||
============================================================ -->
|
||||
<ComponentGroup Id="CG_Elements" Directory="INSTALLDIR">
|
||||
<Component Id="C_Elements" Guid="E4F5A6B7-C8D9-0123-EF01-345678901234">
|
||||
<Files Include="!(bind.Variable.FilesDir)\elements\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Lang" Directory="INSTALLDIR">
|
||||
<Component Id="C_Lang" Guid="F5A6B7C8-D9E0-1234-F012-456789012345">
|
||||
<Files Include="!(bind.Variable.FilesDir)\lang\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Titleblocks" Directory="INSTALLDIR">
|
||||
<Component Id="C_Titleblocks" Guid="A6B7C8D9-E0F1-2345-0123-567890123456">
|
||||
<Files Include="!(bind.Variable.FilesDir)\titleblocks\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Examples" Directory="INSTALLDIR">
|
||||
<Component Id="C_Examples" Guid="B7C8D9E0-F1A2-3456-1234-678901234567">
|
||||
<Files Include="!(bind.Variable.FilesDir)\examples\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Fonts" Directory="INSTALLDIR">
|
||||
<Component Id="C_Fonts" Guid="C8D9E0F1-A2B3-4567-2345-789012345678">
|
||||
<Files Include="!(bind.Variable.FilesDir)\fonts\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Icons" Directory="INSTALLDIR">
|
||||
<Component Id="C_Icons" Guid="D9E0F1A2-B3C4-5678-3456-890123456789">
|
||||
<Files Include="!(bind.Variable.FilesDir)\ico\**" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG_Misc" Directory="INSTALLDIR">
|
||||
<Component Id="C_License" Guid="E0F1A2B3-C4D5-6789-4567-901234567890">
|
||||
<File Id="LICENSE"
|
||||
Source="!(bind.Variable.FilesDir)\LICENSE"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<!-- ============================================================
|
||||
Raccourcis bureau + menu démarrer
|
||||
Desktop + Start Menu shortcuts
|
||||
============================================================ -->
|
||||
<ComponentGroup Id="CG_Shortcuts" Directory="INSTALLDIR">
|
||||
<Component Id="C_ShortcutDesktop" Guid="F1A2B3C4-D5E6-7890-5678-012345678901">
|
||||
@@ -136,7 +74,9 @@
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<!-- Association fichier .qet -->
|
||||
<!-- ============================================================
|
||||
.qet file association
|
||||
============================================================ -->
|
||||
<ComponentGroup Id="CG_FileAssoc" Directory="INSTALLDIR">
|
||||
<Component Id="C_FileAssoc" Guid="B3C4D5E6-F7A8-9012-7890-234567890123">
|
||||
<RegistryValue Root="HKCR" Key=".qet" Type="string" Value="QElectroTech.Document" KeyPath="yes" />
|
||||
@@ -149,35 +89,30 @@
|
||||
</ComponentGroup>
|
||||
|
||||
<!-- ============================================================
|
||||
Icône (pour les raccourcis)
|
||||
Icon for shortcuts
|
||||
============================================================ -->
|
||||
<Icon Id="qet.ico" SourceFile="!(bind.Variable.FilesDir)\ico\qelectrotech.ico" />
|
||||
<Icon Id="qet.ico" SourceFile="$(var.FilesDir)\ico\qelectrotech.ico" />
|
||||
|
||||
<!-- ============================================================
|
||||
Feature principale (tout inclus)
|
||||
Main feature (everything included)
|
||||
============================================================ -->
|
||||
<Feature Id="ProductFeature" Title="QElectroTech" Level="1">
|
||||
<ComponentGroupRef Id="CG_Exe" />
|
||||
<ComponentGroupRef Id="CG_Dlls" />
|
||||
<ComponentGroupRef Id="CG_Elements" />
|
||||
<ComponentGroupRef Id="CG_Lang" />
|
||||
<ComponentGroupRef Id="CG_Titleblocks" />
|
||||
<ComponentGroupRef Id="CG_Examples" />
|
||||
<ComponentGroupRef Id="CG_Fonts" />
|
||||
<ComponentGroupRef Id="CG_Icons" />
|
||||
<ComponentGroupRef Id="CG_Misc" />
|
||||
<ComponentGroupRef Id="CG_AllFiles" />
|
||||
<ComponentGroupRef Id="CG_Shortcuts" />
|
||||
<ComponentGroupRef Id="CG_FileAssoc" />
|
||||
</Feature>
|
||||
|
||||
<!-- UI standard Windows Installer -->
|
||||
<UIRef Id="WixUI_Minimal" />
|
||||
<!-- WixUI_Minimal with QElectroTech GPL-2 license -->
|
||||
<ui:WixUI Id="WixUI_Minimal" />
|
||||
|
||||
<!-- Propriétés affichées dans Programmes et fonctionnalités -->
|
||||
<!-- WixVariable without ui: namespace, at Package level -->
|
||||
<WixVariable Id="WixUILicenseRtf" Value="$(var.LicenseRtf)" />
|
||||
|
||||
<!-- Properties shown in Programs and Features -->
|
||||
<Property Id="ARPPRODUCTICON" Value="qet.ico" />
|
||||
<Property Id="ARPHELPLINK" Value="https://qelectrotech.org" />
|
||||
<Property Id="ARPURLINFOABOUT" Value="https://qelectrotech.org" />
|
||||
<Property Id="ARPCOMMENTS" Value="Logiciel libre de schémas électriques" />
|
||||
<Property Id="ARPCOMMENTS" Value="Free electrical schematic editor" />
|
||||
|
||||
</Package>
|
||||
</Wix>
|
||||
|
||||
Reference in New Issue
Block a user