1
0
mirror of https://github.com/apognu/otter synced 2025-02-17 11:20:34 +01:00
2019-10-30 21:58:24 +01:00

31 lines
489 B
Bash
Executable File

#!/bin/sh
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
echo 'Usage: ./publish.sh TAG [MESSAGE]' >&2
exit 1
fi
if [ "$(git diff --stat)" != '' ]; then
echo 'ERROR: repository is dirty.' >&2
exit 1
fi
TAG="$1"
MESSAGE="$2"
if [ "$(git tag -l | grep $TAG)" != '' ]; then
echo "ERROR: tag $TAG already exists." >&2
exit 1
fi
if [ "$MESSAGE" == '']; then
git tag -a -s -m "$MESSAGE" "$TAG"
else
git tag -a -s "$TAG"
fi
git push --tags
./gradlew publishListing
./gradlew publish