Skip to content

Commit

Permalink
release: update release script to compile commit hash into binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed May 29, 2018
1 parent 31aa855 commit 1d7ff42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ 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
# (something that is totally allowed).
GPATH=$(echo $GOPATH | cut -f1 -d:)
COMMITFLAGS="-X main.Commit=$(git rev-parse HEAD)"

for i in $SYS; do
OS=$(echo $i | cut -f1 -d-)
ARCH=$(echo $i | cut -f2 -d-)
mkdir $PACKAGE-$i-$TAG
cd $PACKAGE-$i-$TAG
echo "Building:" $OS $ARCH
env GOOS=$OS GOARCH=$ARCH go build -v 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
env GOOS=$OS GOARCH=$ARCH go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd/cmd/lncli
cd ..
if [[ $OS = "windows" ]]; then
zip -r $PACKAGE-$i-$TAG.zip $PACKAGE-$i-$TAG
Expand Down

0 comments on commit 1d7ff42

Please sign in to comment.