|
|
|
@ -52,14 +52,8 @@ fi
|
|
|
|
|
# Create work directories
|
|
|
|
|
tmp_build=`mktemp -d`
|
|
|
|
|
tmp_pkg=`mktemp -d`
|
|
|
|
|
tmp_musl_pkg=`mktemp -d`
|
|
|
|
|
tmp_linux_arm64_pkg=`mktemp -d`
|
|
|
|
|
tmp_linux_arm_pkg=`mktemp -d`
|
|
|
|
|
echo "$tmp_build created for build process."
|
|
|
|
|
echo "$tmp_pkg created for packaging process."
|
|
|
|
|
echo "$tmp_musl_pkg created for musl packaging process."
|
|
|
|
|
echo "$tmp_linux_arm64_pkg created for Linux ARM64 packaging process."
|
|
|
|
|
echo "$tmp_linux_arm_pkg created for Linux ARM packaging process."
|
|
|
|
|
|
|
|
|
|
# Get common build parameters
|
|
|
|
|
kernel=`uname -s`
|
|
|
|
@ -73,9 +67,9 @@ kernel=`uname -s`
|
|
|
|
|
buildtime=`date +%Y-%m-%dT%T%z`
|
|
|
|
|
|
|
|
|
|
# Prepare common linker flags
|
|
|
|
|
STRIP_SYMBOLS="-s"
|
|
|
|
|
STRIP_SYMBOLS="-w -s"
|
|
|
|
|
LINKER_PKG_PATH=github.com/rqlite/rqlite/cmd
|
|
|
|
|
LDFLAGS="-$STRIP_SYMBOLS -X $LINKER_PKG_PATH.Version=$VERSION -X $LINKER_PKG_PATH.Branch=$branch -X $LINKER_PKG_PATH.Commit=$commit -X $LINKER_PKG_PATH.Buildtime=$buildtime"
|
|
|
|
|
LDFLAGS="$STRIP_SYMBOLS -X $LINKER_PKG_PATH.Version=$VERSION -X $LINKER_PKG_PATH.Branch=$branch -X $LINKER_PKG_PATH.Commit=$commit -X $LINKER_PKG_PATH.Buildtime=$buildtime"
|
|
|
|
|
|
|
|
|
|
# Prepare the source code
|
|
|
|
|
mkdir -p $tmp_build/src/github.com/rqlite
|
|
|
|
@ -117,37 +111,49 @@ if [ "$kernel" != "Linux" ]; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# Package all other releases
|
|
|
|
|
declare -A versions
|
|
|
|
|
versions=(
|
|
|
|
|
declare -A archs
|
|
|
|
|
archs=(
|
|
|
|
|
["amd64"]="musl-gcc"
|
|
|
|
|
["arm64"]="aarch64-linux-gnu-gcc"
|
|
|
|
|
["arm"]="arm-linux-gnueabi-gcc"
|
|
|
|
|
["riscv64"]="riscv64-linux-gnu-gcc"
|
|
|
|
|
["mips"]="mips-linux-gnu-gcc"
|
|
|
|
|
["mipsel"]="mipsel-linux-gnu-gcc"
|
|
|
|
|
["mipsle"]="mipsel-linux-gnu-gcc"
|
|
|
|
|
["mips64"]="mips64-linux-gnuabi64-gcc"
|
|
|
|
|
["mips64le"]="mips64el-linux-gnuabi64-gcc"
|
|
|
|
|
["mipsle"]="mipsel-linux-gnu-gcc"
|
|
|
|
|
["ppc64"]="powerpc64-linux-gnu-gcc"
|
|
|
|
|
["ppc64le"]="powerpc64le-linux-gnu-gcc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for version in "${!versions[@]}"; do
|
|
|
|
|
compiler=${versions[$version]}
|
|
|
|
|
for arch in "${!archs[@]}"; do
|
|
|
|
|
compiler=${archs[$arch]}
|
|
|
|
|
|
|
|
|
|
rm -f $GOPATH/bin/*
|
|
|
|
|
cd $tmp_build/src/github.com/rqlite/rqlite
|
|
|
|
|
CGO_ENABLED=1 GOARCH=$version CC=$compiler go install -a -tags sqlite_omit_load_extension -ldflags="$LDFLAGS" ./...
|
|
|
|
|
CGO_ENABLED=1 GOARCH=$arch CC=$compiler go install -a -tags sqlite_omit_load_extension -ldflags="$LDFLAGS" ./...
|
|
|
|
|
|
|
|
|
|
if [ "$compiler" == "musl-gcc" ]; then
|
|
|
|
|
release=`echo rqlite-$VERSION-$kernel-$arch-musl | tr '[:upper:]' '[:lower:]'`
|
|
|
|
|
else
|
|
|
|
|
release=`echo rqlite-$VERSION-$kernel-$arch | tr '[:upper:]' '[:lower:]'`
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
release=`echo rqlite-$VERSION-$kernel-$version | tr '[:upper:]' '[:lower:]'`
|
|
|
|
|
tarball=${release}.tar.gz
|
|
|
|
|
mkdir $tmp_linux_${version}_pkg/$release
|
|
|
|
|
copy_binaries $tmp_linux_${version}_pkg/$release $GOPATH/bin/linux_$version
|
|
|
|
|
( cd $tmp_linux_${version}_pkg; tar cvfz $tarball $release )
|
|
|
|
|
tmp_pkg=`mktemp -d`
|
|
|
|
|
mkdir -p $tmp_pkg/$release
|
|
|
|
|
|
|
|
|
|
ls $GOPATH/bin
|
|
|
|
|
if [ "$arch" == "amd64" ]; then
|
|
|
|
|
copy_binaries $tmp_pkg/$release $GOPATH/bin
|
|
|
|
|
else
|
|
|
|
|
copy_binaries $tmp_pkg/$release $GOPATH/bin/linux_$arch
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
( cd $tmp_pkg; tar cvfz $tarball $release )
|
|
|
|
|
|
|
|
|
|
if [ -n "$API_TOKEN" ]; then
|
|
|
|
|
upload_asset $tmp_linux_${version}_pkg/$tarball $RELEASE_ID $API_TOKEN
|
|
|
|
|
upload_asset $tmp_pkg/$tarball $RELEASE_ID $API_TOKEN
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|