diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2010-10-01 18:17:13 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-10-15 16:18:01 +0100 |
commit | 47dc07b0518e79fd5ccb5824286dd475a59e09f2 (patch) | |
tree | 12912cfb7d3916ab816c7d402d2c5b42cffdf456 /tools | |
parent | 0e6ac1b857bd67cf69edd326ebec91fa1cfa6e43 (diff) |
Automate the release process.
This was originally 8bf825940c834b44e7c7ceb17b26b30e5ff96aba in Gabble.
The idea is that you smoke-test the release, then just run
% make maintainer-make-release
which generates the tarball, the signature, the signed tag, and the
release mail, uploads the release to telepathy.freedesktop.org, and then
reminds you of the remaining steps (nano version bump, pushing to
upstream, and sending the mail).
If you want to do all the local bits, but not send anything, just run:
% make maintainer-prepare-release
then do whatever you want to do with the tarball etc. If you think it's
ready, run:
% make maintainer-upload-release
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 1 | ||||
-rw-r--r-- | tools/make-release-mail.py | 76 | ||||
-rw-r--r-- | tools/telepathy.am | 34 |
3 files changed, 107 insertions, 4 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index 1a3c945d6..a40c28b31 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -27,6 +27,7 @@ EXTRA_DIST = \ lcov.am \ libtpcodegen.py \ libglibcodegen.py \ + make-release-mail.py \ make-version-script.py \ manager-file.py \ shave.mk \ diff --git a/tools/make-release-mail.py b/tools/make-release-mail.py new file mode 100644 index 000000000..2bd7c2bcc --- /dev/null +++ b/tools/make-release-mail.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# vim: set fileencoding=utf-8 : +# +# Hello. This is make-release-mail.py from the Telepathy project. It's +# designed to turn an item from a NEWS file into a mail suitable for sending +# to <telepathy@lists.freedesktop.org>. I hope that you enjoy your stay. + +import sys + +def extract_description(package, version, news_path): + release_name = [] + details = [] + + with open(news_path) as f: + lines = (line for line in f.readlines()) + for line in lines: + # Find the 'telepathy-foo 0.1.2' header + if line.startswith("%s %s" % (package, version)): + break + + # Skip the ====== line, and the first blank line + lines.next() + lines.next() + + got_release_name = False + + for line in lines: + line = line.rstrip() + # If we hit the next version header, we're done + if line.startswith(package): + break + # Else, if we hit a blank line and we're still reading the release + # name, we're done with the release name. + elif not got_release_name and line == '': + got_release_name = True + # Otherwise, append this to the relevant list + elif not got_release_name: + release_name.append(line) + else: + details.append(line) + + assert got_release_name, (release_name, details) + + # We rstrip details because it picks up a trailing blank line + return ('\n'.join(release_name), '\n'.join(details).rstrip()) + +BASE_URL = 'http://telepathy.freedesktop.org/releases' + +def main(package, version, news_path): + release_name, details = extract_description(package, version, news_path) + + print """ +%(release_name)s + +tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz +signature: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz.asc + +%(details)s""".strip().rstrip() % { + 'base_url': BASE_URL, + 'package': package, + 'version': version, + 'release_name': release_name, + 'details': details, + } + +if __name__ == '__main__': + try: + package, version, news_path = sys.argv[1:] + + main(package, version, news_path) + except ValueError, e: + sys.stderr.write( + 'Usage: %s package-name package.version.number path/to/NEWS\n' % + sys.argv[0]) + sys.stderr.flush() + sys.exit(1) diff --git a/tools/telepathy.am b/tools/telepathy.am index 6e11fc66f..a2b7645ca 100644 --- a/tools/telepathy.am +++ b/tools/telepathy.am @@ -19,15 +19,35 @@ distcheck-hook: ;; \ esac -maintainer-upload-release: _maintainer-upload-release - -_maintainer-upload-release-check: +_is-release-check: @case @VERSION@ in \ (*.*.*.*) \ - echo "@VERSION@ is not a release" >&2; \ + echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac + @if ! git diff --no-ext-diff --quiet --exit-code; then \ + echo "Hey! Your tree is dirty! No release for you." >&2; \ + exit 2; \ + fi + +%.tar.gz.asc: %.tar.gz + $(AM_V_GEN)gpg --detach-sign --armor $@ + +@PACKAGE@-@VERSION@.tar.gz: _is-release-check check distcheck + +maintainer-prepare-release: _is-release-check check distcheck release-mail + git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ + gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz + +release-mail: NEWS + $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ + @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ + mv $@.tmp $@) + +maintainer-upload-release: _maintainer-upload-release + +_maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc @@ -36,4 +56,10 @@ _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc +maintainer-make-release: maintainer-prepare-release maintainer-upload-release + @echo "Now:" + @echo " • bump the nano-version;" + @echo " • push the branch and tags upstream; and" + @echo " • send release-mail to <telepathy@freedesktop.org>." + ## vim:set ft=automake: |