/
make-release
executable file
·57 lines (37 loc) · 1.22 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
#set -x
# determine absolute path to source dir root
srctree="$(cd $(dirname "$0") && cd .. && pwd)"
# change to scripts dir (or wherever this script resides)
cd "$(dirname "$0")"
if [ ! -f ./make-release ]; then
echo "need to be in scripts dir"; exit 1;
fi
. ../vsn.mk
echo packing release ${YAWS_VSN}
TAG="yaws-${YAWS_VSN}"
NAME_VERSION="yaws-${YAWS_VSN}"
(cd ../win32; make clean all)
cd ../..
export GIT_DIR="$srctree/.git"
if test -d "$GIT_DIR" && test -f "$GIT_DIR/config"; then :;
else
echo "Fatal: Could not find GIT_DIR at $GIT_DIR."
exit 13
fi
# Add/update release tag
git tag -f -a -m "version ${YAWS_VSN}" "$TAG"
# Create release .tar.gz of sources
# (including symlink yaws -> $NAME_VERSION)
rm -rf tmp 2> /dev/null
mkdir tmp
git archive --format=tar --prefix="$NAME_VERSION/" "$TAG" | (cd tmp && tar xf -)
ln -s $NAME_VERSION tmp/yaws
(cd tmp/yaws; autoconf)
(cd tmp && tar cfz - yaws "$NAME_VERSION") > "$NAME_VERSION.tar.gz"
echo release resides in `pwd`/$NAME_VERSION.tar.gz
echo release resides in `pwd`/yaws/win32/Yaws-${YAWS_VSN}-windows-installer.exe
echo "To push this do:"
#echo "git push origin revs/tags/yaws-${version}:revs/tags/yaws-${version}"
echo "ehhh or git push --tags"
exit 0