-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrelease.sh
executable file
·50 lines (36 loc) · 1.1 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
#!/bin/bash
set -e
set -u
PACKAGING_DIR=~/projects/packaging/firelet
PACKAGING_OUT_DIR=~/projects/packaging/build-area
function ask() {
echo -ne "\n$1 [y/N]? "; read ANS
[[ $ANS == "y" ]] && return 0;
return 1;
}
# Extract version
V=$(python -c 'from firelet.flcore import __version__ as v; print v')
if ! ask "release v. $V"; then exit; fi
# Based on the __version__ value in flcore.py , build:
#tar.gz source:
python setup.py sdist
# binary rpm
# binary tar.gz
python setup.py bdist --formats=gztar,rpm
if ask "Upload to pypi"; then
python setup.py sdist upload -i C6856512 -s
fi
# Debian packaging
if ask "Perform Debian packaging"; then
cp dist/firelet-"$V".tar.gz ../packaging/tarballs/firelet_"$V".orig.tar.gz
ODIR=$(pwd)
cd $PACKAGING_DIR
git-import-orig ../tarballs/firelet_"$V".orig.tar.gz
dch -v $V-1 --distribution experimental 'New upstream release'
git commit -a -m "New upstream release: $V"
git-buildpackage --git-ignore-new
if ask "Install .deb package locally"; then
cd $PACKAGING_OUT_DIR
sudo dpkg -i firelet_$V-1_all.deb
fi
fi