mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-20 03:29:24 +08:00
fix: 优化构建二进制文件的命令,减少生成的文件大小
This commit is contained in:
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -29,12 +29,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
CGO_ENABLED: 0
|
||||||
run: |
|
run: |
|
||||||
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
|
BINARY_NAME=komari-agent-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
BINARY_NAME=${BINARY_NAME}.exe
|
BINARY_NAME=${BINARY_NAME}.exe
|
||||||
fi
|
fi
|
||||||
go build -o $BINARY_NAME
|
go build -trimpath -ldflags="-s -w" -o $BINARY_NAME
|
||||||
|
|
||||||
- name: Upload binary to release
|
- name: Upload binary to release
|
||||||
env:
|
env:
|
||||||
|
Reference in New Issue
Block a user