forked from timlau/FedoraReview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_release
executable file
·38 lines (29 loc) · 1.02 KB
/
make_release
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
#!/bin/bash
# reads version from setup.py, create a source tarball and optionally
# upload to fedorahosted
#
# Options: -b Batch mode, don't ask for fedorahosted upload
cd $( dirname $( readlink -fn $0 ))
status=$( git status --short )
[ -n "$status" ] && echo 'Warning: there are uncommitted changes' >&2
badlinks=$( find . -type l ! -execdir test -e '{}' \; -print | nl )
[ -n "$badlinks" ] && echo "Warning: unresolved symlinks: $badlinks" >&2
./update-version
source src/FedoraReview/version
dfile="dist/fedora-review-$__version__.tar.gz"
[ -f ${dfile} ] && echo Removing: $dfile
rm -f $dfile
env PYTHONPATH=src python setup.py --quiet clean
env PYTHONPATH=src python setup.py --quiet build sdist
if [ ! -e "$dfile" ]; then
echo "Error: could not create $dfile"
exit 1
fi
echo "Created: $dfile"
[ "$1" = '-b' ] && exit 0
read -i 'n' -e -p "Do you want to upload file $dfile to fedorahosted? (y/n): "
if [ "$REPLY" = "y" ];then
scp "${dfile}" fedorahosted.org:FedoraReview
git tag $__version__
git push --tags
fi