forked from pycontribs/jira
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·52 lines (39 loc) · 1.44 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
#!/bin/bash
set -e
VERSION=$(python -c "from jira.version import __version__ ; print __version__")
echo Preparing to release version $VERSION
echo === Checking 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."
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
git log --date=short --pretty=format:"%cd %s" > CHANGELOG
git diff
if [ -v PS1 ] ; then
echo "Automatic deployment"
else
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
fi
git add CHANGELOG
git commit -a "Auto-generating release notes."
git tag -a $VERSION -m "Version $VERSION"
git tag -f -a RELEASE -m "Current RELEASE"
NEW_VERSION="${VERSION%.*}.$((${VERSION##*.}+1))"
set -ex
sed -i ~ "s/${VERSION}/${NEW_VERSION}/" jira/version.py
git commit -a "Auto-increasing the version number after a release."
# disables because this is done only by Travis CI from now, which calls this script after that.
#python setup.py register sdist bdist_wheel build_sphinx upload_docs upload --sign
git push --force origin --tags
echo "done."