From 64cf5ff6ebceb9713826aeedecc2a44e88f88835 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 4 Feb 2009 18:41:12 +0100 Subject: [PATCH] Add release script documenting the release procedure --- Makefile | 14 --------- contrib/release.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 14 deletions(-) create mode 100755 contrib/release.sh diff --git a/Makefile b/Makefile index 252d1b7..d764644 100644 --- a/Makefile +++ b/Makefile @@ -130,20 +130,6 @@ rpm: dist configure: configure.ac acinclude.m4 $(AUTORECONF) -v -# Maintainer stuff -release-doc: - git checkout release && \ - git merge master && \ - $(MAKE) distclean doc-man doc-html sysconfdir=++SYSCONFDIR++ && \ - git add -f $(MANDOC) $(HTMLDOC) && \ - git commit -m "Sync docs" && \ - git checkout master - -release-dist: release-doc - git checkout release && \ - $(MAKE) dist && \ - git checkout master - .PHONY: all all-debug doc doc-man doc-html install install-doc \ install-doc-man install-doc-html clean spell-check dist rpm diff --git a/contrib/release.sh b/contrib/release.sh new file mode 100755 index 0000000..2c82fab --- /dev/null +++ b/contrib/release.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Script for preparing a release or updating the release branch. +# Usage: $0 version +# +# Copyright (c) 2009 Jonas Fonseca +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +set -e +set -x + +VERSION="$1" + +TAG="tig-$VERSION" +TITLE="$TAG\n$(echo "$TAG" | sed 's/./-/g')" + +# Require a clean repository. +git update-index --refresh +git diff-index --quiet HEAD + +if test -n "$VERSION"; then + # Get a sane starting point. + test "$(git symbolic-ref HEAD)" = "refs/heads/master" || + git checkout master + + # Update files which should reference the version. + echo "$VERSION" > VERSION + perl -pi -e 's/^tig master.*/@@TITLE@@/ms' NEWS + perl -pi -e "s/^@@TITLE@@.*/$TITLE/" NEWS + + # Check for typos. + make spell-check + + # Last review. + $EDITOR NEWS + + # Create release commit and tag. + git commit -a -m "$TAG" + git tag -s -m "tig version $VERSION" "$TAG" + + # Prepare release announcement file. + ./contrib/announcement.sh "$TAG" > "$TAG.txt" + + # Set version for the Makefile + export DIST_VERSION="$VERSION" +else + # Get meaningful version for the update message. + TAG="$(git describe)" +fi + +# Update the release branch. +git checkout release +HEAD="$(git rev-parse release)" +git merge master +if test -n "$(git rev-list -1 release ^$HEAD)"; then + make distclean doc-man doc-html sysconfdir=++SYSCONFDIR++ + git commit -a -m "Update for version $TAG" +fi + +if test -n "$VERSION"; then + # Create the tarball. + make dist +fi + +# Done. +git checkout master -- 2.30.2