monome / maiden

web based editor and repl for norns
GNU General Public License v3.0
47 stars 34 forks source link

Add version metadata during build. #213

Closed winder closed 3 years ago

winder commented 3 years ago

The version reported by ./maiden version is currently incorrect on a clean build. This PR adjusts the build to inject the current tag / build timestamp into the binary.

Before I committed these changes there was a top-level tag and the new version looks like this:

~$ make && ./maiden version
go build -ldflags="-X github.com/monome/maiden/cmd.version=v1.1.3 -X github.com/monome/maiden/cmd.compileTime=2021-09-10T13:25"

v1.1.3 / 2021-09-10T13:25

~$ go build && ./maiden version

development

After my commit, there is no top-level tag so a hash is included:

~$ make && ./maiden version
go build -ldflags="-X github.com/monome/maiden/cmd.version=v1.1.3-1-gbf56356 -X github.com/monome/maiden/cmd.compileTime=2021-09-10T13:27"

v1.1.3-1-gbf56356 / 2021-09-10T13:27