forked from netoptimizer/IPTV-Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·62 lines (52 loc) · 1.74 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
59
60
61
62
#! /bin/bash
#
# Script for making releases, where you are forced to create a git tag
# before you can make a release. If you want tarballs without using a
# git tag, then use the make tarball system.
#
set -e
NAME=iptv-analyzer
VERSION=0.10.0
PREV_VERSION=0.9.4
GPGKEY="3B37BCED"
echo "Creating tarball for release: $NAME-$VERSION"
echo "============================="
# Create a unique tempdir, to avoid leftovers from older release builds
TMPDIR=`mktemp -dt $NAME.XXXXXXXXXX`
trap 'rm -rf $TMPDIR' EXIT
#echo TMPDIR:$TMPDIR
PKGDIR="$TMPDIR/${NAME}-${VERSION}"
#echo PKGDIR:$PKGDIR
RELDIR=release
if [ ! -d $RELDIR ]; then
mkdir -p $RELDIR
fi
VERSION_TAG="v${VERSION}"
#VERSION_TAG=HEAD #HACK for testing
# Compression packer tool
packer=gzip
packext=gz
#PATCH="$RELDIR/patch-$NAME-$PREV_VERSION-$VERSION.$packext";
TARBALL="$RELDIR/$NAME-$VERSION.tar.$packext";
CHANGES="$RELDIR/changes-$NAME-$PREV_VERSION-$VERSION.txt";
#mkdir -p "$TMPDIR"
echo " -- Git shortlog v$PREV_VERSION..$VERSION_TAG"
git shortlog "v$PREV_VERSION..$VERSION_TAG" > "$CHANGES"
#git diff "v$PREV_VERSION..$VERSION_TAG" | $packer > "$PATCH"
echo " -- Git archiving version tag $VERSION_TAG"
git archive --prefix="$NAME-$VERSION/" "$VERSION_TAG" | tar -xC "$TMPDIR/"
pushd "$PKGDIR" > /dev/null && {
echo " -- Generating configure scripts..."
sh autogen.sh
popd > /dev/null
}
echo " -- Creating tarball $TARBALL"
tar --use=${packer} -C "$TMPDIR" -cf "$TARBALL" "$NAME-$VERSION";
echo " -- Calculating checksums"
md5sum "$TARBALL" >"${TARBALL}.md5sum";
sha1sum "$TARBALL" >"${TARBALL}.sha1sum";
echo " -- You need to sign the tarball"
gpg -u "$GPGKEY" -sb "$TARBALL";
#gpg -u "$GPGKEY" -sb "$PATCH";
#md5sum "$PATCH" >"${PATCH}.md5sum";
#sha1sum "$PATCH" >"${PATCH}.sha1sum";