ci(release): flush apt cache and force fresh mirror package index to fix 404 security packages
This commit is contained in:
@@ -35,15 +35,16 @@ jobs:
|
|||||||
if command -v apt-get >/dev/null 2>&1; then
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
echo "[*] Installing Python shared libraries, headers, NSIS via apt-get..."
|
echo "[*] Installing Python shared libraries, headers, NSIS via apt-get..."
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
$SUDO rm -rf /var/lib/apt/lists/* /var/cache/apt/* || true
|
||||||
$SUDO apt-get clean || true
|
$SUDO apt-get clean || true
|
||||||
$SUDO apt-get update --allow-releaseinfo-change -y || $SUDO apt-get update -y || true
|
$SUDO apt-get update --allow-releaseinfo-change -o Acquire::Check-Valid-Until=false -y || $SUDO apt-get update -y || 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")
|
||||||
echo "[*] Detected Python version: ${PY_VER}"
|
echo "[*] Detected Python version: ${PY_VER}"
|
||||||
$SUDO apt-get install -y --allow-unauthenticated --no-install-recommends \
|
$SUDO apt-get install -y --fix-missing --allow-unauthenticated --no-install-recommends \
|
||||||
nsis "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" \
|
nsis nsis-common "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" \
|
||||||
python3-dev libpython3-dev build-essential gcc make curl tar gzip zip unzip || true
|
python3-dev libpython3-dev build-essential gcc make curl tar gzip zip unzip || true
|
||||||
for pkg in nsis "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" python3-dev libpython3-dev build-essential; do
|
for pkg in nsis nsis-common "libpython${PY_VER}" "libpython${PY_VER}-dev" "python${PY_VER}-dev" python3-dev libpython3-dev build-essential; do
|
||||||
$SUDO apt-get install -y --allow-unauthenticated --no-install-recommends "$pkg" || true
|
$SUDO apt-get install -y --fix-missing --allow-unauthenticated --no-install-recommends "$pkg" || true
|
||||||
done
|
done
|
||||||
echo "[*] Verifying makensis:"
|
echo "[*] Verifying makensis:"
|
||||||
which makensis || echo "makensis not in PATH"
|
which makensis || echo "makensis not in PATH"
|
||||||
|
|||||||
@@ -150,8 +150,10 @@ def ensure_makensis():
|
|||||||
sudo = ["sudo"] if hasattr(os, "geteuid") and os.geteuid() != 0 and shutil.which("sudo") else []
|
sudo = ["sudo"] if hasattr(os, "geteuid") and os.geteuid() != 0 and shutil.which("sudo") else []
|
||||||
if shutil.which("apt-get"):
|
if shutil.which("apt-get"):
|
||||||
try:
|
try:
|
||||||
subprocess.run(sudo + ["apt-get", "update", "--allow-releaseinfo-change", "-y"], check=False)
|
subprocess.run(sudo + ["rm", "-rf", "/var/lib/apt/lists/*", "/var/cache/apt/*"], check=False)
|
||||||
subprocess.run(sudo + ["apt-get", "install", "-y", "--no-install-recommends", "nsis"], check=False)
|
subprocess.run(sudo + ["apt-get", "clean"], check=False)
|
||||||
|
subprocess.run(sudo + ["apt-get", "update", "--allow-releaseinfo-change", "-o", "Acquire::Check-Valid-Until=false", "-y"], check=False)
|
||||||
|
subprocess.run(sudo + ["apt-get", "install", "-y", "--fix-missing", "--no-install-recommends", "nsis", "nsis-common"], check=False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[!] Warning: Dynamic apt install failed: {e}")
|
print(f"[!] Warning: Dynamic apt install failed: {e}")
|
||||||
elif shutil.which("apk"):
|
elif shutil.which("apk"):
|
||||||
@@ -179,8 +181,10 @@ def ensure_libpython():
|
|||||||
py_ver = f"{sys.version_info.major}.{sys.version_info.minor}"
|
py_ver = f"{sys.version_info.major}.{sys.version_info.minor}"
|
||||||
sudo = ["sudo"] if hasattr(os, "geteuid") and os.geteuid() != 0 and shutil.which("sudo") else []
|
sudo = ["sudo"] if hasattr(os, "geteuid") and os.geteuid() != 0 and shutil.which("sudo") else []
|
||||||
try:
|
try:
|
||||||
subprocess.run(sudo + ["apt-get", "update", "--allow-releaseinfo-change", "-y"], check=False)
|
subprocess.run(sudo + ["rm", "-rf", "/var/lib/apt/lists/*", "/var/cache/apt/*"], check=False)
|
||||||
subprocess.run(sudo + ["apt-get", "install", "-y", "--no-install-recommends", f"libpython{py_ver}", "python3-dev", f"python{py_ver}-dev"], check=False)
|
subprocess.run(sudo + ["apt-get", "clean"], check=False)
|
||||||
|
subprocess.run(sudo + ["apt-get", "update", "--allow-releaseinfo-change", "-o", "Acquire::Check-Valid-Until=false", "-y"], check=False)
|
||||||
|
subprocess.run(sudo + ["apt-get", "install", "-y", "--fix-missing", "--no-install-recommends", f"libpython{py_ver}", "python3-dev", f"python{py_ver}-dev", "libpython3-dev"], check=False)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user