build: update release.sh to contain vendor archive + source code
In this commit, we update the release script to include a directory containing all of our vendored dependencies. This makes out releases more self contained as they can be built using `go build -mod=vendor` without requiring any package fetching. Additionally, we pacakge the entire source as well. Fixes #1550.
This commit is contained in:
parent
7e1b399437
commit
df45cc19a3
17
release.sh
17
release.sh
@ -16,9 +16,21 @@ else
|
|||||||
TAG=$1
|
TAG=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
go mod vendor
|
||||||
|
tar -cvzf vendor.tar.gz vendor
|
||||||
|
|
||||||
PACKAGE=lnd
|
PACKAGE=lnd
|
||||||
MAINDIR=$PACKAGE-$TAG
|
MAINDIR=$PACKAGE-$TAG
|
||||||
mkdir -p $MAINDIR
|
mkdir -p $MAINDIR
|
||||||
|
|
||||||
|
cp vendor.tar.gz $MAINDIR/
|
||||||
|
rm vendor.tar.gz
|
||||||
|
rm -r vendor
|
||||||
|
|
||||||
|
PACKAGESRC="$MAINDIR/$PACKAGE-source-$TAG.tar"
|
||||||
|
git archive -o $PACKAGESRC HEAD
|
||||||
|
gzip -f $PACKAGESRC > "$PACKAGESRC.gz"
|
||||||
|
|
||||||
cd $MAINDIR
|
cd $MAINDIR
|
||||||
|
|
||||||
# If LNDBUILDSYS is set the default list is ignored. Useful to release
|
# If LNDBUILDSYS is set the default list is ignored. Useful to release
|
||||||
@ -35,6 +47,7 @@ for i in $SYS; do
|
|||||||
OS=$(echo $i | cut -f1 -d-)
|
OS=$(echo $i | cut -f1 -d-)
|
||||||
ARCH=$(echo $i | cut -f2 -d-)
|
ARCH=$(echo $i | cut -f2 -d-)
|
||||||
ARM=
|
ARM=
|
||||||
|
|
||||||
if [[ $ARCH = "armv6" ]]; then
|
if [[ $ARCH = "armv6" ]]; then
|
||||||
ARCH=arm
|
ARCH=arm
|
||||||
ARM=6
|
ARM=6
|
||||||
@ -42,17 +55,21 @@ for i in $SYS; do
|
|||||||
ARCH=arm
|
ARCH=arm
|
||||||
ARM=7
|
ARM=7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir $PACKAGE-$i-$TAG
|
mkdir $PACKAGE-$i-$TAG
|
||||||
cd $PACKAGE-$i-$TAG
|
cd $PACKAGE-$i-$TAG
|
||||||
|
|
||||||
echo "Building:" $OS $ARCH $ARM
|
echo "Building:" $OS $ARCH $ARM
|
||||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd
|
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd
|
||||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightningnetwork/lnd/cmd/lncli
|
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM 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
|
||||||
else
|
else
|
||||||
tar -cvzf $PACKAGE-$i-$TAG.tar.gz $PACKAGE-$i-$TAG
|
tar -cvzf $PACKAGE-$i-$TAG.tar.gz $PACKAGE-$i-$TAG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -r $PACKAGE-$i-$TAG
|
rm -r $PACKAGE-$i-$TAG
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user