summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-09-29 15:10:18 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2010-10-01 17:26:16 +0100
commit8bf825940c834b44e7c7ceb17b26b30e5ff96aba (patch)
tree25211f42627727f83ae747f4282f47264c43cf42 /tools
parente57ff90723280f82018fa649c5bc03a43d7d43bb (diff)
Automate release process
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.am1
-rw-r--r--tools/make-release-mail.py76
-rw-r--r--tools/telepathy.am34
3 files changed, 107 insertions, 4 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 71bede79e..3cfcfe923 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -12,6 +12,7 @@ EXTRA_DIST = \
lcov.am \
libglibcodegen.py \
libtpcodegen.py \
+ make-release-mail.py \
telepathy.am \
xincludator.py
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 93b73d2d2..1ed13078f 100644
--- a/tools/telepathy.am
+++ b/tools/telepathy.am
@@ -18,15 +18,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
@@ -35,4 +55,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: