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
This commit is contained in:
parent
374a920b61
commit
eabc0aaaa8
|
@ -286,21 +286,20 @@ def main():
|
||||||
else:
|
else:
|
||||||
client = Github(args.api_key)
|
client = Github(args.api_key)
|
||||||
repo = client.get_repo(CLOUDFLARED_REPO)
|
repo = client.get_repo(CLOUDFLARED_REPO)
|
||||||
release = get_or_create_release(repo, args.release_version, args.dry_run)
|
|
||||||
|
|
||||||
if os.path.isdir(args.path):
|
if os.path.isdir(args.path):
|
||||||
onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))]
|
onlyfiles = [f for f in listdir(args.path) if isfile(join(args.path, f))]
|
||||||
for filename in onlyfiles:
|
for filename in onlyfiles:
|
||||||
binary_path = os.path.join(args.path, filename)
|
binary_path = os.path.join(args.path, filename)
|
||||||
assert_asset_version(binary_path, args.release_version)
|
assert_asset_version(binary_path, args.release_version)
|
||||||
|
release = get_or_create_release(repo, args.release_version, args.dry_run)
|
||||||
for filename in onlyfiles:
|
for filename in onlyfiles:
|
||||||
binary_path = os.path.join(args.path, filename)
|
binary_path = os.path.join(args.path, filename)
|
||||||
upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id,
|
upload_asset(release, binary_path, filename, args.release_version, args.kv_account_id, args.namespace_id,
|
||||||
args.kv_api_token)
|
args.kv_api_token)
|
||||||
move_asset(binary_path, filename)
|
move_asset(binary_path, filename)
|
||||||
else:
|
else:
|
||||||
upload_asset(release, args.path, args.name, args.release_version, args.kv_account_id, args.namespace_id,
|
raise Exception("the argument path must be a directory")
|
||||||
args.kv_api_token)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
|
|
Loading…
Reference in New Issue