2018-01-10 13:04:18 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-09-11 12:38:31 +02:00
|
|
|
OLD_VERSION=$(git describe --abbrev=0)
|
|
|
|
NEW_VERSION=$1
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
usage() {
|
2019-09-11 12:38:31 +02:00
|
|
|
echo "$0: NEW_VERSION"
|
2018-01-10 13:04:18 +01:00
|
|
|
echo ""
|
|
|
|
echo "example:"
|
2019-09-11 12:38:31 +02:00
|
|
|
echo " $0 0.16.0"
|
2018-01-10 13:04:18 +01:00
|
|
|
}
|
|
|
|
|
2019-09-11 12:38:31 +02:00
|
|
|
if [ -z "$NEW_VERSION" ] ; then
|
2018-01-10 13:04:18 +01:00
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$NEW_VERSION" > newchangelog
|
|
|
|
git shortlog "$OLD_VERSION".. >> newchangelog
|
|
|
|
cat CHANGELOG.md >> newchangelog
|
|
|
|
|
2019-09-11 12:39:42 +02:00
|
|
|
$EDITOR newchangelog
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
echo -n "All fine, ready to release? [y/N]"
|
|
|
|
read a
|
|
|
|
a=$(echo "$a" | tr '[:upper:]' '[:lower:]')
|
|
|
|
if [ "$a" != "y" ]; then
|
|
|
|
echo "no not happy, let's stop doing the release"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mv newchangelog CHANGELOG.md
|
|
|
|
sed -i "s,\(__version__ =\).*,\1 \'$NEW_VERSION\'," kas/__version__.py
|
2020-09-28 09:02:11 +02:00
|
|
|
sed -i "s,\( KAS_IMAGE_VERSION=\).*,\1\"$NEW_VERSION\"," kas-container
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
git add CHANGELOG.md
|
|
|
|
git add kas/__version__.py
|
2020-09-28 09:02:11 +02:00
|
|
|
git add kas-container
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
git commit -m "Release $NEW_VERSION"
|
|
|
|
git tag -s -m "Release $NEW_VERSION" "$NEW_VERSION"
|
|
|
|
git push --follow-tags
|
|
|
|
|
|
|
|
python setup.py sdist upload -r pypi
|
|
|
|
|
|
|
|
authors=$(git shortlog -s "$OLD_VERSION".."$NEW_VERSION" | cut -c8- | paste -s -d, - | sed -e 's/,/, /g')
|
|
|
|
highlights=$(cat CHANGELOG.md | sed -e "/$OLD_VERSION/,\$d")
|
|
|
|
|
2019-09-11 12:39:42 +02:00
|
|
|
prolog=$PWD/release-email.txt
|
2018-01-10 13:04:18 +01:00
|
|
|
echo \
|
2019-09-11 12:39:42 +02:00
|
|
|
"Hi all,
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
A new release $NEW_VERSION is available. A big thanks to all contributors:
|
|
|
|
$authors
|
|
|
|
|
|
|
|
Highlights in $highlights
|
|
|
|
|
|
|
|
Thanks,
|
2019-09-11 12:39:42 +02:00
|
|
|
Jan
|
2018-01-10 13:04:18 +01:00
|
|
|
|
|
|
|
https://github.com/siemens/kas/releases/tag/$NEW_VERSION
|
|
|
|
https://hub.docker.com/r/kasproject/kas/
|
|
|
|
|
|
|
|
"> $prolog
|
|
|
|
|
|
|
|
git shortlog $OLD_VERSION..$NEW_VERSION >> $prolog
|
|
|
|
|
2019-09-11 12:39:42 +02:00
|
|
|
thunderbird -compose "subject=[ANNOUNCE] Release $NEW_VERSION,to=kas-devel@googlegroups.com,message=$prolog"
|