def upload_sha256_checksum(version, file_path, key_prefix=None): checksum_path = '{}.sha256sum'.format(file_path) if key_prefix is None: key_prefix = 'checksums-scratchpad/{0}'.format(version) sha256 = hashlib.sha256() with open(file_path, 'rb') as f: sha256.update(f.read()) filename = os.path.basename(file_path) with open(checksum_path, 'w') as checksum: checksum.write('{} *{}'.format(sha256.hexdigest(), filename)) store_artifact(os.path.dirname(checksum_path), key_prefix, [checksum_path])
def main(): if not authToken or authToken == "": raise Exception("Please set META_DUMPER_AUTH_HEADER") # Upload the index.json. with scoped_cwd(ELECTRON_DIR): safe_mkdir(OUT_DIR) index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json')) new_content = get_content() with open(index_json, "w") as f: f.write(new_content) store_artifact(OUT_DIR, 'atom-shell/dist', [index_json])
def upload_node(version): with scoped_cwd(GEN_DIR): generated_tar = os.path.join(GEN_DIR, 'node_headers.tar.gz') for header_tar in HEADER_TAR_NAMES: versioned_header_tar = header_tar.format(version) shutil.copy2(generated_tar, os.path.join(GEN_DIR, versioned_header_tar)) store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version), glob.glob('node-*.tar.gz')) store_artifact(GEN_DIR, 'headers/dist/{0}'.format(version), glob.glob('iojs-*.tar.gz')) if PLATFORM == 'win32': if get_target_arch() == 'ia32': node_lib = os.path.join(DIST_DIR, 'node.lib') iojs_lib = os.path.join(DIST_DIR, 'win-x86', 'iojs.lib') v4_node_lib = os.path.join(DIST_DIR, 'win-x86', 'node.lib') elif get_target_arch() == 'arm64': node_lib = os.path.join(DIST_DIR, 'arm64', 'node.lib') iojs_lib = os.path.join(DIST_DIR, 'win-arm64', 'iojs.lib') v4_node_lib = os.path.join(DIST_DIR, 'win-arm64', 'node.lib') else: node_lib = os.path.join(DIST_DIR, 'x64', 'node.lib') iojs_lib = os.path.join(DIST_DIR, 'win-x64', 'iojs.lib') v4_node_lib = os.path.join(DIST_DIR, 'win-x64', 'node.lib') safe_mkdir(os.path.dirname(node_lib)) safe_mkdir(os.path.dirname(iojs_lib)) # Copy electron.lib to node.lib and iojs.lib. electron_lib = os.path.join(OUT_DIR, 'electron.lib') shutil.copy2(electron_lib, node_lib) shutil.copy2(electron_lib, iojs_lib) shutil.copy2(electron_lib, v4_node_lib) # Upload the node.lib. store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [node_lib]) # Upload the iojs.lib. store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [iojs_lib]) # Upload the v4 node.lib. store_artifact(DIST_DIR, 'headers/dist/{0}'.format(version), [v4_node_lib])
def main(): args = parse_args() dist_url = args.dist_url if dist_url[-1] != "/": dist_url += "/" url = dist_url + args.version + '/' directory, files = download_files(url, get_files_list(args.version)) checksums = [ create_checksum('sha1', directory, 'SHASUMS.txt', files), create_checksum('sha256', directory, 'SHASUMS256.txt', files) ] if args.target_dir is None: store_artifact(directory, 'atom-shell/dist/{0}'.format(args.version), checksums) else: copy_files(checksums, args.target_dir) rm_rf(directory)
def upload_electron(release, file_path, args): filename = os.path.basename(file_path) # Strip zip non determinism before upload, in-place operation try: zero_zip_date_time(file_path) except NonZipFileError: pass # if upload_to_s3 is set, skip github upload. if args.upload_to_s3: key_prefix = 'electron-artifacts/{0}_{1}'.format( args.version, args.upload_timestamp) store_artifact(os.path.dirname(file_path), key_prefix, [file_path]) upload_sha256_checksum(args.version, file_path, key_prefix) return # Upload the file. upload_io_to_github(release, filename, file_path, args.version) # Upload the checksum file. upload_sha256_checksum(args.version, file_path)
def upload_symbols(files): store_artifact(SYMBOLS_DIR, 'atom-shell/symbols', files)
def upload_symbols(files): store_artifact(SYMBOLS_DIR, 'symbols', files)