TUN-7392: Ignore duplicate artifact uploads for github release
This commit is contained in:
parent
c7f343a3b4
commit
aec1d8f653
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue