Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reported version in --version output #87

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ builds:
- "7"
ldflags:
- -s -w
- -X github.com/metal-toolbox/version.appName={{.ProjectName}}
- -X github.com/metal-toolbox/version.version={{.Version}}
- -X github.com/metal-toolbox/version.commit={{.Commit}}
- -X github.com/metal-toolbox/version.date={{.Date}}
- -X github.com/metal-toolbox/version.builtBy=goreleaser
- -X github.com/metal-toolbox/vogelkop/internal/version.version={{.Summary}}

dockers:
- use: buildx
Expand All @@ -36,7 +32,7 @@ dockers:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.version={{.Summary}}"
extra_files:
- dependencies/.gitignore
- use: buildx
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package version

var (
name = "vogelkop"
version = "0.2.5"
version = "devel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd be updating this with each 'release'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't documented and I missed it and I assumed goreleaser was taking care of it. goreleaser built binaries will have the right values and go build ones won't which should be a big red flag so is also pretty nice I think.

)

func Name() string {
Expand Down