From 790c1b584090b3bc7908dc25ab02abc0348c703e Mon Sep 17 00:00:00 2001 From: coolxitech Date: Sat, 13 Dec 2025 17:06:31 +0800 Subject: [PATCH] =?UTF-8?q?chore(ci):=20=E4=BC=98=E5=8C=96=20GitHub=20Acti?= =?UTF-8?q?ons=20=E6=9E=84=E5=BB=BA=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 强制指定使用 bash shell,解决 Windows 环境下的执行错误 - 在构建前运行 go mod tidy,确保依赖整洁 - 保留编译过程中的控制台输出,便于调试追踪 --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5457ab..e1b477e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,11 +73,16 @@ jobs: env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} + shell: bash # 强制指定使用 bash,解决 Windows 下的语法错误 run: | # 初始化 go.mod (如果不存在) if [ ! -f go.mod ]; then go mod init ogame-app fi + + # 整理依赖(确保编译环境干净) + go mod tidy + # 编译命令,保留控制台 go build -ldflags="-s -w" -o ${{ matrix.executable }} main.go