]> khamidou — GitHub mirrors - electron.git/commitdiff
Upload SHASUMS.txt when publishing release
authorCheng Zhao <zcbenz@gmail.com>
Sat, 11 Apr 2015 16:01:10 +0000 (00:01 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 11 Apr 2015 16:01:10 +0000 (00:01 +0800)
script/upload-node-headers.py
script/upload.py

index ce3277007322eb59d977159f01029622b8949f08..a2b9894382d0408a9d9744cc3efcfba8e06367ab 100755 (executable)
@@ -47,11 +47,6 @@ def main():
   bucket, access_key, secret_key = s3_config()
   upload_node(bucket, access_key, secret_key, args.version)
 
-  # Upload the SHASUMS.txt.
-  execute([sys.executable,
-           os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
-           '-v', args.version])
-
 
 def parse_args():
   parser = argparse.ArgumentParser(description='upload sumsha file')
@@ -110,8 +105,7 @@ def upload_node(bucket, access_key, secret_key, version):
           'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
 
   if PLATFORM == 'win32':
-    target_arch = get_target_arch()
-    if target_arch == 'ia32':
+    if get_target_arch() == 'ia32':
       node_lib = os.path.join(DIST_DIR, 'node.lib')
     else:
       node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
@@ -125,7 +119,7 @@ def upload_node(bucket, access_key, secret_key, version):
     s3put(bucket, access_key, secret_key, DIST_DIR,
           'atom-shell/dist/{0}'.format(version), [node_lib])
 
-    # Upload the index.json
+    # Upload the index.json.
     with scoped_cwd(SOURCE_ROOT):
       atom_shell = os.path.join(OUT_DIR, 'atom.exe')
       index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
index 4b9c0d4b6084384295650dea2b2d7d68d0839786..692d506be2fedcc5669f8d1b8904db36a3371370 100755 (executable)
@@ -46,9 +46,22 @@ def main():
     sys.stderr.flush()
     return 1
 
-  # Upload atom-shell with GitHub Releases API.
   github = GitHub(auth_token())
   release_id = create_or_get_release_draft(github, args.version)
+
+  if args.publish_release:
+    # Upload the SHASUMS.txt.
+    execute([sys.executable,
+             os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
+             '-v', ATOM_SHELL_VERSION])
+
+    # Press the publish button.
+    publish_release(github, release_id)
+
+    # Do not upload other files when passed "-p".
+    return
+
+  # Upload atom-shell with GitHub Releases API.
   upload_atom_shell(github, release_id, os.path.join(DIST_DIR, DIST_NAME))
   upload_atom_shell(github, release_id, os.path.join(DIST_DIR, SYMBOLS_NAME))
 
@@ -67,10 +80,6 @@ def main():
              os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
              '-v', ATOM_SHELL_VERSION])
 
-  if args.publish_release:
-    # Press the publish button.
-    publish_release(github, release_id)
-
 
 def parse_args():
   parser = argparse.ArgumentParser(description='upload distribution file')