From eabc0aaaa8039cb117bbd2c34a69268f7f5ba153 Mon Sep 17 00:00:00 2001 From: Luis Neto Date: Thu, 24 Oct 2024 09:43:02 -0700 Subject: [PATCH] TUN-8694: Rework release script ## Summary This modifies the release script to only create the github release after verifying the assets version Closes TUN-8694 --- github_release.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/github_release.py b/github_release.py index 2453d988..4620a139 100755 --- a/github_release.py +++ b/github_release.py @@ -286,21 +286,20 @@ def main(): else: client = Github(args.api_key) repo = client.get_repo(CLOUDFLARED_REPO) - release = get_or_create_release(repo, args.release_version, args.dry_run) if os.path.isdir(args.path): onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))] for filename in onlyfiles: binary_path = os.path.join(args.path, filename) assert_asset_version(binary_path, args.release_version) + release = get_or_create_release(repo, args.release_version, args.dry_run) for filename in onlyfiles: binary_path = os.path.join(args.path, filename) upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id, args.kv_api_token) move_asset(binary_path, filename) else: - upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id, - args.kv_api_token) + raise Exception("the argument path must be a directory") except Exception as e: logging.exception(e)