mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
chore(ci): 优化 GitHub Actions 构建流程
- 强制指定使用 bash shell,解决 Windows 环境下的执行错误 - 在构建前运行 go mod tidy,确保依赖整洁 - 保留编译过程中的控制台输出,便于调试追踪
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -73,11 +73,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
shell: bash # 强制指定使用 bash,解决 Windows 下的语法错误
|
||||||
run: |
|
run: |
|
||||||
# 初始化 go.mod (如果不存在)
|
# 初始化 go.mod (如果不存在)
|
||||||
if [ ! -f go.mod ]; then
|
if [ ! -f go.mod ]; then
|
||||||
go mod init ogame-app
|
go mod init ogame-app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 整理依赖(确保编译环境干净)
|
||||||
|
go mod tidy
|
||||||
|
|
||||||
# 编译命令,保留控制台
|
# 编译命令,保留控制台
|
||||||
go build -ldflags="-s -w" -o ${{ matrix.executable }} main.go
|
go build -ldflags="-s -w" -o ${{ matrix.executable }} main.go
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user