ollama/scripts/publish.sh

36 lines
793 B
Bash
Raw Normal View History

2023-07-07 16:59:24 +00:00
# Set your variables here.
REPO="jmorganca/ollama"
# Check if VERSION is set
if [[ -z "${VERSION}" ]]; then
echo "VERSION is not set. Please set the VERSION environment variable."
exit 1
fi
OS=$(go env GOOS)
ARCH=$(go env GOARCH)
2023-07-11 23:17:45 +00:00
go build .
2023-07-07 16:59:24 +00:00
2023-07-13 02:16:39 +00:00
npm --prefix app run make:sign
2023-07-07 16:59:24 +00:00
# Create a new tag if it doesn't exist.
if ! git rev-parse v$VERSION >/dev/null 2>&1; then
git tag v$VERSION
git push origin v$VERSION
fi
2023-07-13 02:16:39 +00:00
mkdir -p dist
2023-07-07 20:07:10 +00:00
cp app/out/make/zip/${OS}/${ARCH}/Ollama-${OS}-${ARCH}-${VERSION}.zip dist/Ollama-${OS}-${ARCH}.zip
cp ./ollama dist/ollama-${OS}-${ARCH}
2023-07-07 16:59:24 +00:00
# Create a new release.
gh release create v$VERSION
# Upload the zip file.
2023-07-07 20:07:10 +00:00
gh release upload v$VERSION ./dist/Ollama-${OS}-${ARCH}.zip
2023-07-07 16:59:24 +00:00
# Upload the binary.
2023-07-07 20:07:10 +00:00
gh release upload v$VERSION ./dist/ollama-${OS}-${ARCH}
2023-07-07 16:59:24 +00:00