diff --git a/scripts/rel/cut.sh b/scripts/rel/cut.sh index 4fafbd3ef..6d1c77de4 100755 --- a/scripts/rel/cut.sh +++ b/scripts/rel/cut.sh @@ -233,32 +233,11 @@ if [ -d "${CHECKS_DIR}" ]; then done fi -generate_changelog () { - local from_tag - from_tag="${PREV_TAG:-}" - if [[ -z $from_tag ]]; then - from_tag="$(./scripts/find-prev-rel-tag.sh "$PROFILE")" - fi - # num_en=$(git diff --name-only -a "${from_tag}...HEAD" "changes" | grep -c '.en.md') - # num_zh=$(git diff --name-only -a "${from_tag}...HEAD" "changes" | grep -c '.zh.md') - # if [ "$num_en" -ne "$num_zh" ]; then - # echo "Number of English and Chinese changelog files added since ${from_tag} do not match." - # exit 1 - # fi - ./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'en' -v "$TAG" > "changes/${TAG}.en.md" - # ./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'zh' -v "$TAG" > "changes/${TAG}.zh.md" - git add changes/"${TAG}".*.md - if [ -n "$(git diff --staged --stat)" ]; then - git commit -m "docs: Generate changelog for ${TAG}" - else - logmsg "No changelog update." - fi -} - check_changelog() { local file="changes/${TAG}.en.md" if [ ! -f "$file" ]; then logerr "Changelog file $file is missing." + logerr "Generate it with command: ./scripts/rel/format-changelog.sh -b ${PREV_TAG} -v ${TAG} > ${file}" exit 1 fi } @@ -280,7 +259,7 @@ else check_changelog ;; v*) - generate_changelog + check_changelog ;; esac git tag "$TAG" diff --git a/scripts/rel/format-changelog.sh b/scripts/rel/format-changelog.sh index 528b3bdc9..3c83d3cd6 100755 --- a/scripts/rel/format-changelog.sh +++ b/scripts/rel/format-changelog.sh @@ -57,8 +57,7 @@ case "${LANGUAGE:-}" in true ;; *) - logerr "-l|--lang must be 'en' or 'zh'" - exit 1 + LANGUAGE='en' ;; esac