Skip to content
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
13 changes: 10 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ builds:
- -X github.com/codesphere-cloud/oms/internal/version.version={{.Version}}
- -X github.com/codesphere-cloud/oms/internal/version.commit={{.Commit}}
- -X github.com/codesphere-cloud/oms/internal/version.date={{.Date}}
- -X github.com/codesphere-cloud/oms/internal/version.os={{.Os}}
- -X github.com/codesphere-cloud/oms/internal/version.arch={{.Arch}}

- id: service
env:
Expand All @@ -40,6 +42,8 @@ builds:
- -X github.com/codesphere-cloud/oms/internal/version.version={{.Version}}
- -X github.com/codesphere-cloud/oms/internal/version.commit={{.Commit}}
- -X github.com/codesphere-cloud/oms/internal/version.date={{.Date}}
- -X github.com/codesphere-cloud/oms/internal/version.os={{.Os}}
- -X github.com/codesphere-cloud/oms/internal/version.arch={{.Arch}}

changelog:
sort: asc
Expand All @@ -51,9 +55,12 @@ changelog:
- "^chore"

archives:
- formats:
- binary
- tar.gz
- id: bin
formats:
- binary
- id: tar
formats:
- tar.gz
name_template: "{{.Os}}_{{.Arch}}"

release:
Expand Down
4 changes: 3 additions & 1 deletion cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ type VersionCmd struct {
}

func (c *VersionCmd) RunE(_ *cobra.Command, args []string) error {
fmt.Printf("Codesphere CLI version: %s\n", version.Version())
fmt.Printf("OMS CLI version: %s\n", version.Version())
fmt.Printf("Commit: %s\n", version.Commit())
fmt.Printf("Build Date: %s\n", version.BuildDate())
fmt.Printf("Arch: %s\n", version.Arch())
fmt.Printf("OS: %s\n", version.Os())

return nil
}
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module github.com/codesphere-cloud/oms
go 1.24.2

require (
github.com/blang/semver v3.5.1+incompatible
github.com/codesphere-cloud/cs-go v0.10.1
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/jedib0t/go-pretty/v6 v6.6.7
github.com/onsi/ginkgo/v2 v2.23.4
github.com/onsi/gomega v1.37.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/codesphere-cloud/cs-go v0.10.1 h1:QhiBKYkBlAeephPKfl0AY18MLGNdcY2uAjvncu7ezq8=
github.com/codesphere-cloud/cs-go v0.10.1/go.mod h1:lJENk49WB9ZIGeZdZdzERYlCxlpL1FNcN8oj/NjgUfw=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
Expand All @@ -11,6 +13,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8=
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jedib0t/go-pretty/v6 v6.6.7 h1:m+LbHpm0aIAPLzLbMfn8dc3Ht8MW7lsSO4MPItz/Uuo=
Expand Down
12 changes: 11 additions & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package version

// Variables are injected by goreleaser on release
var (
version string = "dev"
version string = "0.0.0"
commit string = "none"
date string = "unknown"
os string = "unknown"
arch string = "unknown"
)

type Build struct{}
Expand All @@ -20,3 +22,11 @@ func Commit() string {
func BuildDate() string {
return date
}

func Os() string {
return os
}

func Arch() string {
return arch
}