chore: initial work for running releases of GN build

This commit is contained in:
Samuel Attard 2018-09-27 15:38:06 +10:00
parent 77fb9cf416
commit 4b0f335aba
12 changed files with 172 additions and 26 deletions

View file

@ -6,16 +6,21 @@ const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds'
const vstsURL = 'https://github.visualstudio.com/electron/_apis/build'
const appVeyorJobs = {
'electron-x64': 'electron',
'electron-ia32': 'electron-39ng6'
'electron-x64': 'electron-n7wrc',
'electron-ia32': 'electron-egxcs'
}
// TODO: Enable the Build Processing preview to get the ability to trigger workflows
// programatically.
// - https://circleci.com/docs/2.0/build-processing/
// TODO: Update sudowoodo to somehow support monitoring workflows and individual
// builds on legacy brances
const circleCIJobs = [
'electron-linux-arm',
'electron-linux-arm64',
'electron-linux-ia32',
// 'electron-linux-mips64el',
'electron-linux-x64'
'linux-arm-release',
'linux-arm64-release',
'linux-ia32-release',
'linux-x64-release'
]
const vstsJobs = [
@ -94,16 +99,13 @@ function buildAppVeyor (targetBranch, options) {
async function callAppVeyor (targetBranch, job, options) {
console.log(`Triggering AppVeyor to run build job: ${job} on branch: ${targetBranch} with release flag.`)
let environmentVariables = {}
if (options.ghRelease) {
environmentVariables.ELECTRON_RELEASE = 1
} else {
environmentVariables.RUN_RELEASE_BUILD = 'true'
const environmentVariables = {
GN_CONFIG: 'release',
ELECTRON_RELEASE: 1
}
if (options.automaticRelease) {
environmentVariables.AUTO_RELEASE = 'true'
if (!options.ghRelease) {
environmentVariables.UPLOAD_TO_S3 = 1
}
const requestOpts = {
@ -144,16 +146,14 @@ async function buildVSTS (targetBranch, options) {
assert(vstsJobs.includes(options.job), `Unknown VSTS CI job name: ${options.job}. Valid values are: ${vstsJobs}.`)
}
console.log(`Triggering VSTS to run build on branch: ${targetBranch} with release flag.`)
let environmentVariables = {}
const environmentVariables = {
ELECTRON_RELEASE: 1
}
if (!options.ghRelease) {
environmentVariables.UPLOAD_TO_S3 = 1
}
if (options.automaticRelease) {
environmentVariables.AUTO_RELEASE = 'true'
}
let requestOpts = {
url: `${vstsURL}/definitions?api-version=4.1`,
auth: {

View file

@ -9,7 +9,7 @@ from lib.util import get_electron_branding, execute, rm_rf
ELECTRON_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SOURCE_ROOT = os.path.abspath(os.path.dirname(ELECTRON_ROOT))
RELEASE_PATH = os.path.join('out', 'Release')
RELEASE_PATH = os.path.join('out', 'Default')
def main():
args = parse_args()

View file

@ -21,6 +21,7 @@ import zipfile
from lib.config import is_verbose_mode, PLATFORM
from lib.env_util import get_vs_env
GN_SRC_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', '..'))
BOTO_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'vendor',
'boto'))
@ -295,3 +296,10 @@ def make_version(major, minor, patch, pre = None):
return major + '.' + minor + '.' + patch
return major + "." + minor + "." + patch + '-' + pre
def get_out_dir():
out_dir = 'Debug'
override = os.environ.get('ELECTRON_OUT_DIR')
if override is not None:
out_dir = override
return os.path.join(GN_SRC_DIR, 'out', out_dir)

View file

@ -7,6 +7,8 @@ import urllib2
from lib.config import s3_config
from lib.util import s3put, scoped_cwd, safe_mkdir
# TODO: Update this entire file to point at the correct file names in the out
# directory
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'D')

View file

@ -10,7 +10,8 @@ import tempfile
from lib.config import s3_config
from lib.util import download, rm_rf, s3put, safe_mkdir
# TODO: Update this entire file to point at the correct file names in the out
# directory
DIST_URL = 'https://atom.io/download/electron/'

View file

@ -9,7 +9,8 @@ import sys
from lib.config import PLATFORM, get_target_arch, s3_config
from lib.util import safe_mkdir, scoped_cwd, s3put
# TODO: Update this entire file to point at the correct file names in the out
# directory
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')

View file

@ -7,7 +7,8 @@ import sys
from lib.config import PLATFORM, s3_config, enable_verbose_mode
from lib.util import get_electron_branding, execute, rm_rf, safe_mkdir, s3put
# TODO: Update this entire file to point at the correct file names in the out
# directory
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
RELEASE_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')

View file

@ -33,6 +33,8 @@ DSYM_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'dsym')
PDB_NAME = get_zip_name(PROJECT_NAME, ELECTRON_VERSION, 'pdb')
# TODO: Update this entire file to point at the correct file names in the out
# directory
def main():
args = parse_args()
if args.upload_to_s3:

37
script/zip-symbols.py Normal file
View file

@ -0,0 +1,37 @@
import glob
import os
import sys
from lib.config import PLATFORM, get_target_arch
from lib.util import scoped_cwd, get_electron_version, make_zip, \
electron_gyp, get_out_dir
ELECTRON_VERSION = get_electron_version()
PROJECT_NAME = electron_gyp()['project_name%']
OUT_DIR = get_out_dir()
def main():
if get_target_arch() == 'mips64el':
return
dist_name = 'symbols.zip'
zip_file = os.path.join(OUT_DIR, dist_name)
licenses = ['LICENSE', 'LICENSES.chromium.html', 'version']
with scoped_cwd(OUT_DIR):
dirs = ['{0}.breakpad.syms'.format(PROJECT_NAME)]
make_zip(zip_file, licenses, dirs)
if PLATFORM == 'darwin':
dsym_name = 'dsym.zip'
with scoped_cwd(OUT_DIR):
dsyms = glob.glob('*.dSYM')
make_zip(os.path.join(OUT_DIR, dsym_name), licenses, dsyms)
elif PLATFORM == 'win32':
pdb_name = 'pdb.zip'
with scoped_cwd(OUT_DIR):
pdbs = glob.glob('*.pdb')
make_zip(os.path.join(OUT_DIR, pdb_name), pdbs + licenses, [])
if __name__ == '__main__':
sys.exit(main())