source: scripts/do-release @ 2b6622a6

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