common: Raise exception on duplicate asset upload to github

This commit is contained in:
Povilas Kanapickas
2020-03-11 19:37:00 +02:00
parent 3160906342
commit 14cc21cfd3

View File

@@ -36,6 +36,10 @@ def main():
assets = assets.json()
os.makedirs('dist', exist_ok=True)
for url in (a['browser_download_url'] for a in assets):
if 'gitarchive' in url:
raise Exception('The git archive has already been uploaded. Are you trying to fix '
'broken upload? If this is the case, delete the asset in the GitHub '
'UI and retry this command')
if url.endswith(".whl") or url.endswith(".tar.gz"):
fn = os.path.join('dist', url.split('/')[-1])
download(s, url, fn)