From a8f6a685ae25bcf9e588b1904c56edb266b1a0d4 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sun, 6 Dec 2020 16:08:25 -0600 Subject: [PATCH] Create release script. --- Clocker/release.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Clocker/release.py diff --git a/Clocker/release.py b/Clocker/release.py new file mode 100644 index 0000000..12cc427 --- /dev/null +++ b/Clocker/release.py @@ -0,0 +1,36 @@ +import sys +import os + +# Increment the version + build number +# Change scheme to Release +# Build and Analyze +# Notarize the version +# Zip and upload it as a Github release +# Update appcast.xml + +def handle_command_execution(command, return_value): + if return_value != 0: + print(command + " failed with return value of "+str(return_value)) + + +def increment_build_number(): + # Print the build number. Use the -terse to limit the output to just the buld number + check_version_command = "agvtool what-version" + handle_command_execution(check_version_command, os.system(check_version_command)) + + # Bump the build number + bump_version_command = "agvtool next-version -increment-minor-version" + handle_command_execution(bump_version_command, os.system(bump_version_command)) + +def increment_version_to(new_version): + check_version_command = "agvtool new-marketing-version "+new_version + handle_command_execution(check_version_command, os.system(check_version_command)) + +def main(): + if len(sys.argv) < 2: + print("Doh! Enter the new release version") + return + increment_version_to(sys.argv[1]) + increment_build_number() + +main() \ No newline at end of file