From 61e89d04a76b3216901b5dd0da2cc60c9f4c68f1 Mon Sep 17 00:00:00 2001 From: robojerk Date: Sat, 6 Sep 2025 11:29:59 -0700 Subject: [PATCH] Add back apt-cacher-ng support for faster builds - Restore apt-cacher-ng detection and configuration like composefs CI - Use proxy sources when apt-cacher-ng is available (192.168.1.101:3142) - Fallback to standard Debian mirrors when apt-cacher-ng is not available - This should resolve the GPG key verification issues - Follows the same pattern as the working composefs CI --- .forgejo/workflows/ci.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index ab4d43f..28271aa 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -27,11 +27,20 @@ jobs: run: | echo "Setting up Debian environment for building..." - # Add Debian repositories - echo "Adding Debian unstable repositories..." - echo "deb http://deb.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list - echo "deb-src http://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list - + # Try apt-cacher-ng first, fallback to Debian's automatic mirror selection + echo "Checking for apt-cacher-ng availability..." + + # Quick check with timeout to avoid hanging + if timeout 10 curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then + echo "✅ apt-cacher-ng is available, configuring proxy sources..." + echo "deb http://192.168.1.101:3142/ftp.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list + echo "deb-src http://192.168.1.101:3142/ftp.us.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list + else + echo "⚠️ apt-cacher-ng not available, using standard Debian mirrors..." + echo "deb http://deb.debian.org/debian unstable main" | sudo tee /etc/apt/sources.list.d/debian-unstable.list + echo "deb-src http://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list.d/debian-unstable.list + fi + # Add Debian keyring sudo apt update sudo apt install -y debian-archive-keyring