-
Notifications
You must be signed in to change notification settings - Fork 287
/
release.sh
executable file
·84 lines (65 loc) · 1.45 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/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
./testall.sh
set -x
git tag "$1" -a -m ''
cd docs/gh-pages
git pull
git submodule update --init
cd ..
./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 -rp "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 -rp "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
rm -rf dist
python setup.py sdist
twine upload dist/*