From: Dan Vanderkam Date: Tue, 13 Aug 2013 20:18:57 +0000 (-0400) Subject: checks and fixes in release.sh X-Git-Tag: v1.0.0 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=ea2d380511e283979a35040faffaa03578f250a4;p=dygraphs.git checks and fixes in release.sh --- diff --git a/release.sh b/release.sh index 84fd072..dc0e81b 100755 --- a/release.sh +++ b/release.sh @@ -20,6 +20,18 @@ if [ $branch != "release-$VERSION" ]; then exit 1 fi +git status | grep 'working directory clean' > /dev/null +if [ $? -ne 0 ]; then + echo "Must release with a clean working directory. Commit your changes." >&2 + exit 1 +fi + +make lint test test-combined +if [ $? -ne 0 ]; then + echo "Tests failed. Won't release!" >&2 + exit 1 +fi + # Push a permanent copy of documentation & generated files to a versioned copy # of the site. This is where the downloadable files are generated. # TODO(danvk): make sure this actually generates the downloadable files! @@ -33,7 +45,7 @@ fi # Everything is good. Tag this release and push it. COMMIT=$(git rev-parse HEAD) echo "Tagging commit $COMMIT as version $VERSION" -git tag -m "Release of version $VERSION" +git tag -a "v$VERSION" -m "Release of version $VERSION" git push echo "Release was successful!"