2019-10-22 21:56:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ $# -ne 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
|
|
|
|
|
2019-10-30 15:01:01 +01:00
|
|
|
git tag -a -s -m "$MESSAGE" "$TAG"
|
2019-10-22 21:56:33 +02:00
|
|
|
git push --tags
|
|
|
|
|
|
|
|
./gradlew publish
|
|
|
|
|