mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
still flailing - try a random name
This commit is contained in:
parent
478ca98b0e
commit
318160b328
3 changed files with 9 additions and 3 deletions
|
@ -41,6 +41,7 @@ build_script:
|
||||||
- python zip_daemon.py
|
- python zip_daemon.py
|
||||||
- dir dist
|
- dir dist
|
||||||
- pip install PyGithub uritemplate
|
- pip install PyGithub uritemplate
|
||||||
|
- pip install -U requests[security]
|
||||||
- python release_on_tag.py
|
- python release_on_tag.py
|
||||||
|
|
||||||
test: off
|
test: off
|
||||||
|
|
1
build.sh
1
build.sh
|
@ -84,6 +84,7 @@ if [ "$FULL_BUILD" == "true" ]; then
|
||||||
# it to reliably work and it also seemed difficult to configure. Not proud of
|
# it to reliably work and it also seemed difficult to configure. Not proud of
|
||||||
# this, but it seemed better to write my own.
|
# this, but it seemed better to write my own.
|
||||||
pip install PyGithub uritemplate
|
pip install PyGithub uritemplate
|
||||||
|
pip install -U requests[security]
|
||||||
python release_on_tag.py
|
python release_on_tag.py
|
||||||
deactivate
|
deactivate
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,6 +4,7 @@ import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
import random
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -89,15 +90,18 @@ def upload_asset(release, asset_to_upload, token):
|
||||||
while count < 10:
|
while count < 10:
|
||||||
uploader = uploaders[count % len(uploaders)]
|
uploader = uploaders[count % len(uploaders)]
|
||||||
try:
|
try:
|
||||||
return _upload_asset_requests(release, asset_to_upload, token, uploader)
|
return _upload_asset(release, asset_to_upload, token, uploader)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception('Failed to upload')
|
log.exception('Failed to upload')
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
|
||||||
def _upload_asset_requests(release, asset_to_upload, token, uploader):
|
def _upload_asset(release, asset_to_upload, token, uploader):
|
||||||
basename = os.path.basename(asset_to_upload)
|
basename = os.path.basename(asset_to_upload)
|
||||||
upload_uri = uritemplate.expand(release.upload_url, {'name': basename})
|
upload_uri = uritemplate.expand(
|
||||||
|
release.upload_url,
|
||||||
|
{'name': ''.join([random.choice('abcdef') for _ in range(10)])}
|
||||||
|
)
|
||||||
output = uploader(upload_uri, asset_to_upload, token)
|
output = uploader(upload_uri, asset_to_upload, token)
|
||||||
if 'errors' in output:
|
if 'errors' in output:
|
||||||
raise Exception(output)
|
raise Exception(output)
|
||||||
|
|
Loading…
Add table
Reference in a new issue