Skip to content

Commit 703a7ae

Browse files
committed
Update release script to validate version provided.
- Assert that 'v' is not prefixed. - Assert that the version tag is in v\d+.\d+.\d+(-\w+(\.\d+)?)? format
1 parent e239824 commit 703a7ae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

script/release

+14
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ if [ -z "`which $POD`" ]; then
5252
fi
5353
echo " > Cocoapods is installed"
5454

55+
echo " > Is this a reasonable tag?"
56+
57+
echo $VERSION_TAG | grep -q "^vv"
58+
if [ $? -eq 0 ]; then
59+
die "This tag ($VERSION) is an incorrect format. You should remove the 'v' prefix."
60+
fi
61+
62+
echo $VERSION_TAG | grep -q -E "^v\d+\.\d+\.\d+(-\w+(\.\d)?)?\$"
63+
if [ $? -ne 0 ]; then
64+
die "This tag ($VERSION) is an incorrect format. It should be in 'v{MAJOR}.{MINOR}.{PATCH}(-{PRERELEASE_NAME}.{PRERELEASE_VERSION})' form."
65+
fi
66+
5567
echo " > Is this version ($VERSION) unique?"
5668
git describe --exact-match "$VERSION_TAG" 2>&1 > /dev/null
5769
if [ $? -eq 0 ]; then
@@ -162,3 +174,5 @@ echo " - Paste the contents of $RELEASE_NOTES into the release notes. Tweak fo
162174
echo " - Attach ${CARTHAGE_FRAMEWORK_NAME}.framework.zip to it."
163175
echo " - Announce!"
164176

177+
rm Nimble.podspec.backup
178+

0 commit comments

Comments
 (0)