From 68a3fd6f05d2f60b3c386bab37dbb87dbe43b24b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Sep 2013 22:02:09 +0800 Subject: [PATCH] Publish the release after the uploading is end. --- script/upload.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/script/upload.py b/script/upload.py index 38fcaaa..f8a366d 100755 --- a/script/upload.py +++ b/script/upload.py @@ -41,6 +41,8 @@ def main(): github = GitHub(auth_token()) release_id = create_or_get_release_draft(github, args.version) upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME)) + if not args.no_publish_release: + publish_release(github, release_id) # Upload node's headers to S3. bucket, access_key, secret_key = s3_config() @@ -51,8 +53,8 @@ def parse_args(): parser = argparse.ArgumentParser(description='upload distribution file') parser.add_argument('-v', '--version', help='Specify the version', default=ATOM_SHELL_VRESION) - parser.add_argument('-n', '--no-update-version', - help='Do not update the latest version file', + parser.add_argument('-n', '--no-publish-release', + help='Do not publish the release', action='store_true') return parser.parse_args() @@ -104,6 +106,11 @@ def upload_atom_shell(github, release_id, file_path): params=params, headers=headers, files=files, verify=False) +def publish_release(github, release_id): + data = dict(draft=False) + github.repos(ATOM_SHELL_REPO).releases(release_id).patch(data=data) + + def upload_node(bucket, access_key, secret_key, version): os.chdir(DIST_DIR) @@ -158,7 +165,7 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files): '--grant', 'public-read' ] + files - subprocess.check_call(args) + subprocess.check_output(args) def touch_x64_node_lib(): -- 2.7.4