source: scripts/do-release @ ce27cc1

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since ce27cc1 was b9df757, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
do-release: Support -f to release without a changelog
  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/sh -e
2
3die() {
4    echo "$@" >&2
5    exit 1
6}
7
8force=
9
10if [ "$1" = "-f" ]; then
11    force=1
12fi
13
14VERS=$(perl -ne 'print $1 if m{^AC_INIT\(\[[^\]]+\],\s*\[([^\]]+)\]}' configure.ac) \
15    || die "Unable to parse barnowl version"
16TAG=barnowl-$VERS
17TGZ="$TAG-src"
18
19if [ ! "$force" ] && [ "$VERS" != "$(head -1 ChangeLog)" ]; then
20    die "No ChangeLog entry for version $VERS, aborting."
21fi
22
23if git cat-file -t "$TAG" > /dev/null 2>&1; then
24    die "Error: Object $TAG already exists."
25fi
26
27exittrap() { :; }
28for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done
29trap 'exittrap' EXIT
30
31git tag -s -m "BarnOwl $VERS" "$TAG"
32
33TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX)
34
35exittrap() { rm -rf "$TMPDIR"; }
36
37git archive --format=tar --prefix="$TGZ/" "$TAG" | tar -x -C "$TMPDIR"
38
39CODIR=$(pwd)
40cd "$TMPDIR/$TGZ"
41autoreconf -fvi
42cd "$TMPDIR"
43tar czvf "$TGZ.tgz" "$TGZ"
44cd "$CODIR"
45
46mv "$TMPDIR/$TGZ.tgz" .
47rm -rf "$TMPDIR"
48
49exittrap() { :; }
50
51echo "Created release tarball for BarnOwl $VERS in $(pwd)"
52echo "Remember to bump OWL_VERSION_STRING for future development."
53
54COMMIT=$(git rev-parse "$TAG")
55NOW=$(date +"%B %d, %Y")
56cat <<EOF
57 * '''$NOW''': BarnOwl $VERS Released. [wiki:Download] it here. or see the [/browser/ChangeLog?rev=$COMMIT ChangeLog]
58EOF
Note: See TracBrowser for help on using the repository browser.