From 599456378bb8af3da4d48e9d4a73c35fb2194adf Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 18 Apr 2018 17:07:41 -0700 Subject: [PATCH] Added logging for asset removal Signed-off-by: Joffrey F --- script/release/release.py | 4 ++-- script/release/release/repository.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/script/release/release.py b/script/release/release.py index aa6c6198b..b72fb2546 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -13,6 +13,7 @@ from release.const import BINTRAY_ORG from release.const import NAME from release.const import REPO_ROOT from release.downloader import BinaryDownloader +from release.repository import delete_assets from release.repository import get_contributors from release.repository import Repository from release.repository import upload_assets @@ -130,8 +131,7 @@ def resume(args): ) if proceed.lower() != 'y': raise ScriptError('Aborting release') - for asset in gh_release.get_assets(): - asset.delete_asset() + delete_assets(gh_release) upload_assets(gh_release, files) except ScriptError as e: print(e) diff --git a/script/release/release/repository.py b/script/release/release/repository.py index c84c9e1b5..d7034f8bd 100644 --- a/script/release/release/repository.py +++ b/script/release/release/repository.py @@ -178,3 +178,10 @@ def upload_assets(gh_release, files): gh_release.upload_asset( os.path.join(REPO_ROOT, 'script', 'run', 'run.sh'), content_type='text/plain' ) + + +def delete_assets(gh_release): + print('Removing previously uploaded assets') + for asset in gh_release.get_assets(): + print('Deleting asset {}'.format(asset.name)) + asset.delete_asset()