Browse Source

win: Upload node.lib of x64 build

Cheng Zhao 10 years ago
parent
commit
c30d806837
2 changed files with 19 additions and 26 deletions
  1. 10 17
      script/upload-node-headers.py
  2. 9 9
      script/upload.py

+ 10 - 17
script/upload-node-headers.py

@@ -7,7 +7,7 @@ import shutil
 import sys
 import tarfile
 
-from lib.config import PLATFORM
+from lib.config import PLATFORM, get_target_arch
 from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put
 
 
@@ -110,19 +110,19 @@ 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':
+      node_lib = os.path.join(DIST_DIR, 'node.lib')
+    else:
+      node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib')
+      safe_mkdir(os.path.dirname(node_lib))
+
     # Copy atom.lib to node.lib
-    node_lib = os.path.join(OUT_DIR, 'node.lib')
     atom_lib = os.path.join(OUT_DIR, 'node.dll.lib')
     shutil.copy2(atom_lib, node_lib)
 
-    # Upload the 32bit node.lib.
-    s3put(bucket, access_key, secret_key, OUT_DIR,
-          'atom-shell/dist/{0}'.format(version), [node_lib])
-
-    # Upload the fake 64bit node.lib.
-    touch_x64_node_lib()
-    node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
-    s3put(bucket, access_key, secret_key, OUT_DIR,
+    # Upload the node.lib.
+    s3put(bucket, access_key, secret_key, DIST_DIR,
           'atom-shell/dist/{0}'.format(version), [node_lib])
 
     # Upload the index.json
@@ -136,12 +136,5 @@ def upload_node(bucket, access_key, secret_key, version):
             [index_json])
 
 
-def touch_x64_node_lib():
-  x64_dir = os.path.join(OUT_DIR, 'x64')
-  safe_mkdir(x64_dir)
-  with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib:
-    node_lib.write('Invalid library')
-
-
 if __name__ == '__main__':
   sys.exit(main())

+ 9 - 9
script/upload.py

@@ -57,17 +57,17 @@ def main():
     upload_atom_shell(github, release_id,
                       os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
 
-  if args.publish_release:
-    if PLATFORM == 'win32':
-      # Upload PDBs to Windows symbol server.
-      execute([sys.executable,
-               os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
+  if PLATFORM == 'win32':
+    # Upload PDBs to Windows symbol server.
+    execute([sys.executable,
+             os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
 
-      # Upload node headers.
-      execute([sys.executable,
-               os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
-               '-v', ATOM_SHELL_VERSION])
+    # Upload node headers.
+    execute([sys.executable,
+             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)