You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
497 B
31 lines
497 B
5 years ago
|
#!/bin/sh
|
||
|
|
||
5 years ago
|
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
|
||
|
echo 'Usage: ./publish.sh TAG [MESSAGE]' >&2
|
||
5 years ago
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ "$(git diff --stat)" != '' ]; then
|
||
|
echo 'ERROR: repository is dirty.' >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
TAG="$1"
|
||
|
MESSAGE="$2"
|
||
|
|
||
5 years ago
|
if [ "$(git tag -l | grep -e "^$TAG$")" != '' ]; then
|
||
5 years ago
|
echo "ERROR: tag $TAG already exists." >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
5 years ago
|
if [ "$MESSAGE" != '' ]; then
|
||
5 years ago
|
git tag -a -s -m "$MESSAGE" "$TAG"
|
||
|
else
|
||
|
git tag -a -s "$TAG"
|
||
|
fi
|
||
|
|
||
5 years ago
|
git push --tags
|
||
|
|
||
5 years ago
|
./gradlew publishListing
|
||
5 years ago
|
./gradlew publish
|