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: embed version in kubectl-retina with goreleaser #170

Merged
merged 1 commit into from
Mar 28, 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
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ builds:
- windows
- darwin
ldflags:
- -X cli/cmd.Version={{.Version}}
- -X github.com/microsoft/retina/cli/cmd.Version={{.Version}}
main: cli/main.go

archives:
- name_template: "{{ .Binary }}-v{{ .Version }}"
wrap_in_directory: false
format_overrides:
- goos: windows
format: zip
- goos: windows
format: zip

changelog:
sort: asc
Expand Down
3 changes: 2 additions & 1 deletion cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

// This variable is used by the "version" command and is set during build.
var Version = "undefined"
// Defaults to a safe value if not set.
var Version = "v0.0.2"

func VersionCmd() *cobra.Command {
cmd := &cobra.Command{
Expand Down
Loading