-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathrelease.py
47 lines (36 loc) · 1.55 KB
/
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
40
41
42
43
44
45
46
47
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 clean_build_analyze_release_config():
build_command = "xcodebuild -scheme Clocker -project Clocker.xcodeproj/ -configuration Release clean build analyze -quiet"
handle_command_execution(build_command, os.system(build_command))
def test_release_config():
build_command = "xcodebuild -scheme Clocker -project Clocker.xcodeproj/ test"
handle_command_execution(build_command, os.system(build_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()
clean_build_analyze_release_config()
test_release_config()
main()