diff options
author | Colin Walters <walters@verbum.org> | 2011-03-10 14:47:30 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2011-03-10 14:47:30 -0500 |
commit | 734a6041a8c7671324ba21f943e712e57bf992b0 (patch) | |
tree | 469565a43070584813829dd1e4291c1571d634fc | |
parent | 0e6d7b781a00bba859d428eb46b0bcb0f3d29539 (diff) | |
download | gobject-introspection-734a6041a8c7671324ba21f943e712e57bf992b0.tar.gz |
Makefile: Rework release tools
Separate "preparing" a release locally from actually uploading it,
and automate bumping the version in configure.ac.
-rw-r--r-- | Makefile.am | 13 | ||||
-rw-r--r-- | tools/verbump.py | 46 |
2 files changed, 55 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index de8bab33..940fc1a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -55,14 +55,19 @@ EXTRA_DIST += \ misc/pre-commit \ misc/pyflakes.py -release-tag: +prepare-release-tag: @TAG=`echo $(VERSION)|sed s/\\\./_/g`;\ - echo "* Tagging $(VERSION)"; \ + echo "git tag GOBJECT_INTROSPECTION_$$TAG"; \ git tag -m "Tag $$VERSION" -a \ - GOBJECT_INTROSPECTION_$$TAG && \ - git push --tags ssh://git.gnome.org/git/gobject-introspection + GOBJECT_INTROSPECTION_$$TAG + +prepare-minor-release: $(distdir).tar.bz2 prepare-release-tag + python $(top_srcdir)/tools/verbump.py upload-release: $(distdir).tar.bz2 + git log origin/master..master + @echo -n "Ok to push? [y/N] "; read ans; test x$$ans == xy || exit 1 + git push --tags origin master:master scp $(distdir).tar.bz2 gnome.org: ssh gnome.org install-module $(distdir).tar.bz2 diff --git a/tools/verbump.py b/tools/verbump.py new file mode 100644 index 00000000..4e383729 --- /dev/null +++ b/tools/verbump.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# Automakes a release preparation for a post-release project +# * Create a git tag +# * Bump version in configure.ac and commit it + +import re +import os +import sys +import subprocess + +micro_version_re = re.compile('m4_define.*gi_micro_version, ([0-9]+)') +micro_version_replace = 'm4_define(gi_micro_version, %d)\n' + +def _extract_config_log_variable(name): + f = open('config.log') + keystart = name + '=\'' + for line in f: + if line.startswith(keystart): + return line[len(keystart):-2] + f.close() + fatal("Failed to find '%s' in config.status" % (name, )) + +if not os.path.isfile('config.log'): + fatal("Couldn't find config.log; did you run configure?") +package = _extract_config_log_variable('PACKAGE_TARNAME') +version = _extract_config_log_variable('VERSION') + +f = open('configure.ac'); +newf = open('configure.ac.new', 'w') +for line in f: + m = micro_version_re.match(line) + if not m: + newf.write(line) + continue + v = int(m.group(1)) + newv = v+1 + print "Will update micro version from %s to %s" % (v, newv) + newf.write(micro_version_replace % (newv, )) +newf.close() + +os.rename('configure.ac.new', 'configure.ac') +print "Successfully wrote new 'configure.ac' with post-release version bump" + +args=['git', 'commit', '-m', "configure: Post-release version bump", 'configure.ac'] +print "Running: %r" % (args, ) +subprocess.check_call(args) |