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

would it make sense for versioning to be committed #19

Closed
gedw99 opened this issue Nov 27, 2021 · 5 comments
Closed

would it make sense for versioning to be committed #19

gedw99 opened this issue Nov 27, 2021 · 5 comments

Comments

@gedw99
Copy link

gedw99 commented Nov 27, 2021

Maybe i have got this wrong but anyway.

I tend to use go install x.y.z@tag cause it works so well these days, but i dont get version info because its NOT in the golang code that is tagged.

go install github.com/oligot/go-mod-upgrade@v0.6.2

which go-mod-upgrade
/Users/apple/workspace/go/bin/go-mod-upgrade

 go-mod-upgrade --version
go-mod-upgrade version=(undefined) commit=(undefined) date=(undefined)

The solution is to have a version.go file that always has the correct version.

goreleaser will just overwrite it with the same value during CI i expect ?

What ya think ?

@gedw99
Copy link
Author

gedw99 commented Nov 28, 2021

@oligot
Copy link
Owner

oligot commented Dec 7, 2021

Hi,

I just tested it with goreleaser and here is what I get:

> go install github.com/goreleaser/goreleaser@v1.1.0
> goreleaser --version
goreleaser version dev
module version: v1.1.0, checksum: h1:YySqqYTX9kxRU0e/fGQrhivXk8/zD4iUOlL7h0I2gBk=

https://goreleaser.com

So, this is clearly doable 😉

@gedw99
Copy link
Author

gedw99 commented Dec 9, 2021

@oligot oligot closed this as completed in 705974b Dec 9, 2021
@oligot
Copy link
Owner

oligot commented Dec 9, 2021

This now works in version 0.7.0:

> go install github.com/oligot/go-mod-upgrade@v0.7.0
> go-mod-upgrade --version
go-mod-upgrade version dev
module version: v0.7.0

@gedw99
Copy link
Author

gedw99 commented Dec 9, 2021

thanks @oligot works great for me too.

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

No branches or pull requests

2 participants