Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
electron
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ExcellentOSS
electron
Commits
0ad1fc84
Commit
0ad1fc84
authored
11 years ago
by
Cheng Zhao
Browse files
Options
Downloads
Patches
Plain Diff
Do not multipart-encode the uploaded file.
parent
7f0e7f38
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/lib/github.py
+3
-4
3 additions, 4 deletions
script/lib/github.py
script/upload.py
+4
-7
4 additions, 7 deletions
script/upload.py
with
7 additions
and
11 deletions
script/lib/github.py
+
3
−
4
View file @
0ad1fc84
...
...
@@ -24,15 +24,14 @@ class GitHub:
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
:
...
...
This diff is collapsed.
Click to expand it.
script/upload.py
+
4
−
7
View file @
0ad1fc84
...
...
@@ -134,9 +134,10 @@ def create_release_draft(github, tag):
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
):
...
...
@@ -147,10 +148,6 @@ 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
'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment