Upload the asset after release note is created.
This commit is contained in:
parent
3586565bba
commit
db359ae75c
1 changed files with 10 additions and 1 deletions
|
@ -38,7 +38,8 @@ def main():
|
||||||
subprocess.check_call([sys.executable, create_dist])
|
subprocess.check_call([sys.executable, create_dist])
|
||||||
|
|
||||||
github = GitHub(auth_token())
|
github = GitHub(auth_token())
|
||||||
print create_or_get_release_draft(github, args.version)
|
release_id = create_or_get_release_draft(github, args.version)
|
||||||
|
upload_asset(github, release_id, os.path.join(DIST_DIR, DIST_NAME))
|
||||||
# upload(auth_token)
|
# upload(auth_token)
|
||||||
# if not args.no_update_version:
|
# if not args.no_update_version:
|
||||||
# update_version(auth_token)
|
# update_version(auth_token)
|
||||||
|
@ -93,6 +94,14 @@ def create_release_draft(github, tag):
|
||||||
return r['id']
|
return r['id']
|
||||||
|
|
||||||
|
|
||||||
|
def upload_asset(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)
|
||||||
|
|
||||||
|
|
||||||
def upload(auth_token, version=ATOM_SHELL_VRESION):
|
def upload(auth_token, version=ATOM_SHELL_VRESION):
|
||||||
os.chdir(DIST_DIR)
|
os.chdir(DIST_DIR)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue