From 661140499224ec4618ddd0f457b8ce01bc2bee36 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Tue, 25 Apr 2023 20:56:56 +0200 Subject: [PATCH] add helper script to tag release --- Cargo.toml | 1 + contrib/tag-release.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 contrib/tag-release.sh diff --git a/Cargo.toml b/Cargo.toml index 1afa923..aa64f97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ homepage = "https://hllmn.net/projects/jotdown" repository = "https://github.com/hellux/jotdown" documentation = "https://docs.rs/jotdown" exclude = [ + "contrib", ".github", ".gitmodules", "Makefile", diff --git a/contrib/tag-release.sh b/contrib/tag-release.sh new file mode 100755 index 0000000..5723dc6 --- /dev/null +++ b/contrib/tag-release.sh @@ -0,0 +1,13 @@ +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"