Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 48aa889

Browse files
author
Clément Le Provost
committed
Check that the Change Log contains the new version when releasing
1 parent 034ada8 commit 48aa889

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

release.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ fi
2828
VERSION_CODE=$1
2929

3030
# Check that the working repository is clean (without any changes, neither staged nor unstaged).
31-
if [[ ! -z `git status --porcelain` ]]; then
31+
# An exception is the change log, which should have been edited, but not necessarily committed (we usually commit it
32+
# along with the version number).
33+
if [[ ! -z `git status --porcelain | grep -v "ChangeLog.md"` ]]; then
3234
echo "ERROR: Working copy not clean! Aborting." 1>&2
3335
echo "Please revert or commit any pending changes before releasing." 1>&2
3436
exit 1
35-
fi
37+
fi
38+
39+
# Check that the change log contains information for the new version.
40+
set +e
41+
version_in_change_log=$(cat "$SELF_ROOT/ChangeLog.md" | grep -E "^#+" | sed -E 's/^#* ([0-9.]*)\s*.*$/\1/g' | grep -x "$VERSION_CODE")
42+
set -e
43+
if [[ -z $version_in_change_log ]]; then
44+
echo "Version $VERSION_CODE not found in change log! Aborting." 1>&2
45+
exit 2
46+
fi
3647

3748
$SELF_ROOT/tools/update-version.sh $VERSION_CODE
3849

0 commit comments

Comments
 (0)