Skip to content

Commit

Permalink
Improved update_version.sh for better automation of SDK release.
Browse files Browse the repository at this point in the history
  • Loading branch information
starforever committed Jun 13, 2019
1 parent a58eb06 commit d02263d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion update_version.sh
@@ -1,9 +1,26 @@
#!/bin/sh

if [ -z $1 ]; then
echo "error: $0 needs a version number as argument. Current version: `python -c 'import dropbox; print(dropbox.__version__)'`";
echo "error: $0 needs a version number as argument.";
exit 1
else
set -ex
NEW_VERSION=$1

git checkout master
git reset --hard HEAD
git checkout -b "tmp-release-${NEW_VERSION}"

perl -pi -e "s/^__version__ = .*$/__version__ = '$1'/g" dropbox/dropbox.py
perl -pi -e 's/(\?branch=)master$/\1\v'$1'/g ;' -e 's/(\?version=)latest$/\1\stable/g ;' -e 's/(\/en\/)latest(\/)$/\1\stable\2/g ;' -e 's/(\[Latest) (Documentation\])$/\1 Release \2/g ;' README.rst

git add -u
git commit -m "${NEW_VERSION} release"
git tag "v${NEW_VERSION}" -m "${NEW_VERSION} release"

git checkout master
git branch -D "tmp-release-${NEW_VERSION}"

git push origin
git push origin --tags
fi

0 comments on commit d02263d

Please sign in to comment.