add publish script

This commit is contained in:
Jeffrey Morgan
2023-07-07 12:59:24 -04:00
parent 7406881eeb
commit 1358e27b77
3 changed files with 52 additions and 15 deletions

29
scripts/publish.sh Executable file
View File

@@ -0,0 +1,29 @@
# 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)
make app
# 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
# Create a new release.
gh release create v$VERSION
# Upload the zip file.
gh release upload v$VERSION "app/out/make/zip/${OS}/${ARCH}/Ollama-${OS}-${ARCH}-${VERSION}.zip#Ollama-${OS}-${ARCH}.zip"
# Upload the binary.
gh release upload v$VERSION "./ollama#ollama-${OS}-${ARCH}"