backport auto pre-releases on -rc branches

This commit is contained in:
Jonathan Shook 2020-12-07 13:37:28 -06:00
parent d089ff2450
commit 2bfe24eb9b
2 changed files with 13 additions and 2 deletions

View File

@ -19,10 +19,15 @@ if [[ "${last_release_commit_hash}" = "${GITHUB_SHA}" ]]; then
exit 0
fi
PRERELEASE_BRANCH_PATTERN=${PRERELEASE_BRANCH_PATTERN:?PRERELEASE_BRANCH_PATTERN must be provided}
# Filter the branch to execute the release on
readonly local current_branch=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: ${branch}"
if [[ -n "$RELEASE_BRANCH_NAME" && ! "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then
if [[ -n "$RELEASE_BRANCH_NAME" && "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then
echo "Building for release branch $RELEASE_BRANCH_NAME"
elif [[ -n "${current_branch}" && "${current_branch}" == *"${PRERELEASE_BRANCH_PATTERN}"* ]]; then
echo "Building prerelease for branch $RELEASE_BRANCH_NAME"
else
echo "Skipping for ${current_branch} branch"
exit 0
fi

View File

@ -6,12 +6,18 @@ GIT_RELEASE_BOT_NAME=${GIT_RELEASE_BOT_NAME:?GIT_RELEASE_BOT_NAME must be provid
GITHUB_SHA=${GITHUB_SHA:?GITHUB_SHA must be provided}
GITHUB_REF=${GITHUB_REF:?GITHUB_REF must be provided}
RELEASE_BRANCH_NAME=${RELEASE_BRANCH_NAME:?RELEASE_BRANCH_NAME must be provided}
PRERELEASE_BRANCH_PATTERN=${PRERELEASE_BRANCH_PATTERN:?PRERELEASE_BRANCH_PATTERN must be provided}
#git rev-parse --abbrev-ref HEAD
# Filter the branch to execute the release on
readonly local current_branch=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: ${current_branch}"
if [[ -n "$RELEASE_BRANCH_NAME" && ! "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then
if [[ -n "$RELEASE_BRANCH_NAME" && "${current_branch}" = "$RELEASE_BRANCH_NAME" ]]; then
echo "Building for release branch $RELEASE_BRANCH_NAME"
elif [[ -n "${current_branch}" && "${current_branch}" == *"${PRERELEASE_BRANCH_PATTERN}"* ]]; then
echo "Building prerelease for branch $RELEASE_BRANCH_NAME"
else
echo "Skipping for ${current_branch} branch"
exit 0
fi