From f7584320f9b9706d2bd8080c2209983d37269e3c Mon Sep 17 00:00:00 2001 From: max Date: Fri, 25 Sep 2026 22:27:50 +0200 Subject: [PATCH] ci: harden debian container package installation and pip bootstrapping against stale apt mirror lists --- .gitea/workflows/ci.yml | 17 ++++++++++++++--- .gitea/workflows/release.yml | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 789732a..d84559d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -23,11 +23,22 @@ jobs: - name: Install System Dependencies & Python run: | if command -v apt-get >/dev/null 2>&1; then - apt-get update -y - apt-get install -y python3 python3-pip python3-venv curl + export DEBIAN_FRONTEND=noninteractive + if [ -f /etc/apt/sources.list ]; then + sed -i 's|deb.debian.org/debian-security bullseye-security|security.debian.org/debian-security bullseye-security|g' /etc/apt/sources.list 2>/dev/null || true + fi + rm -rf /var/lib/apt/lists/* + apt-get update -y || apt-get update --fix-missing -y || true + apt-get install -y --no-install-recommends python3 python3-pip python3-venv curl || apt-get install -y --fix-missing python3 python3-pip python3-venv curl || true + fi + if ! command -v pip3 >/dev/null 2>&1 && ! python3 -m pip --version >/dev/null 2>&1; then + if command -v curl >/dev/null 2>&1; then + curl -sS https://bootstrap.pypa.io/get-pip.py | python3 || true + fi fi python3 -m pip install --upgrade pip --break-system-packages || python3 -m pip install --upgrade pip || true - pip3 install -r compilation/requirements.txt --break-system-packages || pip3 install -r compilation/requirements.txt + python3 -m pip install -r compilation/requirements.txt --break-system-packages || python3 -m pip install -r compilation/requirements.txt || pip3 install -r compilation/requirements.txt + - name: Verify Python Syntax run: | diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 16c7b61..fefe93a 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -22,11 +22,22 @@ jobs: - name: Install Python and Build Dependencies run: | if command -v apt-get >/dev/null 2>&1; then - apt-get update -y - apt-get install -y python3 python3-pip python3-venv binutils zip + export DEBIAN_FRONTEND=noninteractive + if [ -f /etc/apt/sources.list ]; then + sed -i 's|deb.debian.org/debian-security bullseye-security|security.debian.org/debian-security bullseye-security|g' /etc/apt/sources.list 2>/dev/null || true + fi + rm -rf /var/lib/apt/lists/* + apt-get update -y || apt-get update --fix-missing -y || true + apt-get install -y --no-install-recommends python3 python3-pip python3-venv binutils zip curl || apt-get install -y --fix-missing python3 python3-pip python3-venv binutils zip curl || true + fi + if ! command -v pip3 >/dev/null 2>&1 && ! python3 -m pip --version >/dev/null 2>&1; then + if command -v curl >/dev/null 2>&1; then + curl -sS https://bootstrap.pypa.io/get-pip.py | python3 || true + fi fi python3 -m pip install --upgrade pip --break-system-packages || python3 -m pip install --upgrade pip || true - pip3 install pyinstaller -r compilation/requirements.txt --break-system-packages || pip3 install pyinstaller -r compilation/requirements.txt + python3 -m pip install pyinstaller -r compilation/requirements.txt --break-system-packages || python3 -m pip install pyinstaller -r compilation/requirements.txt || pip3 install pyinstaller -r compilation/requirements.txt + - name: Compile Standalone Linux Binaries run: |