Skip to content

Commit

Permalink
Tweak the updater
Browse files Browse the repository at this point in the history
  • Loading branch information
niess committed Oct 14, 2024
1 parent da067b4 commit 736f8dc
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions scripts/update-appimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
)
Expand All @@ -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)

0 comments on commit 736f8dc

Please sign in to comment.