-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Expose version info (#1841)
### Proposed Changes - Adds sdk.Version and sdk.TDFSpecVersion strings for library integrators to inspect - Adds `version` subcommand to platform service - The values should be updated automatically with release please - Note this means the version of main will be pinned to the last release ### Checklist - [ ] I have added or updated unit tests - [ ] I have added or updated integration tests (if appropriate) - [ ] I have added or updated documentation ### Testing Instructions
- Loading branch information
1 parent
85ce9b6
commit 92a9f5e
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ toolcheck: | |
@which buf > /dev/null || (echo "buf not found, please install it from https://docs.buf.build/installation" && exit 1) | ||
@which golangci-lint > /dev/null || (echo "golangci-lint not found, run 'go install github.com/golangci/golangci-lint/cmd/[email protected]'" && exit 1) | ||
@which protoc-gen-doc > /dev/null || (echo "protoc-gen-doc not found, run 'go install github.com/pseudomuto/protoc-gen-doc/cmd/[email protected]'" && exit 1) | ||
@golangci-lint --version | grep "version v\?1.61" > /dev/null || (echo "golangci-lint version must be v1.61 or later [$$(golangci-lint --version)]" && exit 1) | ||
@golangci-lint --version | grep "version v\?1.6[123]" > /dev/null || (echo "golangci-lint version must be v1.61 or later [$$(golangci-lint --version)]" && exit 1) | ||
@which goimports >/dev/null || (echo "goimports not found, run 'go install golang.org/x/tools/cmd/goimports@latest'") | ||
|
||
fix: tidy fmt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package sdk | ||
|
||
const ( | ||
Version = "0.3.23" // SDK version // x-release-please-version | ||
TDFSpecVersion = "4.2.2" // Vesion of TDF Spec currently targeted by the SDK | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
const Version = "0.4.36" // Service Version // x-release-please-version | ||
|
||
func init() { | ||
rootCmd.AddCommand(&cobra.Command{ | ||
Use: "version", | ||
Short: "Platform version information", | ||
RunE: func(cmd *cobra.Command, _ []string) error { | ||
cmd.Println(Version) | ||
return nil | ||
}, | ||
}) | ||
} |