release: update release script to compile commit hash into binary
This commit is contained in:
parent
31aa8553e7
commit
1d7ff42d2a
@ -26,6 +26,7 @@ SYS="windows-386 windows-amd64 openbsd-386 openbsd-amd64 linux-386 linux-amd64 l
|
|||||||
# 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:)
|
GPATH=$(echo $GOPATH | cut -f1 -d:)
|
||||||
|
COMMITFLAGS="-X main.Commit=$(git rev-parse HEAD)"
|
||||||
|
|
||||||
for i in $SYS; do
|
for i in $SYS; do
|
||||||
OS=$(echo $i | cut -f1 -d-)
|
OS=$(echo $i | cut -f1 -d-)
|
||||||
@ -33,8 +34,8 @@ for i in $SYS; do
|
|||||||
mkdir $PACKAGE-$i-$TAG
|
mkdir $PACKAGE-$i-$TAG
|
||||||
cd $PACKAGE-$i-$TAG
|
cd $PACKAGE-$i-$TAG
|
||||||
echo "Building:" $OS $ARCH
|
echo "Building:" $OS $ARCH
|
||||||
env GOOS=$OS GOARCH=$ARCH go build -v github.com/lightningnetwork/lnd
|
env GOOS=$OS GOARCH=$ARCH go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd
|
||||||
env GOOS=$OS GOARCH=$ARCH go build -v github.com/lightningnetwork/lnd/cmd/lncli
|
env GOOS=$OS GOARCH=$ARCH go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd/cmd/lncli
|
||||||
cd ..
|
cd ..
|
||||||
if [[ $OS = "windows" ]]; then
|
if [[ $OS = "windows" ]]; then
|
||||||
zip -r $PACKAGE-$i-$TAG.zip $PACKAGE-$i-$TAG
|
zip -r $PACKAGE-$i-$TAG.zip $PACKAGE-$i-$TAG
|
||||||
|
Loading…
Reference in New Issue
Block a user