Skip to content

Commit eb0850a

Browse files
committed
Automate release tag creation
1 parent 7ad20ed commit eb0850a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

release

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ check_release_changes() {
2020
[[ -z $(grep "# v$new_version" Changes.md) ]]
2121
}
2222

23+
make_git_tag() {
24+
# Extract the verion specific section from Changes.md
25+
# Delete lines until $new_version header
26+
# Delete lines starting from the next header
27+
# Delete all empty lines at the start
28+
# Use as the initial message for a signed tag, but open edit anyways
29+
sed -e '1,/'"$new_version"'/d;/\#/,$d;/./,$!d' Changes.md | git tag -s $is_force -F - -e "v$new_version"
30+
}
31+
2332
new_version="$(determine_new_version)"
2433

2534
# check it is a sane version number
@@ -75,4 +84,4 @@ check_release_changes && { echo "Fail: No changelog regarding this release"; exi
7584
# Packaging works. Note: does not publish the version.
7685
cargo package || { echo "Fail: cargo could not package successfully"; exit 1; }
7786

78-
[[ -z $do_tag ]] || git tag -s $is_force "v$new_version"
87+
[[ -z $do_tag ]] || make_git_tag

0 commit comments

Comments
 (0)