Skip to content

Commit 0304ba8

Browse files
committed
Dev: Add release.sh script for easy releases
1 parent bbde2bc commit 0304ba8

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

release.sh

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ "$#" -ne 1 ]; then
6+
echo ERROR: Please supply the version number
7+
exit 1
8+
fi
9+
10+
if [[ "$1" != v* ]]; then
11+
echo ERROR: The version number should start with a v
12+
exit 1
13+
fi
14+
15+
if [[ -n $(git status --porcelain) ]]; then
16+
echo "ERROR: repo is dirty, please commit everything"
17+
exit 1
18+
fi
19+
20+
if ! grep $1 docs/source/changelog.rst > /dev/null; then
21+
echo "ERROR: You forgot to update the changelog"
22+
exit 1
23+
fi
24+
25+
set -x
26+
27+
git tag $1
28+
29+
./convert_to_py2.sh
30+
31+
cd docs
32+
./create_doc_files.sh
33+
make clean
34+
make html
35+
cd gh-pages
36+
git add -A
37+
git commit -m "Updating docs to version $1"
38+
39+
while true; do
40+
read -p "Going to irreversibly release stuff now as $1. Are you sure y/n?" yn
41+
case $yn in
42+
[Yy]* ) break;;
43+
[Nn]* ) exit;;
44+
* ) echo "Please answer yes or no.";;
45+
esac
46+
done
47+
48+
git push
49+
50+
git submodule add --force ../PyLaTeX.git version_submodules/$1
51+
cd version_submodules/$1
52+
git checkout gh-pages
53+
git pull
54+
cd ../../
55+
56+
ln -s version_submodules/$1/latest/ $1
57+
rm current
58+
ln -s $1 current
59+
git add -A
60+
git commit -m "Updated symlinks for version $1"
61+
62+
while true; do
63+
read -p "Going to irreversibly release stuff now as $1. Are you sure y/n?" yn
64+
case $yn in
65+
[Yy]* ) break;;
66+
[Nn]* ) exit;;
67+
* ) echo "Please answer yes or no.";;
68+
esac
69+
done
70+
71+
72+
git push
73+
74+
cd ../..
75+
76+
git push
77+
git push --tags
78+
python setup.py sdist upload

0 commit comments

Comments
 (0)