Otter-App-Android-Funkwhale/publish.sh

31 lines
497 B
Bash
Raw Normal View History

2019-10-22 21:56:33 +02:00
#!/bin/sh
2019-10-30 21:58:24 +01:00
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
echo 'Usage: ./publish.sh TAG [MESSAGE]' >&2
2019-10-22 21:56:33 +02:00
exit 1
fi
if [ "$(git diff --stat)" != '' ]; then
echo 'ERROR: repository is dirty.' >&2
exit 1
fi
TAG="$1"
MESSAGE="$2"
2019-11-17 00:59:11 +01:00
if [ "$(git tag -l | grep -e "^$TAG$")" != '' ]; then
2019-10-22 21:56:33 +02:00
echo "ERROR: tag $TAG already exists." >&2
exit 1
fi
2019-11-17 00:59:11 +01:00
if [ "$MESSAGE" != '' ]; then
2019-10-30 21:58:24 +01:00
git tag -a -s -m "$MESSAGE" "$TAG"
else
git tag -a -s "$TAG"
fi
2019-10-22 21:56:33 +02:00
git push --tags
2019-10-30 21:58:24 +01:00
./gradlew publishListing
2019-10-22 21:56:33 +02:00
./gradlew publish