Skip to content

Commit 3339e95

Browse files
committed
ci
1 parent 537b573 commit 3339e95

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
working-directory: ./scripts
2626
run: |
2727
# Windows 版本
28-
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.windows-amd64.exe .
29-
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.windows-386.exe .
28+
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.windows-amd64.exe .
29+
GOOS=windows GOARCH=386 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.windows-386.exe .
3030
3131
# macOS 版本
32-
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.darwin-amd64 .
33-
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.darwin-arm64 .
32+
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.darwin-amd64 .
33+
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.darwin-arm64 .
3434
3535
# Linux 版本
36-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.linux-amd64 .
37-
GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.linux-386 .
38-
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ../github-hosts.linux-arm64 .
36+
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.linux-amd64 .
37+
GOOS=linux GOARCH=386 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.linux-386 .
38+
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X main.Version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" -o ../github-hosts.linux-arm64 .
3939
4040
cd .. # Return to root directory for zip operations
4141

0 commit comments

Comments
 (0)