Uploads the archive at the given path to GitHub for the release specified
(token, upload_url, archive_path)
| 78 | return 'beta' in tag or 'RC' in tag or 'prerelease' in tag or 'alpha' in tag |
| 79 | |
| 80 | def upload_carthage_archive(token, upload_url, archive_path): |
| 81 | ''' |
| 82 | Uploads the archive at the given path to GitHub for the release specified |
| 83 | ''' |
| 84 | |
| 85 | upload_url = upload_url.split('{')[0] |
| 86 | url = '{}?name={}'.format(upload_url, archive_path) |
| 87 | header = { |
| 88 | 'Authorization': 'token {}'.format(token), |
| 89 | 'Content-Type': 'application/zip' |
| 90 | } |
| 91 | |
| 92 | with FileWithLen(archive_path, 'r') as f: |
| 93 | request = urllib2.Request(url, f, header) |
| 94 | response = urllib2.urlopen(request) |
| 95 | |
| 96 | page = response.read() |
| 97 | response_dict = json.loads(page) |
| 98 | return True |
| 99 | |
| 100 | class FileWithLen(file): |
| 101 | def __init__(self, *args, **keyws): |
no test coverage detected