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

-version info is "not as useful" as it may should've been #154

Open
stdedos opened this issue Dec 5, 2022 · 1 comment
Open

-version info is "not as useful" as it may should've been #154

stdedos opened this issue Dec 5, 2022 · 1 comment

Comments

@stdedos
Copy link

stdedos commented Dec 5, 2022

Version in the tagged version:

go-junit-report/main.go

Lines 14 to 18 in 7fde464

var (
Version = "v2.0.0-dev"
Revision = "HEAD"
BuildTime string
)

Version @https://github.com/jstemmer/go-junit-report/blob/master as of now:

go-junit-report/main.go

Lines 18 to 22 in e939e4f

var (
Version = "v2.0.0-dev"
Revision = "HEAD"
BuildTime string
)

May I suggest something along the lines of:

//go:generate sh -c "git describe --tags --first-parent --abbrev=0 > commit.txt"
//go:embed commit.txt

for "rolling" builds, and "hardcoded" changes on tagged commits

@joschi
Copy link

joschi commented Jun 28, 2024

This is not an issue in the compiled binary.

# https://github.com/jstemmer/go-junit-report/releases/tag/v2.0.0
❯ tar xfzv go-junit-report-v2.0.0-darwin-amd64.tar.gz 
x go-junit-report
❯ ./go-junit-report -version
go-junit-report v2.0.0 2022-07-01T22:11:51 (7fde4641acef5b92f397a8baf8309d1a45d608cc)

# https://github.com/jstemmer/go-junit-report/releases/tag/v2.1.0
❯ tar xfzv go-junit-report-v2.1.0-darwin-arm64.tar.gz
x go-junit-report
❯ ./go-junit-report -version
go-junit-report v2.1.0 2023-10-18T23:51:04 (14d61e6e75e3f3c74551d757ad936e8e88014464)

See also:

VERSION=$(shell git describe --match="v*")
REVISION=$(shell git rev-parse HEAD)
TIMESTAMP=$(shell date +%FT%T)

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