contrib/release: check NEWS file before release
This commit is contained in:
@@ -55,7 +55,7 @@ echo_color() {
|
|||||||
|
|
||||||
print_usage() {
|
print_usage() {
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " $BASH_SOURCE [devel|rc1|rc|major|major-post|minor] [--no-test] [--no-find-backports] [--no-cleanup] [--allow-local-branches] [--no-check-gitlab]"
|
echo " $BASH_SOURCE [devel|rc1|rc|major|major-post|minor] [--no-test] [--no-find-backports] [--no-cleanup] [--allow-local-branches] [--no-check-gitlab] [--no-check-news]"
|
||||||
}
|
}
|
||||||
|
|
||||||
die_help() {
|
die_help() {
|
||||||
@@ -156,6 +156,23 @@ set_version_number() {
|
|||||||
set_version_number_meson "$@"
|
set_version_number_meson "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_news() {
|
||||||
|
local mode="$1"
|
||||||
|
shift
|
||||||
|
local ver_arr=("$@")
|
||||||
|
|
||||||
|
case "$mode" in
|
||||||
|
major|minor)
|
||||||
|
if git grep -q 'NOT RECOMMENDED FOR PRODUCTION USE' -- ./NEWS ; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
DO_CLEANUP=1
|
DO_CLEANUP=1
|
||||||
CLEANUP_CHECKOUT_BRANCH=
|
CLEANUP_CHECKOUT_BRANCH=
|
||||||
CLEANUP_REFS=()
|
CLEANUP_REFS=()
|
||||||
@@ -186,6 +203,7 @@ FIND_BACKPORTS=1
|
|||||||
ALLOW_LOCAL_BRANCHES=0
|
ALLOW_LOCAL_BRANCHES=0
|
||||||
HELP_AND_EXIT=1
|
HELP_AND_EXIT=1
|
||||||
CHECK_GITLAB=1
|
CHECK_GITLAB=1
|
||||||
|
CHECK_NEWS=1
|
||||||
while [ "$#" -ge 1 ]; do
|
while [ "$#" -ge 1 ]; do
|
||||||
A="$1"
|
A="$1"
|
||||||
shift
|
shift
|
||||||
@@ -209,6 +227,9 @@ while [ "$#" -ge 1 ]; do
|
|||||||
--no-check-gitlab)
|
--no-check-gitlab)
|
||||||
CHECK_GITLAB=0
|
CHECK_GITLAB=0
|
||||||
;;
|
;;
|
||||||
|
--no-check-news)
|
||||||
|
CHECK_NEWS=0
|
||||||
|
;;
|
||||||
--help|-h)
|
--help|-h)
|
||||||
die_help
|
die_help
|
||||||
;;
|
;;
|
||||||
@@ -337,6 +358,13 @@ if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
|
|||||||
cmp <(git show origin/master:contrib/fedora/rpm/release.sh) "$BASH_SOURCE" || die "$BASH_SOURCE is not identical to \`git show origin/master:contrib/fedora/rpm/release.sh\`"
|
cmp <(git show origin/master:contrib/fedora/rpm/release.sh) "$BASH_SOURCE" || die "$BASH_SOURCE is not identical to \`git show origin/master:contrib/fedora/rpm/release.sh\`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! check_news "$RELEASE_MODE" "@{VERSION_ARR[@]}" ; then
|
||||||
|
if [ "$CHECK_NEWS" == 1 ]; then
|
||||||
|
die "NEWS file needs update to mention stable release (skip check with --no-check-news)"
|
||||||
|
fi
|
||||||
|
echo "WARNING: NEWS file needs update to mention stable release (test skipped with --no-check-news)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $FIND_BACKPORTS = 1 ]; then
|
if [ $FIND_BACKPORTS = 1 ]; then
|
||||||
git show "$ORIGIN/master:contrib/scripts/find-backports" > ./.git/nm-find-backports \
|
git show "$ORIGIN/master:contrib/scripts/find-backports" > ./.git/nm-find-backports \
|
||||||
&& chmod +x ./.git/nm-find-backports \
|
&& chmod +x ./.git/nm-find-backports \
|
||||||
|
Reference in New Issue
Block a user