chore: support manual changelog and version 2.0 for releases (#8880)

* chore(release): add manual changelog + 2.0 support

* add comment

* fix typo

* fmt
This commit is contained in:
Ben Potter
2023-08-03 12:41:54 -05:00
committed by GitHub
parent 10da570916
commit 1314cd8fcb
11 changed files with 336 additions and 4 deletions

View File

@ -18,11 +18,16 @@ source "$(dirname "$(dirname "${BASH_SOURCE[0]}")")/lib.sh"
old_version=
new_version=
ref=
check_for_changelog=0
args="$(getopt -o '' -l old-version:,new-version:,ref: -- "$@")"
args="$(getopt -o '' -l check-for-changelog,old-version:,new-version:,ref: -- "$@")"
eval set -- "$args"
while true; do
case "$1" in
--check-for-changelog)
check_for_changelog=1
shift
;;
--old-version)
old_version="$2"
shift 2
@ -61,6 +66,15 @@ if [[ -z $ref ]]; then
error "No ref specified"
fi
# Use a manual changelog, if present
changelog_path="$(git rev-parse --show-toplevel)/docs/changelogs/$new_version.md"
if [ "$check_for_changelog" -eq 1 ]; then
if [ -f "$changelog_path" ]; then
cat "$changelog_path"
exit 0
fi
fi
# shellcheck source=scripts/release/check_commit_metadata.sh
source "$SCRIPT_DIR/check_commit_metadata.sh" "$old_version" "$ref"