I've been working these up by hand for the last several releases to
give users who trust my key but not GitHub (possibly an empty set ;) a
way to verify the authenticity of downloaded installers. This commit
just institutionalizes the procedure.
This gets the correct main.version value. Before this commit, you
could have:
$ hack/release.sh v0.4.0
...
+ go build -ldflags ' -X main.version=v0.3.0-273-g...' ...
...
With this commit, that same invocation will give you:
+ go build -ldflags ' -X main.version=v0.4.0' ...
The bug is from the initial script in 7b023303 (hack/release: Make it
easy to cross-compile release binaries, 2018-10-02, #397).
And stick Git tagging in there too, because why not. This is mostly
to get our list of target OSes and architectures into version control.
The SKIP_GENERATION variable allows you to turn off vfsgen when we
have GOOS and/or GOARCH set to values that will not run on your host
;).
Also change --abbrev from 0 to 40 in the build script, because
--abbrev=0 results in dropping the commit hash entirely when there's a
past tag:
$ git describe --always --abbrev=40 --dirty
v0.1.0-2-gff5ee75e5010efb305d4bc381d944b14a4a97c3b-dirty
$ git describe --always --abbrev=0 --dirty
v0.1.0-dirty
$ git describe --always --dirty
v0.1.0-2-gff5ee75-dirty
Checking on the tag itself for sanity:
$ git checkout v0.1.0
$ git describe --always --abbrev=40 --dirty
v0.1.0