Skip to content

Commit c0504e7

Browse files
committed
build with vcs info
golang-cross didn't properly work with VCS stamping, which goreleaser seems to require.
1 parent e578724 commit c0504e7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.goreleaser.yml

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ builds:
1616
main: ./cmd/gokeyless
1717
flags:
1818
- -tags=pkcs11,netgo
19-
- -buildvcs=false
2019
ldflags:
2120
- -s -w -X main.version={{.Version}}
2221
- id: gokeyless-linux
@@ -28,7 +27,6 @@ builds:
2827
main: ./cmd/gokeyless
2928
flags:
3029
- -tags=pkcs11,netgo
31-
- -buildvcs=false
3230
ldflags:
3331
- -s -w -X main.version={{.Version}}
3432
archives:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ release-github:
119119
-v /var/run/docker.sock:/var/run/docker.sock \
120120
-w /go/tmp \
121121
--env GITHUB_TOKEN \
122-
ghcr.io/gythialy/golang-cross:latest --clean
122+
ghcr.io/goreleaser/goreleaser-cross:latest --clean
123123

124124

125125
.PHONY: snapshot
126126
snapshot:
127127
docker run --rm --privileged -v $(PWD):/go/tmp \
128128
-v /var/run/docker.sock:/var/run/docker.sock \
129129
-w /go/tmp \
130-
ghcr.io/gythialy/golang-cross:latest --clean --snapshot --skip-publish
130+
ghcr.io/goreleaser/goreleaser-cross:latest --clean --snapshot --skip-publish
131131

cmd/gokeyless/gokeyless.go

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io"
99
"net"
1010
"os"
11+
"runtime/debug"
1112
"strconv"
1213
"strings"
1314
"time"
@@ -230,6 +231,10 @@ func runMain() error {
230231
return nil
231232
case versionMode:
232233
fmt.Println("gokeyless version", version)
234+
if info, ok := debug.ReadBuildInfo(); ok {
235+
fmt.Printf("%s built with %s\n", info.Path, info.GoVersion)
236+
}
237+
233238
return nil
234239
case manualMode && configMode:
235240
return fmt.Errorf("can't specify both --manual-activation and --config-only!")

0 commit comments

Comments
 (0)