-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: Add release.sh script for easy releases
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |