Try to re-work release building script a little.
[dcpomatic.git] / release
1 #!/usr/bin/python
2
3 import os
4 import sys
5 import datetime
6 import shutil
7 import version
8
9 def command(c):
10     os.system(c)
11     print c
12
13 command("git checkout master")
14     
15 release_version_string = version.rewrite_wscript(version.Version.to_release)
16 version.append_to_changelog(release_version_string)
17
18 command("git diff")
19 if (raw_input() != "y"):
20     command("git reset --hard")
21     print 'Aborted'
22     sys.exit(1)
23
24 command("git commit -a -m \"Bump version\"")
25 command("git tag -m \"v%s\" v%s" % (release_version_string, release_version_string))
26 command("./waf clean")
27 command("./waf")
28 command("./waf configure")
29 command("./waf dist")
30 command("./builds/windows-32")
31 shutil.copy(os.path.join('build', 'windows', 'DVD-o-matic %s 32-bit Installer.exe' % release_version_string), '.')
32 command("./builds/windows-64")
33 shutil.copy(os.path.join('build', 'windows', 'DVD-o-matic %s 64-bit Installer.exe' % release_version_string), '.')
34
35 version.rewrite_wscript(version.Version.bump_and_to_pre)
36
37 command("git diff")
38 if (raw_input() != "y"):
39     command("git reset --hard")
40     print 'Aborted'
41     sys.exit(1)
42
43 command("git commit -a -m \"Bump version\"")
44 command("cp DVD-o-matic*.exe dvdomatic-*.tar.bz2 /home/carl/public_html/carlh.net/software/dvdomatic")