mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-11 03:39:59 +02:00
Update windows CI/CD pipeline
Some checks failed
Windows Build / build-windows (push) Has been cancelled
Some checks failed
Windows Build / build-windows (push) Has been cancelled
This commit is contained in:
337
.github/workflows/windows-build.yml
vendored
337
.github/workflows/windows-build.yml
vendored
@@ -14,12 +14,12 @@ concurrency:
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
@@ -28,6 +28,8 @@ jobs:
|
||||
update: true
|
||||
cache: true
|
||||
install: >-
|
||||
git
|
||||
mingw-w64-ucrt-x86_64-ccache
|
||||
mingw-w64-ucrt-x86_64-gcc
|
||||
mingw-w64-ucrt-x86_64-cmake
|
||||
mingw-w64-ucrt-x86_64-ninja
|
||||
@@ -43,14 +45,57 @@ jobs:
|
||||
mingw-w64-ucrt-x86_64-nsis
|
||||
mingw-w64-ucrt-x86_64-angleproject
|
||||
|
||||
- name: Force Qt5 — supprimer Qt6 cmake + tools
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: C:\Users\runneradmin\AppData\Local\ccache
|
||||
key: ccache-windows-${{ github.ref_name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-windows-${{ github.ref_name }}-
|
||||
ccache-windows-
|
||||
|
||||
- name: Configure ccache
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
/ucrt64/bin/ccache --set-config=max_size=500M
|
||||
/ucrt64/bin/ccache --set-config=compression=true
|
||||
/ucrt64/bin/ccache -z
|
||||
echo "=== ccache config ==="
|
||||
/ucrt64/bin/ccache -p
|
||||
|
||||
- name: Patch NSIS Welcome page — fix title font size
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
WELCOME_NSH=$(find /ucrt64 -path "*/Modern UI 2/Pages/Welcome.nsh" | head -1)
|
||||
if [ -z "$WELCOME_NSH" ]; then
|
||||
echo "WARNING: Welcome.nsh not found, skipping font patch"
|
||||
else
|
||||
echo "Patching: $WELCOME_NSH"
|
||||
# Target only the WelcomePage title CreateFont line and force size to 10
|
||||
sed -i '/WelcomePage\.Title\.Font/s/"[0-9]\+" "700"/"10" "700"/' "$WELCOME_NSH"
|
||||
grep 'WelcomePage.Title.Font' "$WELCOME_NSH"
|
||||
echo " OK font size patched to 10"
|
||||
fi
|
||||
|
||||
FINISH_NSH=$(find /ucrt64 -path "*/Modern UI 2/Pages/Finish.nsh" | head -1)
|
||||
if [ -z "$FINISH_NSH" ]; then
|
||||
echo "WARNING: Finish.nsh not found, skipping font patch"
|
||||
else
|
||||
echo "Patching: $FINISH_NSH"
|
||||
sed -i '/FinishPage\.Title\.Font/s/"[0-9]\+" "700"/"10" "700"/' "$FINISH_NSH"
|
||||
grep 'FinishPage.Title.Font' "$FINISH_NSH"
|
||||
echo " OK font size patched to 10"
|
||||
fi
|
||||
|
||||
- name: Force Qt5 — remove Qt6 cmake + tools
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf /ucrt64/lib/cmake/Qt6
|
||||
pacman -R --noconfirm mingw-w64-ucrt-x86_64-qt6-tools 2>/dev/null || true
|
||||
echo "=== windeployqt binaries ==="
|
||||
ls /ucrt64/bin/windeployqt* || echo "AUCUN windeployqt trouve !"
|
||||
ls /ucrt64/bin/windeployqt* || echo "NO windeployqt found!"
|
||||
|
||||
- name: Build with cmake
|
||||
shell: msys2 {0}
|
||||
@@ -58,6 +103,10 @@ jobs:
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
mkdir build && cd build
|
||||
# Detect the number of available CPUs
|
||||
NPROC=$(nproc)
|
||||
echo "Available CPUs: $NPROC"
|
||||
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH=/ucrt64 \
|
||||
@@ -66,8 +115,19 @@ jobs:
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_CXX_FLAGS="-DQET_EXPORT_PROJECT_DB" \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=/ucrt64/bin/ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=/ucrt64/bin/ccache \
|
||||
-DSQLite3_INCLUDE_DIR=/ucrt64/include \
|
||||
-DSQLite3_LIBRARY=/ucrt64/lib/libsqlite3.dll.a \
|
||||
..
|
||||
ninja
|
||||
ninja -j"$NPROC"
|
||||
|
||||
- name: Show ccache stats
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo "=== ccache statistics ==="
|
||||
/ucrt64/bin/ccache -s
|
||||
|
||||
- name: Verify exe was built
|
||||
shell: msys2 {0}
|
||||
@@ -75,15 +135,15 @@ jobs:
|
||||
set -euo pipefail
|
||||
EXE=$(find "$GITHUB_WORKSPACE/build" -maxdepth 3 -iname "qelectrotech.exe" | head -1)
|
||||
if [ -z "$EXE" ]; then
|
||||
echo "ERROR: aucun qelectrotech.exe trouve dans build/"
|
||||
echo "ERROR: no qelectrotech.exe found in build/"
|
||||
find "$GITHUB_WORKSPACE/build" -maxdepth 3 -name "*.exe" || true
|
||||
exit 1
|
||||
fi
|
||||
SIZE=$(stat -c%s "$EXE")
|
||||
echo "Exe trouve : $EXE ($SIZE octets)"
|
||||
[ "$SIZE" -gt 100000 ] || { echo "ERROR: exe trop petit"; exit 1; }
|
||||
echo "Exe found: $EXE ($SIZE bytes)"
|
||||
[ "$SIZE" -gt 100000 ] || { echo "ERROR: exe too small"; exit 1; }
|
||||
|
||||
- name: Deploy — copie exe + windeployqt + DLLs
|
||||
- name: Deploy — copy exe + windeployqt + DLLs
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -93,7 +153,7 @@ jobs:
|
||||
mkdir -p "$BIN"
|
||||
|
||||
EXE=$(find "$GITHUB_WORKSPACE/build" -maxdepth 3 -iname "qelectrotech.exe" | head -1)
|
||||
echo "Copie exe : $EXE -> $BIN/QElectroTech.exe"
|
||||
echo "Copying exe: $EXE -> $BIN/QElectroTech.exe"
|
||||
cp "$EXE" "$BIN/QElectroTech.exe"
|
||||
|
||||
cd "$BIN"
|
||||
@@ -101,167 +161,176 @@ jobs:
|
||||
--release \
|
||||
--no-translations \
|
||||
--no-compiler-runtime \
|
||||
--no-opengl-sw \
|
||||
./QElectroTech.exe || true
|
||||
ls -lh "$BIN/QElectroTech.exe" || { echo "ERROR: exe absent de bin/"; exit 1; }
|
||||
|
||||
# 3-pass ldd scan to capture all transitive DLLs
|
||||
echo "=== 3-pass transitive DLL scan ==="
|
||||
set +e # ldd may return non-zero exit codes on some files
|
||||
for PASS in 1 2 3; do
|
||||
echo "-- Pass $PASS --"
|
||||
for bin_file in "$BIN"/*.dll "$BIN"/*.exe "$BIN"/sqldrivers/*.dll "$BIN"/platforms/*.dll "$BIN"/imageformats/*.dll; do
|
||||
[ -f "$bin_file" ] || continue
|
||||
while IFS= read -r line; do
|
||||
dll_path=$(echo "$line" | awk '{print $3}')
|
||||
[ -f "$dll_path" ] || continue
|
||||
dll_name=$(basename "$dll_path")
|
||||
dst="$BIN/$dll_name"
|
||||
if [ ! -f "$dst" ]; then
|
||||
cp "$dll_path" "$dst"
|
||||
echo " Copied (pass $PASS): $dll_name"
|
||||
fi
|
||||
done < <(ldd "$bin_file" 2>/dev/null | grep -i '/ucrt64/bin/')
|
||||
done
|
||||
done
|
||||
set -e # re-enable
|
||||
|
||||
DLL_SCAN=$(ls -1 "$BIN/"*.dll 2>/dev/null | wc -l)
|
||||
echo "=== $DLL_SCAN DLLs present after scan ==="
|
||||
ls -lh "$BIN/QElectroTech.exe" || { echo "ERROR: exe missing from bin/"; exit 1; }
|
||||
DLL_COUNT=$(find "$BIN" -name "*.dll" | wc -l)
|
||||
echo "DLLs presentes : $DLL_COUNT"
|
||||
[ "$DLL_COUNT" -gt 5 ] || { echo "ERROR: trop peu de DLLs"; exit 1; }
|
||||
echo "DLLs present: $DLL_COUNT"
|
||||
[ "$DLL_COUNT" -gt 5 ] || { echo "ERROR: too few DLLs"; exit 1; }
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
# --- DLLs runtime compilateur (non copiées par windeployqt) ---
|
||||
# --- DLLs runtime : copie automatique via ldd ---
|
||||
# On copie d'abord les DLLs garanties (runtime GCC + KF5 + ICU)
|
||||
# car ldd ne les liste pas toujours toutes (chargement dynamique).
|
||||
echo "=== Copie DLLs runtime garanties ==="
|
||||
UCRT=/ucrt64/bin
|
||||
for dll in \
|
||||
libgcc_s_seh-1.dll \
|
||||
libstdc++-6.dll \
|
||||
libwinpthread-1.dll \
|
||||
libgomp-1.dll; do
|
||||
[ -f "$UCRT/$dll" ] && cp -v "$UCRT/$dll" "$BIN/" || echo "WARN: $dll non trouve"
|
||||
done
|
||||
cp -v "$UCRT"/libicu*.dll "$BIN/" 2>/dev/null || echo "WARN: libicu*.dll non trouvees"
|
||||
cp -v "$UCRT"/KF5*.dll "$BIN/" 2>/dev/null || echo "WARN: KF5*.dll non trouvees"
|
||||
cp /ucrt64/bin/libgcc_s_seh-1.dll "$BIN/"
|
||||
cp /ucrt64/bin/libstdc++-6.dll "$BIN/"
|
||||
cp /ucrt64/bin/libwinpthread-1.dll "$BIN/"
|
||||
# SQLite3 — explicit copy because ldd may not detect it
|
||||
# (statically linked via Qt or via a different path)
|
||||
SQLITE=$(find /ucrt64/bin -name "libsqlite3*.dll" | head -1)
|
||||
if [ -n "$SQLITE" ]; then
|
||||
cp "$SQLITE" "$BIN/"
|
||||
echo "SQLite3 copied: $(basename $SQLITE)"
|
||||
else
|
||||
echo "WARNING: libsqlite3 not found in /ucrt64/bin/"
|
||||
fi
|
||||
|
||||
# Copie automatique de toutes les dependances UCRT64 detectees par ldd
|
||||
echo "=== Copie automatique dependances ldd ==="
|
||||
ldd "$BIN/QElectroTech.exe" \
|
||||
| grep -i '/ucrt64/bin/' \
|
||||
| awk '{print $3}' \
|
||||
| while read -r dep; do
|
||||
cp -v "$dep" "$BIN/" 2>/dev/null || true
|
||||
done
|
||||
|
||||
# Passe recursive : certaines DLLs ont elles-memes des dependances UCRT64
|
||||
echo "=== Passe recursive sur les DLLs copiees ==="
|
||||
find "$BIN" -maxdepth 1 -name "*.dll" | while read -r lib; do
|
||||
ldd "$lib" 2>/dev/null \
|
||||
| grep -i '/ucrt64/bin/' \
|
||||
| awk '{print $3}' \
|
||||
| while read -r dep; do
|
||||
[ -f "$BIN/$(basename "$dep")" ] || cp -v "$dep" "$BIN/" 2>/dev/null || true
|
||||
done
|
||||
done
|
||||
|
||||
echo "DLLs totales apres runtime : $(find "$BIN" -name '*.dll' | wc -l)"
|
||||
|
||||
# --- Diagnostic final ---
|
||||
echo "=== ldd — dependances non resolues ==="
|
||||
ldd "$BIN/QElectroTech.exe" | grep -i "not found" || echo "Aucune dependance manquante detectee"
|
||||
# Seed nsis_root/ from the versioned base tree in the repository.
|
||||
# nsis_base/ contains: images/ and files/ static assets (ico, reg, bat, licenses...).
|
||||
# and files/ with pre-built static assets (reg, bat, ico, README, licenses...).
|
||||
# Copy NSIS scripts from build-aux/windows/ then merge the static base tree.
|
||||
# Copy NSIS scripts and support files from build-aux/windows/
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/QET64.nsi" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra.nsh" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_fr.nsh" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_missing.nsh" "$NSIS_ROOT/"
|
||||
# Copy static base assets (ico, reg, bat, images, Lancer QET.bat, ...)
|
||||
cp -r "$GITHUB_WORKSPACE/build-aux/windows/nsis_base/." "$NSIS_ROOT/"
|
||||
|
||||
# Layer build-time assets on top of the static base
|
||||
# Download Lancer QET.bat from misc/ into files/ (portable version)
|
||||
curl -fsSL "https://raw.githubusercontent.com/qelectrotech/qelectrotech-source-mirror/refs/heads/master/misc/Lancer%20QET.bat" -o "$FILES/Lancer QET.bat"
|
||||
cp -r "$GITHUB_WORKSPACE/elements" "$FILES/elements" || true
|
||||
cp -r "$GITHUB_WORKSPACE/lang" "$FILES/lang" || true
|
||||
cp -r "$GITHUB_WORKSPACE/titleblocks" "$FILES/titleblocks" || true
|
||||
cp -r "$GITHUB_WORKSPACE/examples" "$FILES/examples" || true
|
||||
cp -r "$GITHUB_WORKSPACE/fonts" "$FILES/fonts" || true
|
||||
cp -r "$GITHUB_WORKSPACE/ico" "$FILES/ico" || true
|
||||
|
||||
for f in LICENSE ChangeLog CREDIT README ELEMENTS.LICENSE \
|
||||
qet_uninstall_file_associations.reg register_filetypes.bat; do
|
||||
# Language files: start from repo lang/, then overlay .qm files built by CMake
|
||||
cp -r "$GITHUB_WORKSPACE/lang" "$FILES/lang" || true
|
||||
find "$GITHUB_WORKSPACE/build" -name "*.qm" -exec cp {} "$FILES/lang/" \; 2>/dev/null || true
|
||||
echo "=== .qm files in files/lang/ ==="
|
||||
ls "$FILES/lang/"*.qm 2>/dev/null | wc -l || echo "0 .qm files"
|
||||
|
||||
# Top-level doc files from the repository (override nsis_base stubs if present)
|
||||
for f in LICENSE ChangeLog CREDIT README ELEMENTS.LICENSE; do
|
||||
cp "$GITHUB_WORKSPACE/$f" "$FILES/$f" 2>/dev/null || true
|
||||
done
|
||||
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/QET64.nsi" "$NSIS_ROOT/"
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra.nsh" "$NSIS_ROOT/" || true
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_fr.nsh" "$NSIS_ROOT/" || true
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/lang_extra_missing.nsh" "$NSIS_ROOT/" || true
|
||||
cp -r "$GITHUB_WORKSPACE/build-aux/windows/images" "$NSIS_ROOT/" || true
|
||||
|
||||
if [ -f "$GITHUB_WORKSPACE/build-aux/windows/Lancer QET.bat" ]; then
|
||||
cp "$GITHUB_WORKSPACE/build-aux/windows/Lancer QET.bat" "$NSIS_ROOT/"
|
||||
else
|
||||
printf '@echo off\r\nstart "" "%%~dp0bin\\QElectroTech.exe" %%*\r\n' \
|
||||
> "$NSIS_ROOT/Lancer QET.bat"
|
||||
fi
|
||||
|
||||
- name: Ensure NSIS images (wizard.bmp + header.bmp)
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMG_SRC="$GITHUB_WORKSPACE/build-aux/windows/images"
|
||||
IMG_DST="$GITHUB_WORKSPACE/nsis_root/images"
|
||||
mkdir -p "$IMG_DST"
|
||||
|
||||
if [ -f "$IMG_SRC/wizard.bmp" ] && [ -f "$IMG_SRC/header.bmp" ]; then
|
||||
echo "Images trouvees dans le repo, copie directe."
|
||||
cp "$IMG_SRC/wizard.bmp" "$IMG_DST/wizard.bmp"
|
||||
cp "$IMG_SRC/header.bmp" "$IMG_DST/header.bmp"
|
||||
else
|
||||
echo "Images absentes du repo — generation avec ImageMagick."
|
||||
# wizard.bmp : 164x314 px, fond bleu QET, texte blanc
|
||||
convert \
|
||||
-size 164x314 \
|
||||
gradient:"#1a3a5c"-"#2e6da4" \
|
||||
-gravity Center \
|
||||
-fill white \
|
||||
-pointsize 13 \
|
||||
-annotate 0 "QElectroTech" \
|
||||
-type TrueColor \
|
||||
BMP3:"$IMG_DST/wizard.bmp"
|
||||
# header.bmp : 150x57 px, même palette
|
||||
convert \
|
||||
-size 150x57 \
|
||||
gradient:"#1a3a5c"-"#2e6da4" \
|
||||
-gravity Center \
|
||||
-fill white \
|
||||
-pointsize 11 \
|
||||
-annotate 0 "QElectroTech" \
|
||||
-type TrueColor \
|
||||
BMP3:"$IMG_DST/header.bmp"
|
||||
echo "BMPs generes."
|
||||
fi
|
||||
|
||||
echo "Contenu de nsis_root/images/ :"
|
||||
ls -lh "$IMG_DST/"
|
||||
# --- Verification: list present or missing files in files/ ---
|
||||
echo "=== Verification of key files in files/ ==="
|
||||
for f in LICENSE ChangeLog CREDIT README ELEMENTS.LICENSE \
|
||||
qet_uninstall_file_associations.reg register_filetypes.bat "Lancer QET.bat"; do
|
||||
[ -f "$FILES/$f" ] \
|
||||
&& echo " OK : $f" \
|
||||
|| echo " MISSING: $f"
|
||||
done
|
||||
for d in ico elements lang titleblocks fonts examples bin; do
|
||||
[ -d "$FILES/$d" ] \
|
||||
&& echo " OK : $d/" \
|
||||
|| echo " MISSING: $d/"
|
||||
done
|
||||
|
||||
- name: Extract version for installer name
|
||||
shell: msys2 {0}
|
||||
id: qet_version
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION=$(grep -A5 '^project(' "$GITHUB_WORKSPACE/CMakeLists.txt" \
|
||||
| grep -oP '(?<=VERSION )[0-9]+\.[0-9]+[0-9.]*' | head -1 || true)
|
||||
[ -z "$VERSION" ] && VERSION="dev"
|
||||
GIT_SHORT=$(git -C "$GITHUB_WORKSPACE" rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||
FULL_VERSION="${VERSION}+git${GIT_SHORT}_x86_64-win64"
|
||||
echo "version=$FULL_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "Detected version: $FULL_VERSION"
|
||||
|
||||
- name: Patch QET64.nsi — version uniquement
|
||||
# Short commit hash (same as the official packaging script)
|
||||
GITCOMMIT=$(git -C "$GITHUB_WORKSPACE" rev-parse --short HEAD)
|
||||
|
||||
# Cumulative revision number (trunk style) + project offset 473
|
||||
A=$(git -C "$GITHUB_WORKSPACE" rev-list HEAD --count)
|
||||
HEAD=$(( A + 473 ))
|
||||
|
||||
# Version read from qetversion.cpp — same logic as the official script
|
||||
VERSION=$(grep 'return QVersionNumber{' "$GITHUB_WORKSPACE/sources/qetversion.cpp" \
|
||||
| head -1 \
|
||||
| awk -F '{' '{ print $2 }' \
|
||||
| awk -F '}' '{ print $1 }' \
|
||||
| sed -e 's/,/./g' -e 's/ //g')
|
||||
[ -z "$VERSION" ] && VERSION="dev"
|
||||
|
||||
FULL_VERSION="${VERSION}-r${HEAD}-${GITCOMMIT}_x86_64-win64"
|
||||
echo "version=$FULL_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "base_version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "gitcommit=$GITCOMMIT" >> "$GITHUB_OUTPUT"
|
||||
echo "head=$HEAD" >> "$GITHUB_OUTPUT"
|
||||
echo "VERSION : $VERSION"
|
||||
echo "GITCOMMIT : $GITCOMMIT"
|
||||
echo "HEAD (rev) : $HEAD"
|
||||
echo "FULL : $FULL_VERSION"
|
||||
|
||||
- name: Patch QET64.nsi — version + exe name + absolute paths
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${{ steps.qet_version.outputs.version }}"
|
||||
NSI="$GITHUB_WORKSPACE/nsis_root/QET64.nsi"
|
||||
FILES_WIN=$(cygpath -w "$GITHUB_WORKSPACE/nsis_root/files")
|
||||
SCRIPT="$GITHUB_WORKSPACE/build-aux/windows/patch_nsi.py"
|
||||
|
||||
# Patch version uniquement.
|
||||
# Tous les chemins du .nsi sont relatifs (./files/, .\images\) et
|
||||
# sont resolus par makensis depuis nsis_root/ — aucun patch necessaire.
|
||||
sed -i "s|!define SOFT_VERSION .*|!define SOFT_VERSION \"${VERSION}\"|" "$NSI"
|
||||
python3 "$SCRIPT" "$NSI" "$VERSION" "$FILES_WIN"
|
||||
|
||||
echo "=== Verification ==="
|
||||
grep 'SOFT_VERSION' "$NSI" | head -1
|
||||
grep -m2 'nsis_root' "$NSI" | head -2
|
||||
echo "=== Contents of nsis_root/files/ ==="
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/files/"
|
||||
|
||||
echo '=== SOFT_VERSION ==='
|
||||
grep 'SOFT_VERSION' "$NSI"
|
||||
echo '=== Structure nsis_root ==='
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/"
|
||||
echo '=== Contenu files/bin (premiers fichiers) ==='
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/files/bin/" | head -10
|
||||
|
||||
- name: Build NSIS installer
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE/nsis_root"
|
||||
makensis QET64.nsi
|
||||
NSIS_ROOT="$GITHUB_WORKSPACE/nsis_root"
|
||||
cd "$NSIS_ROOT"
|
||||
echo "=== CWD : $(pwd) ==="
|
||||
|
||||
# MSYS2_ARG_CONV_EXCL prevents MSYS2 from converting /V4 to a POSIX path
|
||||
MSYS2_ARG_CONV_EXCL="*" makensis /V4 QET64.nsi
|
||||
RC=$?
|
||||
echo "=== Contents of nsis_root after makensis ==="
|
||||
ls "$NSIS_ROOT/"
|
||||
[ $RC -eq 0 ] || { echo "ERROR: makensis failed (exit $RC)"; exit 1; }
|
||||
|
||||
|
||||
- name: Move installer to dist/
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p "$GITHUB_WORKSPACE/dist"
|
||||
mv "$GITHUB_WORKSPACE/nsis_root"/Installer_QElectroTech-*.exe \
|
||||
"$GITHUB_WORKSPACE/dist/"
|
||||
|
||||
# Case-insensitive search to avoid glob issues
|
||||
INSTALLER=$(find "$GITHUB_WORKSPACE/nsis_root" -maxdepth 1 -iname "installer_*.exe" | head -1)
|
||||
if [ -z "$INSTALLER" ]; then
|
||||
echo "ERROR: no installer .exe found in nsis_root/"
|
||||
echo "=== Contents of nsis_root/ ==="
|
||||
ls "$GITHUB_WORKSPACE/nsis_root/"
|
||||
exit 1
|
||||
fi
|
||||
echo "Moving: $INSTALLER -> dist/"
|
||||
mv "$INSTALLER" "$GITHUB_WORKSPACE/dist/"
|
||||
|
||||
- name: Upload build logs on failure
|
||||
if: failure()
|
||||
@@ -273,10 +342,10 @@ jobs:
|
||||
nsis_root/files/bin/
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload portable (files/ sans installeur)
|
||||
- name: Upload portable (files/ without installer)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qelectrotech-windows-portable
|
||||
name: qelectrotech-${{ steps.qet_version.outputs.base_version }}+git${{ steps.qet_version.outputs.head }}-x86-win64-readytouse
|
||||
path: nsis_root/files/
|
||||
retention-days: 14
|
||||
|
||||
@@ -284,5 +353,5 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: qelectrotech-windows-installer
|
||||
path: dist/Installer_QElectroTech-*.exe
|
||||
path: dist/Installer_*.exe
|
||||
retention-days: 14
|
||||
|
||||
Reference in New Issue
Block a user