X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=release.sh;h=01089e4865deb5b17315bacb194f59568f74b386;hb=ebf77a9fa6953523975f7ee608a05e1c66c43e47;hp=84fd072b83606945d46bc24ebdc17f1e2b58c211;hpb=806e1ea5f693c8e0788094faf0d2029a1fa8c836;p=dygraphs.git diff --git a/release.sh b/release.sh index 84fd072..01089e4 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! @@ -30,11 +42,24 @@ if [ $? -ne 0 ]; then exit 1 fi -# Everything is good. Tag this release and push it. +# Everything is good. +# Switch to the "releases" branch, merge this change and tag it. +echo "Switching branches to do the release." +git checkout releases +git merge --no-ff $branch + COMMIT=$(git rev-parse HEAD) echo "Tagging commit $COMMIT as version $VERSION" -git tag -m "Release of version $VERSION" -git push +git tag -a "v$VERSION" -m "Release of version $VERSION" +git push --tags echo "Release was successful!" -echo "Don't forget to merge changes on this branch back into master." +echo "Pushing the new version to dygraphs.com..." +./push-to-web.sh dygraphs.com:dygraphs.com + +echo "Success!\n" +echo "Don't forget to merge changes on this branch back into master:" +echo "git merge --no-ff $branch" + +# Discourage users from working on the "releases" branch. +git checkout master