From aba061bf002f2b1d3be0a0e544e99da9f17b58c5 Mon Sep 17 00:00:00 2001 From: Zihe Jia <36679208+zihejia@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:28:12 -0800 Subject: [PATCH] remove release.py (#165) --- release.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 release.py diff --git a/release.py b/release.py deleted file mode 100644 index ca71d38..0000000 --- a/release.py +++ /dev/null @@ -1,40 +0,0 @@ - -import argparse -import subprocess - - -parser = argparse.ArgumentParser(description='Release Mixpanel Unity SDK') -parser.add_argument('--old', help='version for the release', action="store") -parser.add_argument('--new', help='version for the release', action="store") -args = parser.parse_args() - -def bump_version(): - replace_version('package.json', args.old, args.new) - replace_version('./Mixpanel/MixpanelAPI.cs', args.old, args.new) - subprocess.call('git add package.json', shell=True) - subprocess.call('git add ./Mixpanel/MixpanelAPI.cs', shell=True) - subprocess.call('git commit -m "Version {}"'.format(args.new), shell=True) - subprocess.call('git push', shell=True) - -def replace_version(file_name, old_version, new_version): - with open(file_name) as f: - file_str = f.read() - assert(old_version in file_str) - file_str = file_str.replace(old_version, new_version) - - with open(file_name, "w") as f: - f.write(file_str) - - -def add_tag(): - subprocess.call('git tag -a v{} -m "version {}"'.format(args.new, args.new), shell=True) - subprocess.call('git push origin --tags', shell=True) - - -def main(): - bump_version() - add_tag() - print("Congratulations, done!") - -if __name__ == '__main__': - main()