headers['Authorization'] = self._authorization
headers['Accept'] = 'application/vnd.github.manifold-preview'
- # Data are sent in JSON format.
- if 'data' in kw:
- kw['data'] = json.dumps(kw['data'])
-
# Switch to a different domain for the releases uploading API.
if self._releases_upload_api_pattern.match(path):
url = '%s%s' % (GITHUB_UPLOAD_ASSET_URL, path)
else:
url = '%s%s' % (GITHUB_URL, path)
+ # Data are sent in JSON format.
+ if 'data' in kw:
+ kw['data'] = json.dumps(kw['data'])
r = getattr(requests, method)(url, **kw).json()
if 'message' in r:
def upload_atom_shell(github, release_id, file_path):
params = {'name': os.path.basename(file_path)}
headers = {'Content-Type': 'application/zip'}
- files = {'file': open(file_path, 'rb')}
- github.repos(ATOM_SHELL_REPO).releases(release_id).assets.post(
- params=params, headers=headers, files=files, verify=False)
+ with open(file_path, 'rb') as f:
+ data = f.read()
+ github.repos(ATOM_SHELL_REPO).releases(release_id).assets.post(
+ params=params, headers=headers, data=data, verify=False)
def publish_release(github, release_id):
def upload_node(bucket, access_key, secret_key, version):
os.chdir(DIST_DIR)
- # TODO(zcbenz): Remove me when Atom starts to use Releases API.
- s3put(bucket, access_key, secret_key, DIST_DIR,
- 'atom-shell/{0}'.format(ATOM_SHELL_VRESION), [DIST_NAME])
-
s3put(bucket, access_key, secret_key, DIST_DIR,
'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))