Skip to content

Commit

Permalink
ci: add goreleaser ldflags to inject the version
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Santos committed Mar 8, 2023
1 parent aa7b1dd commit c9ebd11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ builds:
- arm64
tags:
- netgo
# Custom ldflags templates.
ldflags:
- -X "main.version={{ .Version }}"
- -X "main.commit={{ .Commit }}"
- -X "main.date={{ .Date }}"

archives:
-
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var (
version = "0.2.0"
version = "dev"
build = "0"
)

Expand Down

0 comments on commit c9ebd11

Please sign in to comment.