-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: define check ensuring migration guide is defined
- Loading branch information
1 parent
a535375
commit 22cfb52
Showing
2 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
: "${1?"Tag of new release must be provided"}" | ||
|
||
RELEASE_TAG=$1 | ||
RELEASE_NUMBER=$(echo "${RELEASE_TAG}" | tr -d v) | ||
|
||
IFS='.' read -r MAJOR MINOR PATCH <<< "$RELEASE_NUMBER" | ||
|
||
# Check if it's a major release (patch version is 0) | ||
if [ "$PATCH" -eq 0 ]; then | ||
UPGRADE_GUIDE_PATH="website/docs/guides/$MAJOR.$MINOR.$PATCH-upgrade-guide.html.markdown" | ||
echo "Checking for the presence of $UPGRADE_GUIDE_PATH" | ||
if [ ! -f "$UPGRADE_GUIDE_PATH" ]; then | ||
echo "Stopping release procees, upgrade guide $UPGRADE_GUIDE_PATH does not exist." | ||
exit 1 | ||
else | ||
echo "Upgrade guide $UPGRADE_GUIDE_PATH exists." | ||
fi | ||
else | ||
echo "No upgrade guide needed." | ||
fi |