Parse CHANGELOG before checking out target branch

This commit is contained in:
Janek Bevendorff 2017-02-11 17:19:46 +01:00
parent b367e105fa
commit 12f62df49a
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -347,15 +347,15 @@ merge() {
checkReleaseDoesNotExist
checkWorkingTreeClean
checkSourceBranchExists
checkTargetBranchExists
logInfo "Checking out source branch '${SOURCE_BRANCH}'..."
git checkout "$SOURCE_BRANCH"
checkVersionInCMake
checkChangeLog
logInfo "All checks pass, getting our hands dirty now!"
logInfo "Checking out source branch..."
git checkout "$SOURCE_BRANCH"
logInfo "Updating language files..."
./share/translations/update.sh
if [ 0 -ne $? ]; then
@ -372,15 +372,15 @@ merge() {
fi
fi
CHANGELOG=$(grep -Pzo "(?<=${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n)=+\n\n?(?:.|\n)+?\n(?=\n)" \
CHANGELOG | grep -Pzo '(?<=\n\n)(.|\n)+' | tr -d \\0)
COMMIT_MSG="Release ${RELEASE_NAME}"
logInfo "Checking out target branch '${TARGET_BRANCH}'..."
git checkout "$TARGET_BRANCH"
logInfo "Merging '${SOURCE_BRANCH}' into '${TARGET_BRANCH}'..."
CHANGELOG=$(grep -Pzo "(?<=${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n)=+\n\n?(?:.|\n)+?\n(?=\n)" \
CHANGELOG | grep -Pzo '(?<=\n\n)(.|\n)+' | tr -d \\0)
COMMIT_MSG="Release ${RELEASE_NAME}"
git merge "$SOURCE_BRANCH" --no-ff -m "$COMMIT_MSG" -m "${CHANGELOG}" "$SOURCE_BRANCH" -S"$GPG_GIT_KEY"
logInfo "Creating tag '${TAG_NAME}'..."