fix: set CGO_ENABLED to ensure static linking of the binary
This commit is contained in:
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user