ci(release): enhance Debian package installation loop and makensis binary resolution
This commit is contained in:
@@ -31,11 +31,17 @@ jobs:
|
|||||||
if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
|
if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
|
||||||
SUDO="sudo"
|
SUDO="sudo"
|
||||||
fi
|
fi
|
||||||
$SUDO apt-get update || true
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
$SUDO apt-get install -y --no-install-recommends \
|
$SUDO apt-get update -y || true
|
||||||
build-essential nsis curl tar gzip zip python3-dev libpython3-dev || true
|
|
||||||
PY_VER=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>/dev/null || echo "3.9")
|
PY_VER=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>/dev/null || echo "3.9")
|
||||||
$SUDO apt-get install -y --no-install-recommends "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" || true
|
echo "[*] Detected Python version: ${PY_VER}"
|
||||||
|
for pkg in nsis "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" python3-dev libpython3-dev build-essential gcc make curl tar gzip zip unzip; do
|
||||||
|
$SUDO apt-get install -y --no-install-recommends "$pkg" || true
|
||||||
|
done
|
||||||
|
echo "[*] Verifying makensis:"
|
||||||
|
which makensis || echo "makensis not in PATH"
|
||||||
|
echo "[*] Verifying libpython shared library:"
|
||||||
|
find /usr/lib /usr/local/lib -name "libpython*.so*" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
python3 compilation/ensure_pip.py
|
python3 compilation/ensure_pip.py
|
||||||
python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || python3 -m pip install --upgrade pip 2>/dev/null || true
|
python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || python3 -m pip install --upgrade pip 2>/dev/null || true
|
||||||
|
|||||||
@@ -140,23 +140,29 @@ def compile_nsis_installers():
|
|||||||
"""Compiles NSIS installers if makensis is available (native Linux/Windows)."""
|
"""Compiles NSIS installers if makensis is available (native Linux/Windows)."""
|
||||||
makensis_cmd = None
|
makensis_cmd = None
|
||||||
if shutil.which("makensis"):
|
if shutil.which("makensis"):
|
||||||
makensis_cmd = ["makensis"]
|
makensis_cmd = [shutil.which("makensis")]
|
||||||
|
elif os.path.exists("/usr/bin/makensis"):
|
||||||
|
makensis_cmd = ["/usr/bin/makensis"]
|
||||||
|
elif os.path.exists("/usr/local/bin/makensis"):
|
||||||
|
makensis_cmd = ["/usr/local/bin/makensis"]
|
||||||
elif os.path.exists(r"C:\Program Files (x86)\NSIS\makensis.exe"):
|
elif os.path.exists(r"C:\Program Files (x86)\NSIS\makensis.exe"):
|
||||||
makensis_cmd = [r"C:\Program Files (x86)\NSIS\makensis.exe"]
|
makensis_cmd = [r"C:\Program Files (x86)\NSIS\makensis.exe"]
|
||||||
elif os.path.exists(r"C:\Program Files\NSIS\makensis.exe"):
|
elif os.path.exists(r"C:\Program Files\NSIS\makensis.exe"):
|
||||||
makensis_cmd = [r"C:\Program Files\NSIS\makensis.exe"]
|
makensis_cmd = [r"C:\Program Files\NSIS\makensis.exe"]
|
||||||
|
|
||||||
if not makensis_cmd:
|
if not makensis_cmd:
|
||||||
|
print("[!] Note: NSIS compiler (makensis) not found in PATH or standard directories.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
compilation_dir = os.path.join(ROOT_DIR, "compilation")
|
||||||
success = True
|
success = True
|
||||||
for nsi in ["installer_client.nsi", "installer_server.nsi"]:
|
for nsi in ["installer_client.nsi", "installer_server.nsi"]:
|
||||||
nsi_path = os.path.join(ROOT_DIR, "compilation", nsi)
|
nsi_path = os.path.join(compilation_dir, nsi)
|
||||||
if os.path.exists(nsi_path):
|
if os.path.exists(nsi_path):
|
||||||
print(f"[*] Compiling NSIS script: {nsi} via {makensis_cmd[0]}...")
|
print(f"[*] Compiling NSIS script: {nsi} via {makensis_cmd[0]}...")
|
||||||
try:
|
try:
|
||||||
subprocess.run(makensis_cmd + [nsi_path], check=True)
|
subprocess.run(makensis_cmd + [nsi_path], cwd=compilation_dir, check=True)
|
||||||
print(f"[+] Successfully compiled {nsi}")
|
print(f"[+] Successfully compiled NSIS installer for {nsi}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[!] Warning: Failed to compile {nsi} with {makensis_cmd}: {e}")
|
print(f"[!] Warning: Failed to compile {nsi} with {makensis_cmd}: {e}")
|
||||||
success = False
|
success = False
|
||||||
|
|||||||
Reference in New Issue
Block a user