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

Add semantic version from git tag #164

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

stefanb
Copy link
Contributor

@stefanb stefanb commented Oct 22, 2023

Improves upon #146 to include the semantic version number from git tag.

@@ -214,6 +214,8 @@ func buildCredentials(skipVerify bool, caCerts, clientCert, clientKey, serverNam
return credentials.NewTLS(&cfg), nil
}

var versionTag = "" // set from git tag via ldflags during build
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can also default to eg. "development":

Suggested change
var versionTag = "" // set from git tag via ldflags during build
var versionTag = "development" // set from git tag via ldflags during build

and remove the condition lower to keep code simpler and provide consistent output structure.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah sounds good. I initially deemed tag is not so useful and anyone who needs can derive it from commit ID.

Copy link
Contributor Author

@stefanb stefanb Oct 23, 2023

Choose a reason for hiding this comment

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

"Sounds good" as in omiting the tag if not set via ldflags (as currently implemented) or showing the "development" in such cases (as suggested as an option in this comment thread)?

@ahmetb ahmetb merged commit 55f8e22 into grpc-ecosystem:master Oct 26, 2023
1 check passed
@stefanb stefanb deleted the add-version-from-git-tag branch October 26, 2023 04:52
@stefanb
Copy link
Contributor Author

stefanb commented Oct 27, 2023

Binaries of the recent v0.4.22 release show the version from tag as:

0.4.22; commit 680bc1a1c3f7d5bb1ec000ee252ee11d81cdd0a0

@ahmetb
Copy link
Collaborator

ahmetb commented Oct 28, 2023

Awesome, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants