Skip to content

Commit f937abd

Browse files
authored
Set Version via ldflags for releases (#855)
1 parent 7c586d4 commit f937abd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: .goreleaser.yml

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ builds:
1212
- CGO_ENABLED=0
1313
main: ./cmd/crane/main.go
1414
binary: crane
15+
flags:
16+
- -trimpath
17+
ldflags:
18+
- "-s -w -X github.com/google/go-containerregistry/cmd/crane/cmd.Version={{.Version}}"
1519
goarch:
1620
- amd64
1721
- arm
@@ -30,6 +34,10 @@ builds:
3034
- CGO_ENABLED=0
3135
main: ./cmd/gcrane/main.go
3236
binary: gcrane
37+
flags:
38+
- -trimpath
39+
ldflags:
40+
- "-s -w -X github.com/google/go-containerregistry/cmd/crane/cmd.Version={{.Version}}"
3341
goarch:
3442
- amd64
3543
- arm

0 commit comments

Comments
 (0)