From 000a6afc081f3e67668350eb32b41a66b2e62421 Mon Sep 17 00:00:00 2001 From: xfy Date: Fri, 12 Jun 2026 16:23:00 +0800 Subject: [PATCH] ci: use Aliyun Go mirror and goproxy.cn for China network go.dev/dl redirects to dl.google.com which is blocked in China. Use mirrors.aliyun.com for Go toolchain download and goproxy.cn for Go module proxy. --- .gitea/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5e7ad51..03e1650 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,6 +10,10 @@ on: permissions: contents: read +env: + GO_MIRROR: https://mirrors.aliyun.com/golang + GOPROXY: https://goproxy.cn,direct + jobs: lint: name: Lint @@ -20,7 +24,7 @@ jobs: - name: Install Go run: | GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}') - curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - + curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - echo "/usr/local/go/bin" >> $GITHUB_PATH echo "$(go env GOPATH)/bin" >> $GITHUB_PATH @@ -48,7 +52,7 @@ jobs: - name: Install Go run: | GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}') - curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - + curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - echo "/usr/local/go/bin" >> $GITHUB_PATH - name: Run unit tests @@ -66,7 +70,7 @@ jobs: - name: Install Go run: | GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}') - curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - + curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf - echo "/usr/local/go/bin" >> $GITHUB_PATH - name: Build