-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.py
executable file
·39 lines (24 loc) · 979 Bytes
/
release.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
import subprocess
import shlex
import argparse
def runcommand(command, **kwargs):
print("Running: " + command)
subprocess.run(shlex.split(command), **kwargs)
def update(part):
try:
runcommand("bumpversion {} --no-commit --no-tag".format(part), check=True)
except:
return
runcommand("autoreconf -fiv")
runcommand("git add Makefile.in config.h.in~ configure aclocal.m4 ltmain.sh src/Makefile.in src/ioncheck/Makefile.in tests/Makefile.in")
runcommand("git checkout configure.ac .bumpversion.cfg")
runcommand("git commit -m \"Automatically autoreconf'ed\"")
runcommand("bumpversion {}".format(part))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Manage bumpversion/autotools interface")
parser.add_argument('part', nargs=1, choices=['major', 'minor', 'patch'])
args = parser.parse_args()
part = args.part[0]
print(part)
update(part)