2 # This script "releases" a version of dygraphs.
5 echo "Usage: $0 X.Y.Z" >&2
10 echo $VERSION |
egrep '\d+\.\d+\.\d+' > /dev
/null
12 echo "Version must be of the form 1.2.3 (got '$VERSION')" >&2
16 # Make sure this is being run from a release branch with the correct name.
17 branch
=$
(git rev-parse
--abbrev-ref HEAD
)
18 if [ $branch != "release-$VERSION" ]; then
19 echo "Must be on a branch named 'release-$VERSION' (found '$branch')" >&2
23 git status |
grep 'working directory clean' > /dev
/null
25 echo "Must release with a clean working directory. Commit your changes." >&2
29 grep "$VERSION" package.json
31 echo "Version in package.json doesn't match command line argument." >&2
35 grep "$VERSION" releases.json
37 echo "Version $VERSION does not appear in releases.json." >&2
46 # Push a permanent copy of documentation & generated files to a versioned copy
47 # of the site. This is where the downloadable files are generated.
48 # TODO(danvk): make sure this actually generates the downloadable files!
49 echo "Pushing docs and generated files to dygraphs.com/$VERSION"
50 .
/push-to-web.sh dygraphs.com
:dygraphs.com
/$VERSION
52 echo "Push to web failed" >&2
58 COMMIT
=$
(git rev-parse HEAD
)
59 echo "Tagging commit $COMMIT as version $VERSION"
60 git tag
-a
"v$VERSION" -m
"Release of version $VERSION"
63 echo "Release was successful!"
64 echo "Pushing the new version to dygraphs.com..."
65 .
/push-to-web.sh dygraphs.com
:dygraphs.com
69 # Discourage users from working on the "releases" branch.