diff --git a/github_release.py b/github_release.py index e59a0cbf..10657e48 100755 --- a/github_release.py +++ b/github_release.py @@ -166,7 +166,16 @@ 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) - release.upload_asset(filepath, name=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) binary_path = filepath @@ -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)