X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=release.sh;h=909e10930eaf5fe0d64d665bbb4b65cf691dc006;hb=e8c635cc4e3c265e88f66b46b689e291531330b6;hp=87bcc1d76ff7935598954510ea60897ec7857b86;hpb=06682812a5dee4f35ff02be8fab630ca722edc81;p=dygraphs.git diff --git a/release.sh b/release.sh index 87bcc1d..909e109 100755 --- a/release.sh +++ b/release.sh @@ -26,6 +26,18 @@ if [ $? -ne 0 ]; then exit 1 fi +grep "$VERSION" package.json +if [ $? -ne 0 ]; then + echo "Version in package.json doesn't match command line argument." >&2 + exit 1 +fi + +grep "v$VERSION" bower.json +if [ $? -ne 0 ]; then + echo "Version in bower.json doesn't match command line argument." >&2 + exit 1 +fi + make lint test test-combined if [ $? -ne 0 ]; then echo "Tests failed. Won't release!" >&2 @@ -42,11 +54,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 -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