Skip to content

Commit 58ca234

Browse files
authored
fix(release): inject tag version into binaries (#23)
Signed-off-by: JSONbored <49853598+JSONbored@users.noreply.github.com>
1 parent 76b8a3c commit 58ca234

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.goreleaser.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ builds:
1212
binary: nightward
1313
env:
1414
- CGO_ENABLED=0
15+
ldflags:
16+
- -s -w -X github.com/jsonbored/nightward/internal/cli.version={{ .Version }}
1517
goos:
1618
- darwin
1719
- linux
@@ -24,6 +26,8 @@ builds:
2426
binary: nw
2527
env:
2628
- CGO_ENABLED=0
29+
ldflags:
30+
- -s -w -X github.com/jsonbored/nightward/internal/cli.version={{ .Version }}
2731
goos:
2832
- darwin
2933
- linux

internal/cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/jsonbored/nightward/internal/tui"
2424
)
2525

26-
const version = "0.1.0"
26+
var version = "0.1.0"
2727

2828
type Check struct {
2929
ID string `json:"id"`

0 commit comments

Comments
 (0)