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]"
|
2021-01-29 20:51:25 +01:00
|
|
|
read -r a
|
2018-01-10 13:04:18 +01:00
|
|
|
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-11-20 12:03:25 +01:00
|
|
|
sed -i "s,\(KAS_IMAGE_VERSION_DEFAULT=\).*,\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')
|
2021-01-29 20:51:25 +01:00
|
|
|
highlights=$(sed -e "/$OLD_VERSION/,\$d" CHANGELOG.md)
|
2018-01-10 13:04:18 +01:00
|
|
|
|
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
|
2020-11-20 08:39:52 +01:00
|
|
|
https://github.com/orgs/siemens/packages/container/package/kas%2Fkas
|
|
|
|
https://github.com/orgs/siemens/packages/container/package/kas%2Fkas-isar
|
2018-01-10 13:04:18 +01:00
|
|
|
|
2021-01-29 20:51:25 +01:00
|
|
|
"> "$prolog"
|
2018-01-10 13:04:18 +01:00
|
|
|
|
2021-01-29 20:51:25 +01:00
|
|
|
git shortlog "$OLD_VERSION..$NEW_VERSION" >> "$prolog"
|
2018-01-10 13:04:18 +01:00
|
|
|
|
2019-09-11 12:39:42 +02:00
|
|
|
thunderbird -compose "subject=[ANNOUNCE] Release $NEW_VERSION,to=kas-devel@googlegroups.com,message=$prolog"
|