mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 20:29:57 +00:00
TUN-7392: Ignore duplicate artifact uploads for github release
This commit is contained in:
@@ -166,6 +166,15 @@ def parse_args():
|
||||
|
||||
def upload_asset(release, filepath, filename, release_version, kv_account_id, namespace_id, kv_api_token):
|
||||
logging.info("Uploading asset: %s", filename)
|
||||
assets = release.get_assets()
|
||||
uploaded = False
|
||||
for asset in assets:
|
||||
if asset.name == filename:
|
||||
logging.info("asset already uploaded, skipping upload")
|
||||
uploaded = True
|
||||
break
|
||||
|
||||
if not uploaded:
|
||||
release.upload_asset(filepath, name=filename)
|
||||
|
||||
# check and extract if the file is a tar and gzipped file (as is the case with the macos builds)
|
||||
@@ -182,6 +191,7 @@ def upload_asset(release, filepath, filename, release_version, kv_account_id, na
|
||||
binary_path = os.path.join(os.getcwd(), 'cfd', 'cloudflared')
|
||||
|
||||
# send the sha256 (the checksum) to workers kv
|
||||
logging.info("Uploading sha256 checksum for: %s", filename)
|
||||
pkg_hash = get_sha256(binary_path)
|
||||
send_hash(pkg_hash, filename, release_version, kv_account_id, namespace_id, kv_api_token)
|
||||
|
||||
|
Reference in New Issue
Block a user