-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·58 lines (41 loc) · 1.5 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
#!/bin/bash
set -ex
VERSION=$(python -c "from jira.version import __version__ ; print __version__")
echo Preparing to release version $VERSION
#source tox
#pip install --upgrade pep8 autopep8 docutils
echo === Testings ===
#if ! python setup.py test; then
# echo "The test suite failed. Fix it!"
# exit 1
#fi
echo === Chechink that all changes are commited and pushed ===
git pull -u
git diff
# Disallow unstaged changes in the working tree
if ! git diff-files --check --exit-code --ignore-submodules -- >&2
then
echo >&2 "error: you have unstaged changes."
#git diff-files --check --exit-code --ignore-submodules -- >&2
exit 1
fi
# Disallow uncommitted changes in the index
if ! git diff-index --cached --exit-code -r --ignore-submodules HEAD -- >&2
then
echo >&2 "error: your index contains uncommitted changes."
exit 1
fi
echo "Please don't run this as a user. This generates a new release for PyPI. Press ^C to exit or Enter to continue."
read
# Clear old distutils stuff
rm -rf build dist MANIFEST &> /dev/null
# Build installers, etc. and upload to PyPI
# python setup.py register sdist bdist_wininst upload
#python setup.py register sdist build_sphinx upload upload_sphinx
python setup.py register sdist bdist_wheel upload_docs upload --sign
git log --date=short --pretty=format:"%cd %s" > RELEASE
git add RELEASE
git tag -f -a $VERSION -m "Version $VERSION"
git tag -f -a RELEASE -m "Current RELEASE"
git push --force origin --tags
echo "done."