From 164e0d143714afd470473f18417c8050e618bb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:22:30 +0800 Subject: [PATCH] =?UTF-8?q?```=20chore(.woodpecker):=20=E6=9B=B4=E6=96=B0C?= =?UTF-8?q?I=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=B8=AD=E7=9A=84apt=E6=BA=90?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为了解决Debian版本兼容性问题,将apt源从bookworm升级到trixie版本, 并优化了源配置流程以提高构建稳定性。 ``` --- .woodpecker/my-first-workflow.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.woodpecker/my-first-workflow.yaml b/.woodpecker/my-first-workflow.yaml index 57794ecb0..7858e40af 100644 --- a/.woodpecker/my-first-workflow.yaml +++ b/.woodpecker/my-first-workflow.yaml @@ -77,14 +77,21 @@ steps: GO111MODULE: on GOSUMDB: off commands: + # 1. 备份原有源(可选) + - cp /etc/apt/sources.list /etc/apt/sources.list.bak + # 2. 清空主源文件(关键:先删空,再写入) - > - echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware - deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware - deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware" > /etc/apt/sources.list - - # 1. 更新源(用 apt-get 消除 CLI 不稳定警告,适配 CI) - - apt-get update -y - # 2. 安装正确的 upx 包(Debian 中包名是 upx-ucl,不是 upx) + echo "" > /etc/apt/sources.list + # 3. 写入阿里云trixie源(匹配golang:1.25的系统版本,避免版本混跑) + - > + echo "deb http://mirrors.aliyun.com/debian/ trixie main contrib non-free non-free-firmware + deb http://mirrors.aliyun.com/debian/ trixie-updates main contrib non-free non-free-firmware + deb http://mirrors.aliyun.com/debian-security/ trixie-security main contrib non-free non-free-firmware" > /etc/apt/sources.list + # 4. 删除sources.list.d下的所有额外源(彻底杜绝官方源) + - rm -rf /etc/apt/sources.list.d/* + # 5. 强制更新,加超时和缓存清理(解决卡住问题) + - apt-get clean && apt-get update -y -o Acquire::Timeout=30 + # 2. 安装正确的 upx 包(Debian 中包名是 upx-ucl,不是 upx) - apt-get install -y upx-ucl - cd blazing