From d4ccfc9fd8439e0f7d6290e7a4693d8ed547564a Mon Sep 17 00:00:00 2001 From: yaoge123 Date: Wed, 27 May 2026 05:36:26 +0800 Subject: [PATCH] release: fix version ldflags package path The ldflags reference github.com/ustclug/rsync-proxy/pkg/info.Version, but the version variables actually live in the cmd package (github.com/ustclug/rsync-proxy/cmd.Version). The Go linker silently ignores -X flags for unresolved symbols, so v0.1.4 binaries report Version=0.0.0, GitCommit=$Format:%H$, BuildDate=1970-01-01T00:00:00Z. Update the package path to match Makefile and the actual variable definitions in cmd/cmd.go. --- .goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 05dd3c9..d94622e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -14,7 +14,7 @@ builds: flags: - -trimpath ldflags: - - -s -w -X github.com/ustclug/rsync-proxy/pkg/info.Version={{.Version}} -X github.com/ustclug/rsync-proxy/pkg/info.BuildDate={{.Date}} -X github.com/ustclug/rsync-proxy/pkg/info.GitCommit={{.Commit}} + - -s -w -X github.com/ustclug/rsync-proxy/cmd.Version={{.Version}} -X github.com/ustclug/rsync-proxy/cmd.BuildDate={{.Date}} -X github.com/ustclug/rsync-proxy/cmd.GitCommit={{.Commit}} archives: - formats: binary name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"