forked from x42/libltc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·84 lines (63 loc) · 1.92 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
EDITOR=${EDITOR:-editor}
if test ! -d .git; then
echo "ERROR: This script runs only from a git repository."
exit 1
fi
if test "`git symbolic-ref HEAD`" != "refs/heads/master"; then
echo "ERROR: The git 'master' branch must be checked out."
exit 1
fi
echo "commit pending changes.."
git commit -a
# to bump the version number
# - src/ltc.h (this is the MAIN VERSION used by configure)
# and re-run autogen.sh to pick it up.
# - Changelog
# - debian/changelog (for the debian package)
echo "Update version number -- edit 3 files: src/ltc.h ChangeLog debian/changelog"
echo -n "launch editor ? [Y/n]"
read -n1 a
echo
if test "$a" != "n" -a "$a" != "N"; then
${EDITOR} src/ltc.h debian/changelog ChangeLog
sh autogen.sh
fi
VERSION=$(awk '/ VERSION /{print $3;}' src/config.h | sed 's/"//g')
if [ -z "$VERSION" ]; then
echo "unknown VERSION number"
exit 1;
fi
echo "VERSION: $VERSION"
echo -n "Is this correct? [Y/n]"
read -n1 a
echo
if test "$a" == "n" -o "$a" == "N"; then
exit 1
fi
echo "re-creating man-pages and documentation with new version-number.."
make dox
echo "creating git-commit of updated doc & version number"
git commit -m "finalize changelog v${VERSION}" src/ltc.h ChangeLog debian/changelog doc/man/man3/ltc.h.3
cd doc/html
git add *.*
git commit -a -m "doxgen -- v${VERSION}"
cd ../..
git tag "v${VERSION}" || (echo -n "version tagging failed. - press Enter to continue, CTRL-C to stop."; read; )
echo -n "git push? [Y/n]"
read -n1 a
echo
if test "$a" != "n" -a "$a" != "N"; then
git push origin || exit 1
#git push --tags ## would push ALL existing tags,
git push origin "refs/tags/v${VERSION}:refs/tags/v${VERSION}" || exit 1
cd doc/html
git push origin gh-pages || exit 1
cd ../..
fi
make distcheck
ls -l "libltc-${VERSION}.tar.gz"
GITREPO="x42/libltc"
# open windows for github release drag/drop (until this can be scripted)
xdg-open ./
x-www-browser https://github.com/${GITREPO}/releases/