Skip to content

Commit

Permalink
Fix: Fixing goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
rspurgeon committed Mar 4, 2025
1 parent 5c0b20a commit 0818c30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,25 @@ before:
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- id: koctl
main: ./cmd/koctl
binary: koctl
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags:
- -s -w -X github.com/kong/konnect-orchestrator/cmd/koctl/main.VERSION={{ .Tag }}
#- -s -w -X github.com/kong/konnect-orchestrator/cmd/koctl/command.VERSION={{ .Tag }} -X github.com/kong/deck/cmd.COMMIT={{ .ShortCommit }}
archives:
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: zip
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
Expand Down
8 changes: 4 additions & 4 deletions cmd/koctl/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ var (
platformFileArg string
teamsFileArg string
organizationsFileArg string
version = "0.1.0" // Replace with build info
commit = "unknown" // Replace with build info
date = "unknown" // Replace with build info
VERSION = "dev"
COMMIT = "unknown"
DATE = "unknown"
)

var rootCmd = &cobra.Command{
Expand All @@ -68,7 +68,7 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version of koctl",
Run: func(_ *cobra.Command, _ []string) {
fmt.Printf("koctl version: %s\nCommit: %s\nBuild date: %s\n", version, commit, date)
fmt.Printf("koctl version: %s\nCommit: %s\nBuild date: %s\n", VERSION, COMMIT, DATE)
},
}

Expand Down

0 comments on commit 0818c30

Please sign in to comment.