build: fix release script to include commit hash

In this commit we update the release script to properly include the
commit hash in compiled binaries of lnd and lncli. In the future, we
should ditch the release script and extend the Makefile to support this
use case.

Fixes #2389.
This commit is contained in:
Olaoluwa Osuntokun 2019-01-02 12:01:00 -08:00
parent f7fb9486b4
commit 23df03566c
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -27,8 +27,9 @@ SYS=${LNDBUILDSYS:-"windows-386 windows-amd64 openbsd-386 openbsd-amd64 linux-38
# Use the first element of $GOPATH in the case where GOPATH is a list # Use the first element of $GOPATH in the case where GOPATH is a list
# (something that is totally allowed). # (something that is totally allowed).
GPATH=$(echo $GOPATH | cut -f1 -d:) PKG="github.com/lightningnetwork/lnd"
COMMITFLAGS="-X main.Commit=$(git rev-parse HEAD)" COMMIT=$(git describe --abbrev=40 --dirty)
COMMITFLAGS="-X $PKG/build.Commit=$COMMIT"
for i in $SYS; do for i in $SYS; do
OS=$(echo $i | cut -f1 -d-) OS=$(echo $i | cut -f1 -d-)