feat(release): allow empty changelog while releasing

This commit is contained in:
Orhun Parmaksız 2022-04-15 11:16:33 +03:00
parent a3d51f0ce5
commit 0dcfeba90d
No known key found for this signature in database
GPG Key ID: F83424824B3E4B90

View File

@ -14,11 +14,11 @@ usage() { printf "usage: %s <tag>\n" "${BASH_SOURCE[0]##*/}"; exit 0; }
bail() { printf "error: %s\n" "$1" "${@:2}"; exit 1; }
[ -z "$1" ] && usage
[[ "$1" != v* ]] && bail "tag name should start with 'v'"
tag=$1
[ -z "$tag" ] && usage
[[ "$tag" != v* ]] && bail "tag name should start with 'v'"
changelog=$(git diff -U0 "$changelog_file" | grep '^[+][^+]' | sed 's/^[+]//;s/^###\s*//')
[ -z "$changelog" ] && bail "$changelog_file is not updated"
sed "s/^version = \".*\" $version_suffix$/version = \"${1#v}\" $version_suffix/g" \
-i -- */Cargo.toml
@ -28,11 +28,11 @@ gawk -i inplace \
'/\.TH\s.*+"8".*"System Administration"/{ $4 = date } 1' man*/*
git add -A
git commit -m "$commit_prefix$1"
git commit -m "$commit_prefix$tag"
git show
git -c user.name="$tagger_name" \
-c user.email="$tagger_email" \
-c user.signingkey="$signing_key" \
tag -s -a "$1" -m "$tag_prefix$1" -m "$changelog"
git tag -v "$1"
tag -s -a "$tag" -m "$tag_prefix$tag" -m "$changelog"
git tag -v "$tag"