Skip to content

Commit

Permalink
Dev: Add release.sh script for easy releases
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Dec 10, 2016
1 parent bbde2bc commit 0304ba8
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash

set -e

if [ "$#" -ne 1 ]; then
echo ERROR: Please supply the version number
exit 1
fi

if [[ "$1" != v* ]]; then
echo ERROR: The version number should start with a v
exit 1
fi

if [[ -n $(git status --porcelain) ]]; then
echo "ERROR: repo is dirty, please commit everything"
exit 1
fi

if ! grep $1 docs/source/changelog.rst > /dev/null; then
echo "ERROR: You forgot to update the changelog"
exit 1
fi

set -x

git tag $1

./convert_to_py2.sh

cd docs
./create_doc_files.sh
make clean
make html
cd gh-pages
git add -A
git commit -m "Updating docs to version $1"

while true; do
read -p "Going to irreversibly release stuff now as $1. Are you sure y/n?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done

git push

git submodule add --force ../PyLaTeX.git version_submodules/$1
cd version_submodules/$1
git checkout gh-pages
git pull
cd ../../

ln -s version_submodules/$1/latest/ $1
rm current
ln -s $1 current
git add -A
git commit -m "Updated symlinks for version $1"

while true; do
read -p "Going to irreversibly release stuff now as $1. Are you sure y/n?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done


git push

cd ../..

git push
git push --tags
python setup.py sdist upload

0 comments on commit 0304ba8

Please sign in to comment.