diff --git a/scripts/build_darwin.sh b/scripts/build_darwin.sh index 114240e3..381bcba5 100755 --- a/scripts/build_darwin.sh +++ b/scripts/build_darwin.sh @@ -2,7 +2,7 @@ set -e -export VERSION=${VERSION:-0.0.0} +export VERSION=${VERSION:-$(git describe --tags --first-parent --abbrev=7 --long --dirty --always | sed -e "s/^v//g")} export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version=$VERSION\" \"-X=github.com/jmorganca/ollama/server.mode=release\"'" mkdir -p dist diff --git a/scripts/build_docker.sh b/scripts/build_docker.sh index 74a9ac84..ef02a144 100755 --- a/scripts/build_docker.sh +++ b/scripts/build_docker.sh @@ -2,7 +2,7 @@ set -eu -export VERSION=${VERSION:-0.0.0} +export VERSION=${VERSION:-$(git describe --tags --first-parent --abbrev=7 --long --dirty --always | sed -e "s/^v//g")} export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version=$VERSION\" \"-X=github.com/jmorganca/ollama/server.mode=release\"'" docker build \ diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh index 75018837..338dbcd5 100755 --- a/scripts/build_linux.sh +++ b/scripts/build_linux.sh @@ -2,7 +2,7 @@ set -eu -export VERSION=${VERSION:-0.0.0} +export VERSION=${VERSION:-$(git describe --tags --first-parent --abbrev=7 --long --dirty --always | sed -e "s/^v//g")} export GOFLAGS="'-ldflags=-w -s \"-X=github.com/jmorganca/ollama/version.Version=$VERSION\" \"-X=github.com/jmorganca/ollama/server.mode=release\"'" BUILD_ARCH=${BUILD_ARCH:-"amd64 arm64"}