2021-05-25 10:09:47 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Need version as argument"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
version="$1"
|
|
|
|
changelog=$(awk -v version="$version" '/^## / { printit = $2 == version }; printit' CHANGELOG.md | grep -v "## $version" | sed '1{/^$/d}')
|
|
|
|
|
|
|
|
printf "Changelog will be:\\n\\n%s\\n\\n" "$changelog"
|
|
|
|
|
|
|
|
read -p "Are you sure to release? " -n 1 -r
|
|
|
|
echo
|
|
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
git tag -s -a "$version" -m "$changelog"
|
|
|
|
|
2021-06-21 11:36:18 +02:00
|
|
|
git push origin "$version"
|