From 736f8dcd7cd17fad71276cd7c72f24ee43392e38 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Mon, 14 Oct 2024 15:55:10 +0200 Subject: [PATCH] Tweak the updater --- scripts/update-appimages.py | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/scripts/update-appimages.py b/scripts/update-appimages.py index 51b03e7..4dec158 100755 --- a/scripts/update-appimages.py +++ b/scripts/update-appimages.py @@ -233,20 +233,30 @@ def update(args): for meta in new_assets: release = releases[meta.release_tag()].release appimage = meta.appimage_name() - new_asset = release.upload_asset( - path = f'{APPIMAGES_DIR}/{appimage}', - name = appimage - ) - if meta.asset: + if meta.asset and (meta.asset.name == appimage): meta.asset.delete_asset() update_summary.append( - f'- update {meta.formated_tag()}/{meta.abi} ' - f'{meta.previous_version()} -> {meta.version}' + f'- update {meta.formated_tag()}/{meta.abi} {meta.version}' + ) + new_asset = release.upload_asset( + path = f'{APPIMAGES_DIR}/{appimage}', + name = appimage ) else: - update_summary.append( - f'- add {meta.formated_tag()}/{meta.abi} {meta.version}' + new_asset = release.upload_asset( + path = f'{APPIMAGES_DIR}/{appimage}', + name = appimage ) + if meta.asset: + meta.asset.delete_asset() + update_summary.append( + f'- update {meta.formated_tag()}/{meta.abi} ' + f'{meta.previous_version()} -> {meta.version}' + ) + else: + update_summary.append( + f'- add {meta.formated_tag()}/{meta.abi} {meta.version}' + ) meta.asset = new_asset assets[meta.tag][meta.abi] = meta @@ -300,6 +310,10 @@ def update(args): action = 'store_true', default = False ) + parser.add_argument('-m', '--manylinux', + help = 'target specific manylinux tags', + nargs = "+" + ) parser.add_argument("-s", "--sha", help = "reference commit SHA" ) @@ -308,5 +322,9 @@ def update(args): ) args = parser.parse_args() + + if args.manylinux: + MANYLINUSES = args.manylinux + sys.argv = sys.argv[:1] # Empty args for fake call update(args)