Example #1
0
def main():
  args = parse_args()

  if not args.publish_release:
    if not dist_newer_than_head():
      create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py')
      execute([sys.executable, create_dist])

    build_version = get_atom_shell_build_version()
    if not ATOM_SHELL_VERSION.startswith(build_version):
      error = 'Tag name ({0}) should match build version ({1})\n'.format(
          ATOM_SHELL_VERSION, build_version)
      sys.stderr.write(error)
      sys.stderr.flush()
      return 1

  github = GitHub(auth_token())
  releases = github.repos(ATOM_SHELL_REPO).releases.get()
  tag_exists = False
  for release in releases:
    if not release['draft'] and release['tag_name'] == args.version:
      tag_exists = True
      break

  release = create_or_get_release_draft(github, releases, args.version,
                                        tag_exists)

  if args.publish_release:
    # Upload the SHASUMS.txt.
    execute([sys.executable,
             os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
             '-v', ATOM_SHELL_VERSION])

    # Upload the index.json.
    execute([sys.executable,
             os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')])

    # 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, os.path.join(DIST_DIR, DIST_NAME))
  upload_atom_shell(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME))

  # Upload chromedriver and mksnapshot for minor version update.
  if get_target_arch() != 'arm' and parse_version(args.version)[2] == '0':
    chromedriver = 'chromedriver-{0}-{1}-{2}.zip'.format(
        get_chromedriver_version(), PLATFORM, get_target_arch())
    upload_atom_shell(github, release, os.path.join(DIST_DIR, chromedriver))
    upload_atom_shell(github, release, os.path.join(DIST_DIR, MKSNAPSHOT_NAME))

  if PLATFORM == 'win32' and not tag_exists:
    # Upload node headers.
    execute([sys.executable,
             os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
             '-v', args.version])
Example #2
0
def create_chromedriver_zip():
    dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(
        get_chromedriver_version(), PLATFORM, get_target_arch())
    zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

    with scoped_cwd(DIST_DIR):
        files = ['LICENSE']
        if PLATFORM == 'win32':
            files += ['chromedriver.exe']
        else:
            files += ['chromedriver']
        make_zip(zip_file, files, [])
Example #3
0
def create_chromedriver_zip():
  dist_name = 'chromedriver-{0}-{1}-{2}.zip'.format(get_chromedriver_version(),
                                                    TARGET_PLATFORM, DIST_ARCH)
  zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)

  with scoped_cwd(DIST_DIR):
    files = ['LICENSE']
    if TARGET_PLATFORM == 'win32':
      files += ['chromedriver.exe']
    else:
      files += ['chromedriver']
    make_zip(zip_file, files, [])
Example #4
0
def main():
    args = parse_args()

    if not dist_newer_than_head():
        create_dist = os.path.join(SOURCE_ROOT, "script", "create-dist.py")
        execute([sys.executable, create_dist])

    build_version = get_atom_shell_build_version()
    if not ATOM_SHELL_VERSION.startswith(build_version):
        error = "Tag name ({0}) should match build version ({1})\n".format(ATOM_SHELL_VERSION, build_version)
        sys.stderr.write(error)
        sys.stderr.flush()
        return 1

    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])

        # Upload the index.json.
        execute([sys.executable, os.path.join(SOURCE_ROOT, "script", "upload-index-json.py")])

        # 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))

    # Upload chromedriver and mksnapshot for minor version update.
    if get_target_arch() != "arm" and parse_version(args.version)[2] == "0":
        chromedriver = "chromedriver-{0}-{1}-{2}.zip".format(get_chromedriver_version(), PLATFORM, get_target_arch())
        upload_atom_shell(github, release_id, os.path.join(DIST_DIR, chromedriver))
        upload_atom_shell(github, release_id, os.path.join(DIST_DIR, MKSNAPSHOT_NAME))

    if PLATFORM == "win32":
        # Upload node headers.
        execute(
            [sys.executable, os.path.join(SOURCE_ROOT, "script", "upload-node-headers.py"), "-v", ATOM_SHELL_VERSION]
        )
Example #5
0
def main():
    rm_rf(DIST_DIR)
    os.makedirs(DIST_DIR)

    force_build()
    create_symbols()
    copy_binaries()
    copy_chrome_binary('chromedriver')
    copy_chrome_binary('mksnapshot')
    copy_license()

    if PLATFORM == 'linux':
        strip_binaries()
        copy_system_libraries()

    create_version()
    create_dist_zip()
    create_chrome_binary_zip('chromedriver', get_chromedriver_version())
    create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION)
    create_symbols_zip()
Example #6
0
def main():
  rm_rf(DIST_DIR)
  os.makedirs(DIST_DIR)

  force_build()
  create_symbols()
  copy_binaries()
  copy_chrome_binary('chromedriver')
  copy_chrome_binary('mksnapshot')
  copy_license()

  if PLATFORM == 'linux':
    strip_binaries()
    copy_system_libraries()

  create_version()
  create_dist_zip()
  create_chrome_binary_zip('chromedriver', get_chromedriver_version())
  create_chrome_binary_zip('mksnapshot', ATOM_SHELL_VERSION)
  create_symbols_zip()
Example #7
0
import argparse
import errno
import os
import subprocess
import sys
import tempfile

from lib.config import PLATFORM, get_target_arch
from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \
                     get_chromedriver_version, scoped_cwd
from lib.github import GitHub


ATOM_SHELL_REPO = 'atom/electron'
ATOM_SHELL_VERSION = get_atom_shell_version()
CHROMEDRIVER_VERSION = get_chromedriver_version()

PROJECT_NAME = atom_gyp()['project_name%']
PRODUCT_NAME = atom_gyp()['product_name%']

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = '{0}-{1}-{2}-{3}.zip'.format(PROJECT_NAME,
                                         ATOM_SHELL_VERSION,
                                         PLATFORM,
                                         get_target_arch())
SYMBOLS_NAME = '{0}-{1}-{2}-{3}-symbols.zip'.format(PROJECT_NAME,
                                                    ATOM_SHELL_VERSION,
                                                    PLATFORM,
                                                    get_target_arch())
Example #8
0
import argparse
import errno
import os
import subprocess
import sys
import tempfile

from lib.config import DIST_ARCH, TARGET_PLATFORM
from lib.util import execute, get_atom_shell_version, parse_version, \
                     get_chromedriver_version, scoped_cwd
from lib.github import GitHub

ATOM_SHELL_REPO = 'atom/atom-shell'
ATOM_SHELL_VERSION = get_atom_shell_version()
CHROMEDRIVER_VERSION = get_chromedriver_version()

SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
DIST_NAME = 'atom-shell-{0}-{1}-{2}.zip'.format(ATOM_SHELL_VERSION,
                                                TARGET_PLATFORM, DIST_ARCH)
SYMBOLS_NAME = 'atom-shell-{0}-{1}-{2}-symbols.zip'.format(
    ATOM_SHELL_VERSION, TARGET_PLATFORM, DIST_ARCH)
CHROMEDRIVER_NAME = 'chromedriver-{0}-{1}-{2}.zip'.format(
    CHROMEDRIVER_VERSION, TARGET_PLATFORM, DIST_ARCH)


def main():
    args = parse_args()
Example #9
0
def main():
    args = parse_args()

    if not args.publish_release:
        if not dist_newer_than_head():
            create_dist = os.path.join(SOURCE_ROOT, 'script', 'create-dist.py')
            execute([sys.executable, create_dist])

        build_version = get_atom_shell_build_version()
        if not ATOM_SHELL_VERSION.startswith(build_version):
            error = 'Tag name ({0}) should match build version ({1})\n'.format(
                ATOM_SHELL_VERSION, build_version)
            sys.stderr.write(error)
            sys.stderr.flush()
            return 1

    github = GitHub(auth_token())
    releases = github.repos(ATOM_SHELL_REPO).releases.get()
    tag_exists = False
    for release in releases:
        if not release['draft'] and release['tag_name'] == args.version:
            tag_exists = True
            break

    release = create_or_get_release_draft(github, releases, args.version,
                                          tag_exists)

    if args.publish_release:
        # Upload the SHASUMS.txt.
        execute([
            sys.executable,
            os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'), '-v',
            ATOM_SHELL_VERSION
        ])

        # Upload the index.json.
        execute([
            sys.executable,
            os.path.join(SOURCE_ROOT, 'script', 'upload-index-json.py')
        ])

        # 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, os.path.join(DIST_DIR, DIST_NAME))
    upload_atom_shell(github, release, os.path.join(DIST_DIR, SYMBOLS_NAME))

    # Upload chromedriver and mksnapshot for minor version update.
    if get_target_arch() != 'arm' and parse_version(args.version)[2] == '0':
        chromedriver = 'chromedriver-{0}-{1}-{2}.zip'.format(
            get_chromedriver_version(), PLATFORM, get_target_arch())
        upload_atom_shell(github, release,
                          os.path.join(DIST_DIR, chromedriver))
        upload_atom_shell(github, release,
                          os.path.join(DIST_DIR, MKSNAPSHOT_NAME))

    if PLATFORM == 'win32' and not tag_exists:
        # Upload node headers.
        execute([
            sys.executable,
            os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
            '-v', args.version
        ])