Skip to content

Commit 3f61310

Browse files
authored
Check that $VERSION is in MAJOR.MINOR.PATCH format in release.sh (#227)
Lack of this check was the cause for two botched releases in the past few weeks where we forgot to add the `.0` at the end.
1 parent ec809e7 commit 3f61310

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
set -ex
2-
git tag $VERSION -a -m "release v$VERSION"
3-
git tag latest -f -a -m "release v$VERSION"
1+
#!/usr/bin/env bash
2+
3+
set -euf -o pipefail
4+
5+
if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
6+
echo "\$VERSION is not in MAJOR.MINOR.PATCH format"
7+
exit 1
8+
fi
9+
10+
git tag "${VERSION}" -a -m "release v${VERSION}"
11+
git tag latest -f -a -m "release v${VERSION}"
412
git push -f --tags

0 commit comments

Comments
 (0)