Development/ReleaseChecklist: make_release

File make_release, 1.1 KB (added by Cas, 9 years ago)
Line 
1#!/bin/bash
2
3# create archive from git:
4# git archive --format=tar --prefix=deluge-1.3.0/ 1.3-stable >deluge-1.3.0.tar
5#
6
7usage() {
8    echo ""
9    echo "Usage: source"
10    echo ""
11    echo "source must point to a branch directory to use"
12    echo ""
13    echo "Example: make_release deluge-1.2.0"
14    echo ""
15}
16
17src="$1"
18
19if [ ! -d $src ]; then
20    echo "$src is not a directory!"
21    usage
22    exit
23fi
24
25
26REMOVALS=( "$src/libtorrent" "$src/win32" "$src/docs/build" "$src/docs/source" "$src/tests" "$src/deluge/scripts" )
27
28
29for remove in ${REMOVALS[@]}
30do
31    if [ -d $remove ]; then
32       echo "Removing unwanted dir/file: $remove"
33       rm -r $remove
34    fi
35done
36
37
38if [ -f $src/setup.cfg ]; then
39    echo "Removing -dev build tag.."
40    sed -i 's/tag_build = -dev//g' $src/setup.cfg
41fi
42
43echo "Creating tarballs.."
44
45tar cf - $src | gzip -f9n > $src".tar.gz"
46tar -cjf $src".tar.bz2" $src
47tar --lzma -cf $src".tar.lzma" $src
48
49echo "Calculating hashes.."
50echo ""
51
52HASHES=( "sha1sum" "md5sum" )
53TARBALLS=( "$src.tar.gz" "$src.tar.bz2" "$src.tar.lzma" )
54
55for h in ${HASHES[@]}
56do
57    echo "$h:"
58    for tb in ${TARBALLS[@]}
59    do
60        $h $tb
61    done
62    echo ""
63done