Closed zackproser closed 1 year ago
Another option is to update the version logic in go-commons
to look up the latest Git ref or tag if the version param isn't set.
Another option is to update the version logic in
go-commons
to look up the latest Git ref or tag if the version param isn't set.
Ah yeah that would probably be easier to maintain going forward than having to thrash on a file in the repo itself.
This remains an issue to my knowledge, but I won't be able to address it myself anytime soon and the issue is stale.
The CircleCI job for git-xargs currently sets the main go package's
VERSION
variable to the$CIRCLE_TAG
which is either the branch name or the tag name.This means that when we build and publish binaries through CircleCI and programmatically attach them to a new release, they correctly have their internal
VERSION
value set to the tag of the release and, therefore, when you rungit-xargs --version
against them you get back the associated tag, e.g.,git-xargs version v0.0.5
.However, when you install
git-xargs
viago get github.com/gruntwork-io/git-xargs
, the package is downloaded from Github and then built in your defined or default$GOBIN
directory. In this case, the main package'sVERSION
value remains unset, so runninggit-xargs
with the--version
flag returns an error.One initial idea would be to update a VERSION file in the repo each time we do a release - so that the HEAD of the default branch contains a VERSION file which always matches the latest release's tag.