fix: set CGO_ENABLED to ensure static linking of the binary

This commit is contained in:
2026-01-10 20:05:33 +08:00
parent d1a5240c34
commit 1658469d0a

View File

@@ -38,6 +38,7 @@ jobs:
- name: Go build
run: |
cd ${{ gitea.workspace }}
set CGO_ENABLED=0 # 关闭 CGO 以确保生成的二进制文件是静态链接的
go build -ldflags "-X main.version=1.0.0-${{ gitea.sha }}" -o helloapp .
- name: Check Docker
run: |