Skip to content

Commit 8820ee1

Browse files
authored
fix: 优化编译文件的大小
1 parent 58f76c7 commit 8820ee1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/main.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ jobs:
5555
run: |
5656
mkdir -p bin
5757
cd cmd
58-
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ../bin/speedtest-${{ matrix.goos }}-${{ matrix.goarch }} -v -ldflags="-extldflags=-static" .
59-
58+
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
59+
-o ../bin/speedtest-${{ matrix.goos }}-${{ matrix.goarch }} \
60+
-v \
61+
-ldflags="-extldflags=-static -s -w" \
62+
-trimpath \
63+
.
6064
- name: Upload New Assets
6165
run: |
6266
release_id=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/oneclickvirt/speedtest/releases/tags/output" | jq -r '.id')
@@ -129,4 +133,4 @@ jobs:
129133
# goarm: 6
130134
# - goos: linux
131135
# goarch: arm
132-
# goarm: 5
136+
# goarm: 5

0 commit comments

Comments
 (0)