From 62d6c3a0810eab6d8d9d0dba382149d38a1821ae Mon Sep 17 00:00:00 2001 From: lj Date: Thu, 23 Jul 2026 15:37:28 +0800 Subject: [PATCH] test --- .gitea/workflows/go-ci.yaml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/go-ci.yaml b/.gitea/workflows/go-ci.yaml index 770b705..4631a45 100644 --- a/.gitea/workflows/go-ci.yaml +++ b/.gitea/workflows/go-ci.yaml @@ -5,10 +5,37 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: 安装基础工具 + - name: 配置国内源并安装工具链 run: | + set -e + + # ========== 1. 换 apt 国内源(清华,Ubuntu 22.04 jammy) ========== + cp /etc/apt/sources.list /etc/apt/sources.list.bak + cat > /etc/apt/sources.list <<'EOF' + deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse + deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse + deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse + EOF + apt-get update - apt-get install -y git golang-go + apt-get install -y golang-go git nodejs npm + + # ========== 2. 配置 Go 国内源 ========== + # 七牛 goproxy.cn(国内最快之一) + go env -w GOPROXY=https://goproxy.cn,direct + # 同时关掉校验 sumdb 的境外访问(可选) + go env -w GOSUMDB=sum.golang.org + go env -w GONOSUMCHECK=1 + # 如果私有仓库,可加(按需) + # go env -w GOPRIVATE=git.yourdomain.com + + # ========== 3. 配置 npm 国内源 ========== + npm config set registry https://registry.npmmirror.com + + echo "==> 源配置完成" + go version + node -v + npm -v - name: 克隆当前仓库 run: |