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

IsReleaseBuild() returns incorrect info. #438

Closed
capri-xiyue opened this issue Feb 14, 2024 · 2 comments · Fixed by #440
Closed

IsReleaseBuild() returns incorrect info. #438

capri-xiyue opened this issue Feb 14, 2024 · 2 comments · Fixed by #440
Labels
bug Something isn't working

Comments

@capri-xiyue
Copy link
Contributor

TL;DR

Ideally, IsReleaseBuild returns true if this binary was built by goreleaser as part of
// the official release process (as opposed to a user just running "go build",
// or running in a CI environment, or something else). But somehow when I install abc cli via go install ./..., or

rc := rootCmd()
, IsReleaseBuild also returns true

Expected behavior

No response

Observed behavior

No response

Environment Details

N/A

Additional information

No response

@capri-xiyue capri-xiyue added the bug Something isn't working label Feb 14, 2024
@capri-xiyue
Copy link
Contributor Author

capri-xiyue commented Feb 15, 2024

I took a look at our v0.5.0 and go install ./... and

rc := rootCmd()
, the version is all devel and it is expected. See golang/go#29228. I think probably we need to change our mechanism to hide some api versions.

I checked the v0.5.0 via go version -m xxx command (Edit: when I run abc templates -help on abc cli v0.5.0, it shows correct info, the mechanism is that the version of build info of v0.5.0 is devel but the abc templates -help shows the version according to the override version in goreleaser.

@capri-xiyue
Copy link
Contributor Author

capri-xiyue commented Feb 15, 2024

I took a look at our v0.5.0 and go install ./... and

rc := rootCmd()

, the version is all devel and it is expected. See golang/go#29228. I think probably we need to change our mechanism to hide some api versions.
I checked the v0.5.0 via go version -m xxx command (Edit: when I run abc templates -help on abc cli v0.5.0, it shows correct info, the mechanism is that the version of build info of v0.5.0 is devel but the abc templates -help shows the version according to the override version in goreleaser.

For v0.5.0, the version is different either devel or v0.5.0 depends on how we install it, see #441

capri-xiyue added a commit that referenced this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant