test
Pure Run Build / build (push) Canceled after 10m52s

This commit is contained in:
2026-07-23 15:37:28 +08:00
parent d589182a0e
commit 62d6c3a081
+29 -2
View File
@@ -5,10 +5,37 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 安装基础工具 - name: 配置国内源并安装工具
run: | 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 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: 克隆当前仓库 - name: 克隆当前仓库
run: | run: |