jotdown/contrib/tag-release.sh

14 lines
331 B
Bash
Raw Normal View History

2023-04-25 14:56:56 -04:00
c_awk_latest='
/^## \[.*\]/ {if (latest) exit; else {latest=1; next}}
latest {print}
'
tag=$(grep ^version Cargo.toml | cut -d" " -f3 | tr -d '"')
changes=$(awk "$c_awk_latest" CHANGELOG.md | tail -n+2)
git -c core.commentchar='%' tag --edit \
-m "Release $tag" \
-m "$changes" \
"$tag"
git push github master "$tag"