Files
dypid/.gitea/workflows/build_tool.yaml
YGXB_net af3a297bb4
All checks were successful
构建上传工具 / build (push) Successful in 59s
部署开发环境 / build-and-deploy (push) Successful in 1m11s
build(workflows): 优化Go安装方式,使用国内镜像并调整artifact版本
2025-09-09 23:46:26 +08:00

45 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 构建上传工具
on: [ push ]
jobs:
build:
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装Go镜像
run: |
# 使用国内镜像下载 Go
export GO_MIRROR_URL="https://mirrors.aliyun.com/golang"
wget $GO_MIRROR_URL/go1.25.1.linux-amd64.tar.gz -O go.tar.gz
# 解压并设置环境变量
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go.tar.gz
echo "/usr/local/go/bin" >> $GITHUB_PATH
env:
GOROOT: /usr/local/go
# - name: 安装Go
# uses: actions/setup-go@v5
# with:
# go-version-file: "go.mod"
- name: 构建上传工具
run: |
go env -w CGO_ENABLED=0 \
&& go env -w GOARCH=amd64 \
&& go env -w GOOS=windows \
&& go mod tidy \
&& cd ./tool \
&& go build -o 上传工具.exe
- name: 上传构建文件
uses: actions/upload-artifact@v3
with:
name: 上传工具
path: tool/上传工具.exe