mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
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:
@ -133,7 +133,7 @@ if ! [[ $continue_release =~ ^[Yy]$ ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
release_notes="$(execrelative ./release/generate_release_notes.sh --old-version "$old_version" --new-version "$new_version" --ref "$ref")"
|
||||
release_notes="$(execrelative ./release/generate_release_notes.sh --check-for-changelog --old-version "$old_version" --new-version "$new_version" --ref "$ref")"
|
||||
|
||||
read -p "Preview release notes? (y/n) " -n 1 -r show_reply
|
||||
log
|
||||
|
@ -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"
|
||||
|
||||
|
@ -118,7 +118,13 @@ minor)
|
||||
version_parts[2]=0
|
||||
;;
|
||||
major)
|
||||
version_parts[0]=$((version_parts[0] + 1))
|
||||
# Jump from v0.x to v2.x to avoid naming conflicts
|
||||
# with Coder v1 (https://coder.com/docs/v1)
|
||||
if [ "${version_parts[0]}" -eq 0 ]; then
|
||||
version_parts[0]=2
|
||||
else
|
||||
version_parts[0]=$((version_parts[0] + 1))
|
||||
fi
|
||||
version_parts[1]=0
|
||||
version_parts[2]=0
|
||||
;;
|
||||
|
Reference in New Issue
Block a user