Package builds
This commit is contained in:
parent
bba8b257d1
commit
d20903e260
32
build.sh
32
build.sh
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
RELEASE_VERSION=$(cat RELEASE_VERSION)
|
RELEASE_VERSION=
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
osname=$1
|
osname=$1
|
||||||
@ -28,14 +28,26 @@ function build {
|
|||||||
(cd $buildpath && tar cfz ./gh-ost-binary-${osshort}-${timestamp}.tar.gz $target)
|
(cd $buildpath && tar cfz ./gh-ost-binary-${osshort}-${timestamp}.tar.gz $target)
|
||||||
}
|
}
|
||||||
|
|
||||||
buildpath=/tmp/gh-ost
|
main() {
|
||||||
target=gh-ost
|
if [ -z "${RELEASE_VERSION}" ] ; then
|
||||||
timestamp=$(date "+%Y%m%d%H%M%S")
|
RELEASE_VERSION=$(git describe --abbrev=0 --tags | tr -d 'v')
|
||||||
ldflags="-X main.AppVersion=${RELEASE_VERSION}"
|
fi
|
||||||
|
if [ -z "${RELEASE_VERSION}" ] ; then
|
||||||
|
RELEASE_VERSION=$(cat RELEASE_VERSION)
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p ${buildpath}
|
|
||||||
build macOS osx darwin amd64
|
|
||||||
build GNU/Linux linux linux amd64
|
|
||||||
|
|
||||||
echo "Binaries found in:"
|
buildpath=/tmp/gh-ost
|
||||||
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz
|
target=gh-ost
|
||||||
|
timestamp=$(date "+%Y%m%d%H%M%S")
|
||||||
|
ldflags="-X main.AppVersion=${RELEASE_VERSION}"
|
||||||
|
|
||||||
|
mkdir -p ${buildpath}
|
||||||
|
build macOS osx darwin amd64
|
||||||
|
build GNU/Linux linux linux amd64
|
||||||
|
|
||||||
|
echo "Binaries found in:"
|
||||||
|
ls -1 $buildpath/gh-ost-binary*${timestamp}.tar.gz
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user