Skip to content

Commit eabc0aa

Browse files
committed
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
1 parent 374a920 commit eabc0aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

github_release.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,21 +286,20 @@ def main():
286286
else:
287287
client = Github(args.api_key)
288288
repo = client.get_repo(CLOUDFLARED_REPO)
289-
release = get_or_create_release(repo, args.release_version, args.dry_run)
290289

291290
if os.path.isdir(args.path):
292291
onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))]
293292
for filename in onlyfiles:
294293
binary_path = os.path.join(args.path, filename)
295294
assert_asset_version(binary_path, args.release_version)
295+
release = get_or_create_release(repo, args.release_version, args.dry_run)
296296
for filename in onlyfiles:
297297
binary_path = os.path.join(args.path, filename)
298298
upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id,
299299
args.kv_api_token)
300300
move_asset(binary_path, filename)
301301
else:
302-
upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id,
303-
args.kv_api_token)
302+
raise Exception("the argument path must be a directory")
304303

305304
except Exception as e:
306305
logging.exception(e)

0 commit comments

Comments
 (0)