Merge branch 'master' into upstream_master

This commit is contained in:
Amin Yahyaabadi 2020-08-17 01:20:28 -05:00 committed by GitHub
commit b4909a9d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 1137 additions and 1336 deletions

7
.github/pull.yml vendored Normal file
View File

@ -0,0 +1,7 @@
version: "1"
rules: # Array of rules
- base: upstream_master # Required. Target branch
upstream: atom:master # Required. Must be in the same fork network.
mergeMethod: hardreset # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false
label: ":arrow_heading_down: pull upstream" # Optional

87
package-lock.json generated
View File

@ -53,43 +53,20 @@
}
},
"@atom/watcher": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@atom/watcher/-/watcher-1.3.1.tgz",
"integrity": "sha512-UjGisruWlcRLMzddE3pwvOx6wQCFN/+gg6Z4cJZvH1kjT5QT5eA04hUDs8QXF/QH8ZxMiOtP8x9SWTw0hCNelg==",
"version": "1.3.4-0",
"resolved": "https://registry.npmjs.org/@atom/watcher/-/watcher-1.3.4-0.tgz",
"integrity": "sha512-sbS+yVf3BrB4gM7uZd/QEM8HpqyJh2hsbWy0z8eym7xhc09a4/uTRoq6Tl9CxQfGGXxtkNFs7qfOPUGKfYLnUg==",
"requires": {
"event-kit": "2.5.3",
"fs-extra": "7.0.1",
"nan": "2.12.1",
"prebuild-install": "5.2.4"
"nan": "2.14.1",
"prebuild-install": "5.3.3"
},
"dependencies": {
"nan": {
"version": "2.12.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw=="
},
"prebuild-install": {
"version": "5.2.4",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.4.tgz",
"integrity": "sha512-CG3JnpTZXdmr92GW4zbcba4jkDha6uHraJ7hW4Fn8j0mExxwOKK20hqho8ZuBDCKYCHYIkFM1P2jhtG+KpP4fg==",
"requires": {
"detect-libc": "^1.0.3",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"napi-build-utils": "^1.0.1",
"node-abi": "^2.7.0",
"noop-logger": "^0.1.1",
"npmlog": "^4.0.1",
"os-homedir": "^1.0.1",
"pump": "^2.0.1",
"rc": "^1.2.7",
"simple-get": "^2.7.0",
"tar-fs": "^1.13.0",
"tunnel-agent": "^0.6.0",
"which-pm-runs": "^1.0.0"
}
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz",
"integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw=="
}
}
},
@ -1294,9 +1271,9 @@
"integrity": "sha512-7+Wlx3BImrK0HiG6y3lU4xX7SpBPSSu8T9iguPMlaueRFxjbYwAQrp9lqZUuFikqKbd/en8lVREILvP2J80uJA=="
},
"ajv": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==",
"version": "6.12.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz",
"integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@ -2723,9 +2700,9 @@
}
},
"electron-notarize": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.2.1.tgz",
"integrity": "sha512-oZ6/NhKeXmEKNROiFmRNfytqu3cxqC95sjooG7kBXQVEUSQkZnbiAhxVh5jXngL881G197pbwpeVPJyM7Ikmxw==",
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.3.0.tgz",
"integrity": "sha512-tuDw8H0gcDOalNLv6RM2CwGvUXU60MPGZRDEmd0ppX+yP5XqL8Ec2DuXyz9J7WQSA3aRCfzIgH8C5CAivDYWMw==",
"requires": {
"debug": "^4.1.1",
"fs-extra": "^8.1.0"
@ -2749,11 +2726,6 @@
"universalify": "^0.1.0"
}
},
"graceful-fs": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@ -2762,9 +2734,9 @@
}
},
"electron-osx-sign": {
"version": "0.4.15",
"resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.15.tgz",
"integrity": "sha512-1QtPNpjIji9bGZ0VRFwtJUyU1uHi7q3XUAOG0qFsvAUfs5H0T8hbgUfyg3xvPzmF1ruV8T8pQmQ86vNfLrcRiA==",
"version": "0.4.16",
"resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.16.tgz",
"integrity": "sha512-ziMWfc3NmQlwnWLW6EaZq8nH2BWVng/atX5GWsGwhexJYpdW6hsg//MkAfRTRx1kR3Veiqkeiog1ibkbA4x0rg==",
"requires": {
"bluebird": "^3.5.0",
"compare-version": "^0.1.2",
@ -2786,11 +2758,6 @@
"requires": {
"buffer-alloc": "^1.2.0"
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
},
@ -3048,9 +3015,9 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA=="
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
@ -3133,8 +3100,8 @@
}
},
"find-and-replace": {
"version": "https://www.atom.io/api/packages/find-and-replace/versions/0.219.3/tarball",
"integrity": "sha512-Ixc+4g6rAjO6L6QPdii8W0fTxGgjMO9AydodAEA6/o91bScGB4veKfn/yiZSMoXQwivw5fJpt8ZiMZ85lSijKw==",
"version": "https://www.atom.io/api/packages/find-and-replace/versions/0.219.5/tarball",
"integrity": "sha512-FVi54caB9IFGRBxye9nqnshryjCGhumlqioU/fwJTE+N8kUmJ/zjTUKiy9FhDK5782PUc4ig0cHimbH7o8vxmA==",
"requires": {
"binary-search": "^1.3.3",
"etch": "0.9.3",
@ -6302,9 +6269,9 @@
}
},
"scrollbar-style": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/scrollbar-style/-/scrollbar-style-3.2.0.tgz",
"integrity": "sha1-BmK2GJM2QWDLtbDEZxmAmwKHGKE=",
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/scrollbar-style/-/scrollbar-style-3.2.1.tgz",
"integrity": "sha512-suqwmmczpwidfoq+csq/e9KGopUbnKMJj6Pj+F+IqGl5Olt/khOkj/MjPrB3t+8QtipJ+APg92C1XcjzrNFtfQ==",
"requires": {
"event-kit": "^1.1.0",
"nan": "^2.0.0"
@ -6388,8 +6355,8 @@
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"settings-view": {
"version": "https://www.atom.io/api/packages/settings-view/versions/0.261.4/tarball",
"integrity": "sha512-UfFj+d3qa8sIbUc5H/VQKMi8FFuROI+Q2CZhLLWyg13IQzITwiu6kTMarYO932ma6jPOE6F8MjKusMsOP71xNQ==",
"version": "https://www.atom.io/api/packages/settings-view/versions/0.261.5/tarball",
"integrity": "sha512-ydVcLW71bjCX158QSt1R0AfHAaf4R39zqL6nxva3ut6DzpW94Hfd7O+/aHljHygnZILmjgXGIrSfINVVrEDXVQ==",
"requires": {
"async": "~0.2.9",
"dompurify": "^1.0.2",

View File

@ -12,11 +12,11 @@
"url": "https://github.com/atom/atom/issues"
},
"license": "MIT",
"electronVersion": "5.0.13",
"electronVersion": "6.1.12",
"dependencies": {
"@atom/nsfw": "1.0.26",
"@atom/source-map-support": "^0.3.4",
"@atom/watcher": "1.3.1",
"@atom/watcher": "1.3.4-0",
"about": "file:packages/about",
"archive-view": "https://www.atom.io/api/packages/archive-view/versions/0.65.2/tarball",
"async": "0.2.6",
@ -50,13 +50,13 @@
"deprecation-cop": "file:packages/deprecation-cop",
"dev-live-reload": "file:packages/dev-live-reload",
"devtron": "1.3.0",
"electron-notarize": "0.2.1",
"electron-osx-sign": "0.4.15",
"electron-notarize": "0.3.0",
"electron-osx-sign": "0.4.16",
"encoding-selector": "https://www.atom.io/api/packages/encoding-selector/versions/0.23.9/tarball",
"etch": "^0.12.6",
"event-kit": "^2.5.3",
"exception-reporting": "file:packages/exception-reporting",
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.219.3/tarball",
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.219.5/tarball",
"find-parent-dir": "^0.3.0",
"first-mate": "7.4.1",
"focus-trap": "2.4.5",
@ -143,11 +143,11 @@
"resolve": "1.17.0",
"scandal": "^3.2.0",
"scoped-property-store": "^0.17.0",
"scrollbar-style": "^3.2",
"scrollbar-style": "3.2.1",
"season": "^6.0.2",
"semver": "7.3.2",
"service-hub": "^0.7.4",
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.261.4/tarball",
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.261.5/tarball",
"sinon": "1.17.4",
"snippets": "https://www.atom.io/api/packages/snippets/versions/1.5.1/tarball",
"solarized-dark-syntax": "file:packages/solarized-dark-syntax",
@ -202,7 +202,7 @@
"dev-live-reload": "file:./packages/dev-live-reload",
"encoding-selector": "0.23.9",
"exception-reporting": "file:./packages/exception-reporting",
"find-and-replace": "0.219.3",
"find-and-replace": "0.219.5",
"fuzzy-finder": "1.14.2",
"github": "0.34.2",
"git-diff": "file:./packages/git-diff",
@ -218,7 +218,7 @@
"notifications": "0.71.0",
"open-on-github": "1.3.2",
"package-generator": "1.3.0",
"settings-view": "0.261.4",
"settings-view": "0.261.5",
"snippets": "1.5.1",
"spell-check": "0.76.1",
"status-bar": "1.8.17",

View File

@ -4,7 +4,7 @@ const assert = require('assert');
const childProcess = require('child_process');
const electronPackager = require('electron-packager');
const fs = require('fs-extra');
const hostArch = require('electron-packager/targets').hostArch;
const hostArch = require('@electron/get').getHostArch;
const includePathInPackagedApp = require('./include-path-in-packaged-app');
const getLicenseText = require('./get-license-text');
const path = require('path');

1034
script/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,9 +13,9 @@
"colors": "1.1.2",
"donna": "1.0.16",
"electron-chromedriver": "^9.0.0",
"electron-link": "0.4.1",
"electron-link": "^0.4.3",
"electron-mksnapshot": "^9.0.2",
"electron-packager": "12.2.0",
"electron-packager": "^15.0.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-config-standard": "^12.0.0",

View File

@ -65,7 +65,7 @@ if (process.platform === 'darwin') {
assertExecutablePaths(executablePaths)
executablePath = executablePaths[0]
} else {
throw new Error('Running tests on this platform is not supported.')
throw new Error('##[error] Running tests on this platform is not supported.')
}
function prepareEnv (suiteName) {
@ -96,24 +96,41 @@ function runCoreMainProcessTests (callback) {
const testEnv = Object.assign({}, prepareEnv('core-main-process'), {ATOM_GITHUB_INLINE_GIT_EXEC: 'true'})
console.log('Executing core main process tests'.bold.green)
console.log('##[command] Executing core main process tests'.bold.green)
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
cp.on('error', error => { callback(error) })
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process'}) })
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-main-process', testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
}
function runCoreRenderProcessTests (callback) {
const testPath = path.join(CONFIG.repositoryRootPath, 'spec')
const testArguments = [
'--resource-path', resourcePath,
'--test', testPath
]
const testEnv = prepareEnv('core-render-process')
// Build an array of functions, each running tests for a different rendering test
const coreRenderProcessTestSuites = []
const testPath = path.join(CONFIG.repositoryRootPath, 'spec')
let testFiles = glob.sync(path.join(testPath, '*-spec.+(js|coffee|ts|jsx|tsx|mjs)'))
for (let testFile of testFiles) {
coreRenderProcessTestSuites.push( function (callback) {
console.log('Executing core render process tests'.bold.green)
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
cp.on('error', error => { callback(error) })
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-render-process'}) })
const testEnv = prepareEnv('core-render-process')
console.log(`##[command] Executing core render process tests for ${testFile}`.bold.green)
const testArguments = [
'--resource-path', resourcePath,
'--test', testFile
]
const cp = childProcess.spawn(executablePath, testArguments, { env: testEnv})
let stderrOutput = ''
cp.stderr.on('data', data => { stderrOutput += data })
cp.stdout.on('data', data => { stderrOutput += data })
cp.on('error', error => {
console.log(error, "error")
callback(error)
})
cp.on('close', exitCode => {
if (exitCode !== 0) {
console.log(`##[error] Renderer tests failed for ${testFile}:`.red)
console.log(stderrOutput)
}
callback(null, {exitCode, step: `core-render-process for ${testFile}.`, testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`})
})
})
}
// Build an array of functions, each running tests for a different bundled package
@ -145,7 +162,7 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
const nodeModulesPath = path.join(repositoryPackagePath, 'node_modules')
let finalize = () => null
if (require(pkgJsonPath).atomTestRunner) {
console.log(`Installing test runner dependencies for ${packageName}`.bold.green)
console.log(`##[command] Installing test runner dependencies for ${packageName}`.bold.green)
if (fs.existsSync(nodeModulesPath)) {
const backup = backupNodeModules(repositoryPackagePath)
finalize = backup.restore
@ -153,9 +170,9 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
finalize = () => fs.removeSync(nodeModulesPath)
}
runApmInstall(repositoryPackagePath)
console.log(`Executing ${packageName} tests`.green)
console.log(`##[command] Executing ${packageName} tests`.green)
} else {
console.log(`Executing ${packageName} tests`.bold.green)
console.log(`##[command] Executing ${packageName} tests`.bold.green)
}
const cp = childProcess.spawn(executablePath, testArguments, {env: testEnv})
@ -169,11 +186,11 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
})
cp.on('close', exitCode => {
if (exitCode !== 0) {
console.log(`Package tests failed for ${packageName}:`.red)
console.log(`##[error] Package tests failed for ${packageName}:`.red)
console.log(stderrOutput)
}
finalize()
callback(null, {exitCode, step: `package-${packageName}`})
callback(null, {exitCode, step: `package-${packageName}.`, testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`})
})
})
}
@ -183,61 +200,89 @@ function runBenchmarkTests (callback) {
const testArguments = ['--benchmark-test', benchmarksPath]
const testEnv = prepareEnv('benchmark')
console.log('Executing benchmark tests'.bold.green)
console.log('##[command] Executing benchmark tests'.bold.green)
const cp = childProcess.spawn(executablePath, testArguments, {stdio: 'inherit', env: testEnv})
cp.on('error', error => { callback(error) })
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-benchmarks'}) })
cp.on('close', exitCode => { callback(null, {exitCode, step: 'core-benchmarks', testCommand: `You can run the test again using: \n\t ${executablePath} ${testArguments.join(' ')}`}) })
}
let testSuitesToRun = requestedTestSuites() || testSuitesForPlatform(process.platform)
let testSuitesToRun = requestedTestSuites(process.platform)
function requestedTestSuites () {
const suites = []
if (argv.coreMain) {
suites.push(runCoreMainProcessTests)
}
if (argv.coreRenderer) {
suites.push(runCoreRenderProcessTests)
}
if (argv.coreBenchmark) {
suites.push(runBenchmarkTests)
}
if (argv.package) {
suites.push(...packageTestSuites)
}
return suites.length > 0 ? suites : null
}
function requestedTestSuites (platform) {
// env variable or argv options
let coreAll = process.env.ATOM_RUN_CORE_TESTS === 'true'
let coreMain = process.env.ATOM_RUN_CORE_MAIN_TESTS === 'true' || argv.coreMain
let coreRenderer = argv.coreRenderer || process.env.ATOM_RUN_CORE_RENDER_TESTS == 'true'
let coreRenderer1 = process.env.ATOM_RUN_CORE_RENDER_TESTS === '1'
let coreRenderer2 = process.env.ATOM_RUN_CORE_RENDER_TESTS === '2'
let packageAll = argv.package || process.env.ATOM_RUN_PACKAGE_TESTS == 'true'
let packages1 = process.env.ATOM_RUN_PACKAGE_TESTS === '1'
let packages2 = process.env.ATOM_RUN_PACKAGE_TESTS === '2'
let benchmark = argv.coreBenchmark
// Operating system overrides:
coreMain = coreMain || (platform === 'linux') || (platform === 'win32' && process.arch === 'x86')
// split package tests (used for macos in CI)
const PACKAGES_TO_TEST_IN_PARALLEL = 23
// split core render test (used for windows x64 in CI)
const CORE_RENDER_TO_TEST_IN_PARALLEL = 45
function testSuitesForPlatform (platform) {
let suites = []
switch (platform) {
case 'darwin':
const PACKAGES_TO_TEST_IN_PARALLEL = 23
// Core tess
if (coreAll) {
suites.push(...[runCoreMainProcessTests, ...coreRenderProcessTestSuites])
} else {
if (process.env.ATOM_RUN_CORE_TESTS === 'true') {
suites = [runCoreMainProcessTests, runCoreRenderProcessTests]
} else if (process.env.ATOM_RUN_PACKAGE_TESTS === '1') {
suites = packageTestSuites.slice(0, PACKAGES_TO_TEST_IN_PARALLEL)
} else if (process.env.ATOM_RUN_PACKAGE_TESTS === '2') {
suites = packageTestSuites.slice(PACKAGES_TO_TEST_IN_PARALLEL)
} else {
suites = [runCoreMainProcessTests, runCoreRenderProcessTests].concat(packageTestSuites)
// Core main tests
if (coreMain) {
suites.push(runCoreMainProcessTests)
}
// Core renderer tests
if (coreRenderer) {
suites.push(...coreRenderProcessTestSuites)
} else {
// split
if (coreRenderer1) {
suites.push(...coreRenderProcessTestSuites.slice(0, CORE_RENDER_TO_TEST_IN_PARALLEL))
}
break
case 'win32':
suites = (process.arch === 'x64') ? [runCoreMainProcessTests, runCoreRenderProcessTests] : [runCoreMainProcessTests]
break
case 'linux':
suites = [runCoreMainProcessTests]
break
default:
console.log(`Unrecognized platform: ${platform}`)
if (coreRenderer2) {
suites.push(...coreRenderProcessTestSuites.slice(CORE_RENDER_TO_TEST_IN_PARALLEL))
}
}
}
// Package tests
if (packageAll) {
suites.push(...packageTestSuites)
} else {
// split
if (packages1) {
suites.push(...packageTestSuites.slice(0, PACKAGES_TO_TEST_IN_PARALLEL))
}
if (packages2) {
suites.push(...packageTestSuites.slice(PACKAGES_TO_TEST_IN_PARALLEL))
}
}
// Benchmark tests
if (benchmark) {
suites.push(runBenchmarkTests)
}
if (argv.skipMainProcessTests) {
suites = suites.filter(suite => suite !== runCoreMainProcessTests)
}
// Remove duplicates
suites = Array.from(new Set(suites))
if (suites.length == 0) {
throw new Error("No tests was requested")
}
return suites
}
@ -248,10 +293,14 @@ async.series(testSuitesToRun, function (err, results) {
} else {
const failedSteps = results.filter(({exitCode}) => exitCode !== 0)
for (const {step} of failedSteps) {
console.error(`Error! The '${step}' test step finished with a non-zero exit code`)
if (failedSteps.length > 0) {
console.warn("##[error] \n \n *** Reporting the errors that happened in all of the tests: *** \n \n")
for (const {step, testCommand} of failedSteps) {
console.error(`##[error] The '${step}' test step finished with a non-zero exit code \n ${testCommand}`)
}
process.exit(1)
}
process.exit(failedSteps.length === 0 ? 0 : 1)
process.exit(0)
}
})

View File

@ -4,6 +4,10 @@ const request = require('request-promise-native');
const repositoryRootPath = path.resolve(__dirname, '..', '..');
const appMetadata = require(path.join(repositoryRootPath, 'package.json'));
const REPO_OWNER = process.env.REPO_OWNER || 'atom';
const NIGHTLY_RELEASE_REPO =
process.env.NIGHTLY_RELEASE_REPO || 'atom-nightly-releases';
const yargs = require('yargs');
const argv = yargs
.usage('Usage: $0 [options]')
@ -26,7 +30,7 @@ async function getReleaseVersion() {
let releaseVersion = process.env.ATOM_RELEASE_VERSION || appMetadata.version;
if (argv.nightly) {
const releases = await request({
url: 'https://api.github.com/repos/atom/atom-nightly-releases/releases',
url: `https://api.github.com/repos/${REPO_OWNER}/${NIGHTLY_RELEASE_REPO}/releases`,
headers: {
Accept: 'application/vnd.github.v3+json',
'User-Agent': 'Atom Release Build'
@ -78,6 +82,7 @@ async function getReleaseVersion() {
buildBranch.startsWith('electron-') ||
(buildBranch === 'master' &&
!process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER));
const SHOULD_SIGN = process.env.SHOULD_SIGN;
console.log(
`##vso[task.setvariable variable=AppName;isOutput=true]${getAppName(
@ -90,6 +95,9 @@ async function getReleaseVersion() {
console.log(
`##vso[task.setvariable variable=IsSignedZipBranch;isOutput=true]${isSignedZipBranch}`
);
console.log(
`##vso[task.setvariable variable=SHOULD_SIGN;isOutput=true]${SHOULD_SIGN}`
);
}
getReleaseVersion();

View File

@ -3,6 +3,11 @@ const octokit = require('@octokit/rest')();
const changelog = require('pr-changelog');
const childProcess = require('child_process');
const REPO_OWNER = process.env.REPO_OWNER || 'atom';
const MAIN_REPO = process.env.MAIN_REPO || 'atom';
const NIGHTLY_RELEASE_REPO =
process.env.NIGHTLY_RELEASE_REPO || 'atom-nightly-releases';
module.exports.getRelease = async function(releaseVersion, githubToken) {
if (githubToken) {
octokit.authenticate({
@ -12,8 +17,8 @@ module.exports.getRelease = async function(releaseVersion, githubToken) {
}
const releases = await octokit.repos.getReleases({
owner: 'atom',
repo: 'atom'
owner: REPO_OWNER,
repo: MAIN_REPO
});
const release = releases.data.find(r => semver.eq(r.name, releaseVersion));
@ -49,16 +54,16 @@ module.exports.generateForVersion = async function(
oldVersionName = `v${parsedVersion.major}.${parsedVersion.minor - 1}.0`;
} else {
let releases = await octokit.repos.getReleases({
owner: 'atom',
repo: 'atom'
owner: REPO_OWNER,
repo: MAIN_REPO
});
oldVersion = 'v' + getPreviousRelease(releaseVersion, releases.data).name;
oldVersionName = oldVersion;
}
const allChangesText = await changelog.getChangelog({
owner: 'atom',
repo: 'atom',
owner: REPO_OWNER,
repo: MAIN_REPO,
fromTag: oldVersion,
toTag: newVersionBranch,
dependencyKey: 'packageDependencies',
@ -71,7 +76,7 @@ module.exports.generateForVersion = async function(
}) {
let prString = changelog.pullRequestsToString(pullRequests);
let title = repo;
if (repo === 'atom') {
if (repo === MAIN_REPO) {
title = 'Atom Core';
fromTag = oldVersionName;
toTag = releaseVersion;
@ -110,13 +115,13 @@ module.exports.generateForNightly = async function(
const latestCommit = latestCommitResult.stdout.toString().trim();
const output = [
`### This nightly release is based on https://github.com/atom/atom/commit/${latestCommit} :atom: :night_with_stars:`
`### This nightly release is based on https://github.com/${REPO_OWNER}/${MAIN_REPO}/commit/${latestCommit} :atom: :night_with_stars:`
];
try {
const releases = await octokit.repos.getReleases({
owner: 'atom',
repo: 'atom-nightly-releases'
owner: REPO_OWNER,
repo: NIGHTLY_RELEASE_REPO
});
const previousRelease = getPreviousRelease(releaseVersion, releases.data);
@ -139,7 +144,7 @@ module.exports.generateForNightly = async function(
output.push('No changes have been included in this release');
} else {
output.push(
`Click [here](https://github.com/atom/atom/compare/${previousCommit}...${latestCommit}) to see the changes included with this release!`
`Click [here](https://github.com/${REPO_OWNER}/${MAIN_REPO}/compare/${previousCommit}...${latestCommit}) to see the changes included with this release!`
);
}
}

View File

@ -1,14 +1,8 @@
jobs:
- job: GetReleaseVersion
steps:
# This has to be done separately because VSTS inexplicably
# exits the script block after `npm install` completes.
- script: |
cd script\vsts
npm install
displayName: npm install
- script: node script\vsts\get-release-version.js --nightly
name: Version
# GetReleaseVersion for nightly release
- template: platforms/templates/get-release-version.yml
parameters:
NightlyFlag: --nightly
# Import OS-specific build definitions
- template: platforms/windows.yml
@ -18,11 +12,11 @@ jobs:
- job: Release
pool:
vmImage: vs2017-win2016
vmImage: 'ubuntu-latest'
dependsOn:
- GetReleaseVersion
- Windows
- Windows_RendererTests
- Linux
- macOS_tests
@ -30,17 +24,12 @@ jobs:
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- template: platforms/templates/preparation.yml
#This has to be done separately because VSTS inexplicably
#exits the script block after `npm install` completes.
- script: |
cd script\vsts
npm install
displayName: npm install
cd script/vsts
npm ci
displayName: npm ci
- task: DownloadBuildArtifacts@0
inputs:
@ -49,7 +38,7 @@ jobs:
displayName: Download Release Artifacts
- script: |
node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom"
node $(Build.SourcesDirectory)/script/vsts/upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
@ -66,23 +55,15 @@ jobs:
vmImage: macos-10.14
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- template: platforms/templates/preparation.yml
- script: npm install --global npm@6.12.1
displayName: Update npm
- template: platforms/templates/bootstrap.yml
- script: |
script/bootstrap
displayName: Bootstrap
- script: |
- script: |
cd script/lib
npm install
displayName: npm install
- script: |
npm ci
displayName: npm ci
- script: |
cd script/lib/update-dependency
node index.js
displayName: Bump depedencies

View File

@ -5,117 +5,33 @@ jobs:
variables:
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
pool:
# This image is used to host the Docker container that runs the build
vmImage: ubuntu-16.04
container: ubuntu:trusty
steps:
- script: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main"
sudo apt-get update
sudo apt-get install -y build-essential ca-certificates clang-5.0 xvfb fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0 libasound2 libicu-dev
displayName: Install apt dependencies
- template: templates/preparation.yml
- script: sudo /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
displayName: Start Xvfb
- template: templates/cache.yml
parameters:
OS: linux
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/linux.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
CC: clang-5.0
CXX: clang++-5.0
npm_config_clang: 1
condition: ne(variables['CacheRestored'], 'true')
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: Save node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/linux.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- template: templates/bootstrap.yml
- script: script/lint
displayName: Run linter
- script: script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
CC: clang-5.0
CXX: clang++-5.0
npm_config_clang: 1
displayName: Build Atom
- script: |
sudo chown root ./out/atom*-amd64/chrome-sandbox
sudo chmod 4755 ./out/atom*-amd64/chrome-sandbox
displayName: Tweaking chrome-sandbox binary
- template: templates/build.yml
- script: script/test
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
DISPLAY: :99.0
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
- template: templates/test.yml
- script: script/postprocess-junit-results --search-folder "${TEST_JUNIT_XML_ROOT}" --test-results-files "**/*.xml"
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)/junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: Linux
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom.x86_64.rpm
ArtifactName: atom.x86_64.rpm
ArtifactType: Container
displayName: Upload atom.x84_64.rpm
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.deb
ArtifactName: atom-amd64.deb
ArtifactType: Container
displayName: Upload atom-amd64.deb
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.tar.gz
ArtifactName: atom-amd64.tar.gz
ArtifactType: Container
displayName: Upload atom-amd64.tar.gz
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- template: templates/publish.yml
parameters:
artifacts:
- filename: atom.x86_64.rpm
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- filename: atom-amd64.deb
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- filename: atom-amd64.tar.gz
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))

View File

@ -8,90 +8,43 @@ jobs:
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
RunCoreMainTests: true
pool:
vmImage: macos-10.14
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- template: templates/preparation.yml
- script: npm install --global npm@6.12.1
displayName: Update npm
- template: templates/cache.yml
parameters:
OS: macos
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
NPM_BIN_PATH: /usr/local/bin/npm
npm_config_build_from_source: true
condition: ne(variables['CacheRestored'], 'true')
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: Save node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- template: templates/bootstrap.yml
- script: script/lint
displayName: Run linter
- script: |
if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then
script/build --no-bootstrap --code-sign --compress-artifacts
else
script/build --no-bootstrap --compress-artifacts
fi
displayName: Build Atom
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
IS_RELEASE_BRANCH: $(IsReleaseBranch)
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL)
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD)
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
AC_USER: $(AC_USER)
AC_PASSWORD: $(AC_PASSWORD)
- template: templates/build.yml
# core main tests
- template: templates/test.yml
- script: |
cp $(Build.SourcesDirectory)/out/*.zip $(Build.ArtifactStagingDirectory)
displayName: Stage Artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac.zip
ArtifactName: atom-mac.zip
ArtifactType: Container
displayName: Upload atom-mac.zip
condition: succeeded()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac-symbols.zip
ArtifactName: atom-mac-symbols.zip
ArtifactType: Container
displayName: Upload atom-mac-symbols.zip
condition: succeeded()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/docs/output/atom-api.json
ArtifactName: atom-api.json
ArtifactType: Container
displayName: Upload atom-api.json
condition: succeeded()
- template: templates/publish.yml
parameters:
artifacts:
- filename: atom-mac.zip
dir: $(Build.ArtifactStagingDirectory)
condition: succeeded()
- filename: atom-mac-symbols.zip
dir: $(Build.ArtifactStagingDirectory)
condition: succeeded()
- filename: atom-api.json
dir: $(Build.SourcesDirectory)/docs/output
condition: succeeded()
- job: macOS_tests
displayName: macOS test
@ -102,8 +55,8 @@ jobs:
strategy:
maxParallel: 3
matrix:
core:
RunCoreTests: true
renderer:
RunCoreRendererTests: true
RunPackageTests: false
packages-1:
RunCoreTests: false
@ -113,88 +66,20 @@ jobs:
RunPackageTests: 2
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- template: templates/preparation.yml
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache
inputs:
keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
- template: templates/cache.yml
parameters:
OS: macos
# The artifact caching task does not work on forks, so we need to
# bootstrap again for pull requests coming from forked repositories.
- script: script/bootstrap
displayName: Bootstrap build environment
env:
CI: true
CI_PROVIDER: VSTS
NPM_BIN_PATH: /usr/local/bin/npm
npm_config_build_from_source: true
- template: templates/bootstrap.yml
condition: ne(variables['CacheRestored'], 'true')
- template: templates/download-unzip.yml
parameters:
artifacts:
- atom-mac.zip
- atom-mac-symbols.zip
- task: DownloadBuildArtifacts@0
displayName: Download atom-mac.zip
inputs:
artifactName: 'atom-mac.zip'
downloadPath: $(Build.SourcesDirectory)
- script: unzip atom-mac.zip/atom-mac.zip -d out
displayName: Unzip atom-mac.zip
- task: DownloadBuildArtifacts@0
displayName: Download atom-mac-symbols.zip
inputs:
artifactName: 'atom-mac-symbols.zip'
downloadPath: $(Build.SourcesDirectory)
- script: unzip atom-mac-symbols.zip/atom-mac-symbols.zip -d out
displayName: Unzip atom-mac-symbols.zip
- script: |
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
caffeinate -s script/test # Run with caffeinate to prevent screen saver
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
ATOM_RUN_CORE_TESTS: $(RunCoreTests)
ATOM_RUN_PACKAGE_TESTS: $(RunPackageTests)
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
- script: script/postprocess-junit-results --search-folder "${TEST_JUNIT_XML_ROOT}" --test-results-files "**/*.xml"
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)/junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: MacOS
condition: ne(variables['Atom.SkipTests'], 'true')
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/crash-reports
cp ${HOME}/Library/Logs/DiagnosticReports/*.crash $(Build.ArtifactStagingDirectory)/crash-reports
displayName: Stage Crash Reports
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports
ArtifactName: crash-reports.zip
displayName: Upload Crash Reports
condition: failed()
- template: templates/test.yml

View File

@ -0,0 +1,31 @@
steps:
- pwsh: |
# OS specific env variables
if ($env:AGENT_OS -eq "Windows_NT") {
$env:NPM_BIN_PATH="C:/hostedtoolcache/windows/node/12.4.0/x64/npm.cmd"
$env:npm_config_build_from_source=true
}
if ($env:AGENT_OS -eq "Darwin") {
$env:NPM_BIN_PATH="/Users/runner/hostedtoolcache/node/12.4.0/x64/bin/npm"
$env:npm_config_build_from_source=true
}
if ($env:AGENT_OS -eq "Linux") {
$env:NPM_BIN_PATH="/usr/local/bin/npm"
$env:CC=clang
$env:CXX=clang++
$env:npm_config_clang=1
}
# Bootstrap
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
node 'script\vsts\windows-run.js' 'script\bootstrap.cmd'
}
else {
script/bootstrap
}
displayName: Bootstrap build environment
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
CI: true
CI_PROVIDER: VSTS
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true'))

View File

@ -0,0 +1,58 @@
steps:
- pwsh: |
# OS specific env variables
if ($env:AGENT_OS -eq "Windows_NT") {
$env:SQUIRREL_TEMP="C:/tmp"
$env:npm_config_build_from_source=true
$ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL=$env:ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL
$ATOM_WIN_CODE_SIGNING_CERT_PASSWORD=$env:ATOM_WIN_CODE_SIGNING_CERT_PASSWORD
}
if ($env:AGENT_OS -eq "Darwin") {
$ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL=$env:ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL
$ATOM_MAC_CODE_SIGNING_CERT_PASSWORD=$env:ATOM_MAC_CODE_SIGNING_CERT_PASSWORD
$ATOM_MAC_CODE_SIGNING_KEYCHAIN=$env:ATOM_MAC_CODE_SIGNING_KEYCHAIN
$ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD=$env:ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD
$AC_USER=$env:AC_USER
$AC_PASSWORD=$env:AC_PASSWORD
}
if ($env:AGENT_OS -eq "Linux") {
$env:CC=clang
$env:CXX=clang++
$env:npm_config_clang=1
$env:LinuxArgs="--create-debian-package --create-rpm-package"
$env:SHOULD_SIGN="false"
}
# Build Arguments
## Creation of Windows Installaer
if ($env:AGENT_OS -eq "Windows_NT") {
mkdir -f -p $env:SQUIRREL_TEMP
if ($env:IS_RELEASE_BRANCH -eq "true") {
$CreateWindowsInstallaer="--create-windows-installer"
}
}
## Code Sign
if ( ($env:SHOULD_SIGN -eq "true") -and (($env:IS_RELEASE_BRANCH -eq "true") -or ($env:IS_SIGNED_ZIP_BRANCH -eq "true")) ) {
$CodeSign="--code-sign"
}
# Build
$esc = '--%'
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
node 'script\vsts\windows-run.js' 'script\build.cmd' --no-bootstrap --compress-artifacts $esc $CodeSign $CreateWindowsInstallaer
} else {
script/build --no-bootstrap --compress-artifacts $esc $env:LinuxArgs $CodeSign $CreateWindowsInstallaer
}
displayName: Build Atom
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
IS_RELEASE_BRANCH: $(IsReleaseBranch)
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
- script: |
sudo chown root ./out/atom*-amd64/chrome-sandbox
sudo chmod 4755 ./out/atom*-amd64/chrome-sandbox
displayName: Tweaking chrome-sandbox binary
condition: eq(variables['Agent.OS'], 'Linux')

View File

@ -0,0 +1,30 @@
parameters:
- name: OS
displayName: Operating System
type: string
values:
- windows
- linux
- macos
steps:
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml'
path: 'node_modules'
cacheHitVar: MainNodeModulesRestored
- task: Cache@2
displayName: Cache script/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/package.json, script/package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml'
path: 'script/node_modules'
cacheHitVar: ScriptNodeModulesRestored
- task: Cache@2
displayName: Cache apm/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/${{ parameters.OS }}.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored

View File

@ -0,0 +1,18 @@
parameters:
- name: artifacts
type: object
default: {}
- name: downloadPath
type: string
default: $(Build.SourcesDirectory)
steps:
- ${{ each artifact in parameters.artifacts }}:
- task: DownloadBuildArtifacts@0
displayName: Download ${{artifact}}
inputs:
artifactName: ${{artifact}}
downloadPath: ${{parameters.downloadPath}}
- script: unzip ${{artifact}}/${{artifact}} -d out
displayName: Unzip ${{artifact}}

View File

@ -0,0 +1,19 @@
parameters:
- name: NightlyFlag
type: string
values:
- ' '
- --nightly
default: ' '
jobs:
- job: GetReleaseVersion
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
cd script/vsts
npm ci
node get-release-version.js ${{ parameters.NightlyFlag }}
name: Version

View File

@ -0,0 +1,67 @@
steps:
# Linux Specific
- script: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
sudo apt-get install -y build-essential ca-certificates xvfb fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0 libasound2 libicu-dev
# clang 9 is included in the image
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 10
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10
sudo update-alternatives --config clang
sudo update-alternatives --config clang++
clang -v
displayName: Install apt dependencies
condition: eq(variables['Agent.OS'], 'Linux')
- script: sudo /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
displayName: Start Xvfb
condition: eq(variables['Agent.OS'], 'Linux')
# Common
- task: NodeTool@0
inputs:
versionSpec: 12.4.0
displayName: Install Node.js 12.4.0
- script: npm install --global npm@6.9.0
displayName: Update npm
condition: ne(variables['Agent.OS'], 'Darwin')
- pwsh: |
if ($env:AGENT_OS -eq "Windows_NT") {
$env:BUILD_ARCH=$env:buildArch
echo "##vso[task.setvariable variable=BUILD_ARCH]$env:BUILD_ARCH" # Azure syntax
}
echo BUILD_ARCH: $env:BUILD_ARCH
displayName: Setting globally used env variables
# Windows Specific
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
condition: eq(variables['Agent.OS'], 'Windows_NT')
- script: |
ECHO Installing npm-windows-upgrade
npm install --global --production npm-windows-upgrade
displayName: Install npm-windows-upgrade
condition: eq(variables['Agent.OS'], 'Windows_NT')
- script: |
ECHO Upgrading npm
npm-windows-upgrade --no-spinner --no-prompt --npm-version 6.9.0
displayName: Install npm 6.9.0
condition: eq(variables['Agent.OS'], 'Windows_NT')
- script: |
npm install --global --production windows-build-tools@4.0
displayName: Install windows build tools
condition: eq(variables['Agent.OS'], 'Windows_NT')
- script: |
cd script\vsts
npm install
displayName: Install Windows build dependencies
condition: eq(variables['Agent.OS'], 'Windows_NT')

View File

@ -0,0 +1,16 @@
parameters:
- name: artifacts
type: object
steps:
- ${{ each artifact in parameters.artifacts }}:
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: ${{artifact.dir}}/${{artifact.filename}}
ArtifactName: ${{artifact.filename}}
ArtifactType: Container
displayName: Upload ${{artifact.filename}}
${{ if artifact.condition }}:
condition: ${{artifact.condition}}
${{ if artifact.continueOnError }}:
continueOnError: ${{artifact.continueOnError}}

View File

@ -0,0 +1,85 @@
steps:
- pwsh: |
# OS specific env variables
if ($env:AGENT_OS -eq "Linux") {
$env:DISPLAY=":99.0"
$env:npm_config_build_from_source=true
}
# Test
if ($env:AGENT_OS -eq "Darwin") {
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
caffeinate -s script/test # Run with caffeinate to prevent screen saver
} elseif (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
node 'script\vsts\windows-run.js' 'script\test.cmd'
} else {
script/test
}
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
ATOM_RUN_CORE_TESTS: $(RunCoreTests)
ATOM_RUN_CORE_MAIN_TESTS: $(RunCoreMainTests)
ATOM_RUN_CORE_RENDER_TESTS: $(RunCoreRendererTests)
ATOM_RUN_PACKAGE_TESTS: $(RunPackageTests)
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
# Test results
- pwsh: |
if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) {
node 'script\vsts\windows-run.js' 'script\postprocess-junit-results.cmd' --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml"
} else {
script/postprocess-junit-results --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml"
}
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)/junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: $(Agent.OS) $(BUILD_ARCH)
condition: ne(variables['Atom.SkipTests'], 'true')
# Crash Reports
- pwsh: |
New-Item -Path $env:ARTIFACT_STAGING_DIR/crash-reports -Type Directory -Force
if (($env:AGENT_OS -eq "Windows_NT") -and (Test-Path "$env:TEMP/Atom Crashes")) {
cp "$env:TEMP/Atom Crashes/*.dmp" $env:ARTIFACT_STAGING_DIR/crash-reports
} else {
cp $env:HOME/Library/Logs/DiagnosticReports/*.crash $env:ARTIFACT_STAGING_DIR/crash-reports
}
env:
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
displayName: Stage Crash Reports
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports
ArtifactName: crash-reports.zip
${{ if eq(variables['Agent.OS'], 'Windows_NT') }}:
condition: and(failed(), eq(variables['ATOM_RELEASES_S3_KEY'], ''))
displayName: Publish crash reports on non-release branch
${{ if ne(variables['Agent.OS'], 'Windows_NT') }}:
condition: failed()
displayName: Upload Crash Reports
- script: >
node $(Build.SourcesDirectory)\script\vsts\upload-crash-reports.js --crash-report-path "%ARTIFACT_STAGING_DIR%\crash-reports" --s3-path "vsts-artifacts/%BUILD_ID%/"
env:
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
BUILD_ID: $(Build.BuildId)
displayName: Upload crash reports to S3 on release branch
condition: and(failed(), ne(variables['ATOM_RELEASES_S3_KEY'], ''), eq(variables['Agent.OS'], 'Windows_NT'))

View File

@ -1,5 +1,6 @@
jobs:
- job: Windows
- job: Windows_build
displayName: Windows build
dependsOn: GetReleaseVersion
timeoutInMinutes: 180
strategy:
@ -7,8 +8,10 @@ jobs:
matrix:
x64:
buildArch: x64
RunCoreMainTests: true
x86:
buildArch: x86
RunCoreMainTests: true
pool:
vmImage: vs2017-win2016
@ -20,241 +23,102 @@ jobs:
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- template: templates/preparation.yml
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- template: templates/cache.yml
parameters:
OS: windows
- script: |
ECHO Installing npm-windows-upgrade
npm install --global --production npm-windows-upgrade
displayName: Install npm-windows-upgrade
- script: |
ECHO Upgrading npm
npm-windows-upgrade --no-spinner --no-prompt --npm-version 6.12.1
displayName: Install npm 6.12.1
- script: |
npm install --global --production windows-build-tools@4.0
displayName: Install windows build tools
- script: |
cd script\vsts
npm install
displayName: Install Windows build dependencies
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache (x64)
inputs:
keyfile: 'package.json, script/vsts/platforms/windows.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json, script/vsts/x64-cache-key'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
condition: eq(variables['buildArch'], 'x64')
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: Restore node_modules cache (x86)
inputs:
keyfile: 'package.json, script/vsts/platforms/windows.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json, script/vsts/x86-cache-key'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
condition: eq(variables['buildArch'], 'x86')
- script: |
node script\vsts\windows-run.js script\bootstrap.cmd
env:
BUILD_ARCH: $(buildArch)
CI: true
CI_PROVIDER: VSTS
NPM_BIN_PATH: "C:\\hostedtoolcache\\windows\\node\\12.13.1\\x64\\npm.cmd"
npm_config_build_from_source: true
displayName: Bootstrap build environment
condition: ne(variables['CacheRestored'], 'true')
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: Save node_modules cache (x64)
inputs:
keyfile: 'package.json, script/vsts/platforms/windows.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json, script/vsts/x64-cache-key'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
condition: eq(variables['buildArch'], 'x64')
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: Save node_modules cache (x86)
inputs:
keyfile: 'package.json, script/vsts/platforms/windows.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json, script/vsts/x86-cache-key'
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2'
condition: eq(variables['buildArch'], 'x86')
- template: templates/bootstrap.yml
- script: node script\vsts\windows-run.js script\lint.cmd
env:
BUILD_ARCH: $(buildArch)
displayName: Run linter
- script: |
IF NOT EXIST C:\tmp MKDIR C:\tmp
SET SQUIRREL_TEMP=C:\tmp
IF [%IS_RELEASE_BRANCH%]==[true] (
ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME%
node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts --create-windows-installer
) ELSE (
IF [%IS_SIGNED_ZIP_BRANCH%]==[true] (
ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME%
node script\vsts\windows-run.js script\build.cmd --no-bootstrap --code-sign --compress-artifacts
) ELSE (
ECHO Pull request build, no code signing will be performed
node script\vsts\windows-run.js script\build.cmd --no-bootstrap --compress-artifacts
)
)
- template: templates/build.yml
- template: templates/test.yml
- pwsh: |
if ($env:BUILD_ARCH -eq "x64") {
$env:FileID="-x64"
} else {
$env:FileID=""
}
echo "##vso[task.setvariable variable=FileID]$env:FileID" # Azure syntax
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
BUILD_ARCH: $(buildArch)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL)
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: $(ATOM_WIN_CODE_SIGNING_CERT_PASSWORD)
IS_RELEASE_BRANCH: $(IsReleaseBranch)
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
npm_config_build_from_source: true
displayName: Build Atom
displayName: Set FileID based on the arch
- script: node script\vsts\windows-run.js script\test.cmd
- template: templates/publish.yml
parameters:
artifacts:
- filename: atom$(FileID)-windows.zip
dir: $(Build.SourcesDirectory)/out
condition: and( succeeded(), or( eq(variables['BUILD_ARCH'], 'x64'), ne(variables['Build.Reason'], 'PullRequest') ) )
- filename: AtomSetup$(FileID).exe
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
- filename: $(AppName)$(FileID)-$(ReleaseVersion)-full.nupkg
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
- filename: $(AppName)$(FileID)-$(ReleaseVersion)-delta.nupkg
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
- filename: RELEASES$(FileID)
dir: $(Build.SourcesDirectory)/out
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
- job: Windows_RendererTests
displayName: Windows
dependsOn: Windows_build
timeoutInMinutes: 180
strategy:
maxParallel: 2
matrix:
x64_Renderer_Test1:
RunCoreMainTests: false
RunCoreRendererTests: 1
buildArch: x64
x64_Renderer_Test2:
RunCoreMainTests: false
RunCoreRendererTests: 2
buildArch: x64
pool:
vmImage: vs2017-win2016
variables:
AppName: $[ dependencies.GetReleaseVersion.outputs['Version.AppName'] ]
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
steps:
- template: templates/preparation.yml
- template: templates/cache.yml
parameters:
OS: windows
- template: templates/bootstrap.yml
# Downloading the build artifacts
- pwsh: |
if ($env:BUILD_ARCH -eq "x64") {
$env:FileID="-x64"
echo "##vso[task.setvariable variable=FileID]$env:FileID" # Azure syntax
}
env:
CI: true
CI_PROVIDER: VSTS
ATOM_JASMINE_REPORTER: list
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)\junit
BUILD_ARCH: $(buildArch)
displayName: Run tests
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
displayName: Set FileID based on the arch
- script: >
node script\vsts\windows-run.js script\postprocess-junit-results.cmd
--search-folder %TEST_JUNIT_XML_ROOT% --test-results-files "**/*.xml"
env:
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)\junit
displayName: Post-process test results
condition: ne(variables['Atom.SkipTests'], 'true')
- template: templates/download-unzip.yml
parameters:
artifacts:
- atom$(FileID)-windows.zip
- task: PublishTestResults@2
inputs:
testResultsFormat: JUnit
searchFolder: $(Common.TestResultsDirectory)\junit
testResultsFiles: '**/*.xml'
mergeTestResults: true
testRunTitle: Windows $(buildArch)
condition: ne(variables['Atom.SkipTests'], 'true')
- script: |
IF NOT EXIST "%ARTIFACT_STAGING_DIR%\crash-reports" MKDIR "%ARTIFACT_STAGING_DIR%\crash-reports"
IF EXIST "%Temp%\Atom Crashes" (
FOR %%a in ("%Temp%\Atom Crashes\*.dmp") DO XCOPY "%%a" "%ARTIFACT_STAGING_DIR%\crash-reports" /I
)
displayName: Stage crash reports
condition: failed()
env:
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports
ArtifactName: crash-reports
displayName: Publish crash reports on non-release branch
condition: and(failed(), eq(variables['ATOM_RELEASES_S3_KEY'], ''))
- script: >
node $(Build.SourcesDirectory)\script\vsts\upload-crash-reports.js --crash-report-path "%ARTIFACT_STAGING_DIR%\crash-reports" --s3-path "vsts-artifacts/%BUILD_ID%/"
env:
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
BUILD_ID: $(Build.BuildId)
displayName: Upload crash reports to S3 on release branch
condition: and(failed(), ne(variables['ATOM_RELEASES_S3_KEY'], ''))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-windows.zip
ArtifactName: atom-x64-windows.zip
ArtifactType: Container
displayName: Upload atom-x64-windows.zip
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['buildArch'], 'x64'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/AtomSetup-x64.exe
ArtifactName: AtomSetup-x64.exe
ArtifactType: Container
displayName: Upload AtomSetup-x64.exe
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-x64-$(ReleaseVersion)-full.nupkg
ArtifactName: $(AppName)-x64-$(ReleaseVersion)-full.nupkg
ArtifactType: Container
displayName: Upload $(AppName)-x64-$(ReleaseVersion)-full.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-x64-$(ReleaseVersion)-delta.nupkg
ArtifactName: $(AppName)-x64-$(ReleaseVersion)-delta.nupkg
ArtifactType: Container
displayName: Upload $(AppName)-x64-$(ReleaseVersion)-delta.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/RELEASES-x64
ArtifactName: RELEASES-x64
ArtifactType: Container
displayName: Upload RELEASES-x64
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-windows.zip
ArtifactName: atom-windows.zip
ArtifactType: Container
displayName: Upload atom-windows.zip
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['buildArch'], 'x86'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/AtomSetup.exe
ArtifactName: AtomSetup.exe
ArtifactType: Container
displayName: Upload AtomSetup.exe
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-$(ReleaseVersion)-full.nupkg
ArtifactName: $(AppName)-$(ReleaseVersion)-full.nupkg
ArtifactType: Container
displayName: Upload $(AppName)-$(ReleaseVersion)-full.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-$(ReleaseVersion)-delta.nupkg
ArtifactName: $(AppName)-$(ReleaseVersion)-delta.nupkg
ArtifactType: Container
displayName: Upload $(AppName)-$(ReleaseVersion)-delta.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/RELEASES
ArtifactName: RELEASES
ArtifactType: Container
displayName: Upload RELEASES
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
# Core renderer tests
- template: templates/test.yml

View File

@ -1,16 +1,8 @@
trigger: none # No CI builds, only PR builds
jobs:
- job: GetReleaseVersion
steps:
# This has to be done separately because VSTS inexplicably
# exits the script block after `npm install` completes.
- script: |
cd script\vsts
npm install
displayName: npm install
- script: node script\vsts\get-release-version.js
name: Version
# GetReleaseVersion
- template: platforms/templates/get-release-version.yml
# Import OS-specific build definitions
- template: platforms/windows.yml

View File

@ -5,16 +5,8 @@ trigger:
pr: none # no PR triggers
jobs:
- job: GetReleaseVersion
steps:
# This has to be done separately because VSTS inexplicably
# exits the script block after `npm install` completes.
- script: |
cd script\vsts
npm install
displayName: npm install
- script: node script\vsts\get-release-version.js
name: Version
# GetReleaseVersion
- template: platforms/templates/get-release-version.yml
# Import OS-specific build definitions.
- template: platforms/windows.yml
@ -23,11 +15,11 @@ jobs:
- job: UploadArtifacts
pool:
vmImage: vs2017-win2016
vmImage: 'ubuntu-latest'
dependsOn:
- GetReleaseVersion
- Windows
- Windows_RendererTests
- Linux
- macOS_tests
@ -37,19 +29,12 @@ jobs:
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
# This has to be done separately because VSTS inexplicably
# exits the script block after `npm install` completes.
- script: |
cd script\vsts
npm install
cd script/vsts
npm ci
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
displayName: npm install
displayName: npm ci
- task: DownloadBuildArtifacts@0
inputs:
@ -58,7 +43,7 @@ jobs:
displayName: Download Release Artifacts
- script: |
node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom-staging"
node $(Build.SourcesDirectory)/script/vsts/upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom-staging"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
@ -70,7 +55,7 @@ jobs:
condition: and(succeeded(), eq(variables['Atom.AutoDraftRelease'], 'true'), eq(variables['IsReleaseBranch'], 'true'))
- script: |
node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --assets-path "$(System.ArtifactsDirectory)" --s3-path "vsts-artifacts/$(Build.BuildId)/"
node $(Build.SourcesDirectory)/script/vsts/upload-artifacts.js --assets-path "$(System.ArtifactsDirectory)" --s3-path "vsts-artifacts/$(Build.BuildId)/"
env:
ATOM_RELEASE_VERSION: $(ReleaseVersion)
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)

View File

@ -12,6 +12,11 @@ const uploadLinuxPackages = require('./lib/upload-linux-packages');
const CONFIG = require('../config');
const REPO_OWNER = process.env.REPO_OWNER || 'atom';
const MAIN_REPO = process.env.MAIN_REPO || 'atom';
const NIGHTLY_RELEASE_REPO =
process.env.NIGHTLY_RELEASE_REPO || 'atom-nightly-releases';
const yargs = require('yargs');
const argv = yargs
.usage('Usage: $0 [options]')
@ -127,13 +132,13 @@ async function uploadArtifacts() {
? spawnSync('git', ['rev-parse', 'HEAD'])
.stdout.toString()
.trimEnd()
: 'master'; // Nightly tags are created in atom/atom-nightly-releases so the SHA is irrelevant
: 'master'; // Nightly tags are created in REPO_OWNER/NIGHTLY_RELEASE_REPO so the SHA is irrelevant
console.log(`Creating GitHub release v${releaseVersion}`);
const release = await publishReleaseAsync({
token: process.env.GITHUB_TOKEN,
owner: 'atom',
repo: !isNightlyRelease ? 'atom' : 'atom-nightly-releases',
owner: REPO_OWNER,
repo: !isNightlyRelease ? MAIN_REPO : NIGHTLY_RELEASE_REPO,
name: CONFIG.computedAppVersion,
notes: newReleaseNotes,
target_commitish: releaseSha,

View File

@ -5,7 +5,7 @@ const path = require('path');
const download = require('download');
const childProcess = require('child_process');
const nodeVersion = '12.13.1';
const nodeVersion = '12.4.0';
const nodeFileName = `node-v${nodeVersion}-win-x86`;
const extractedNodePath = `c:\\tmp\\${nodeFileName}`;

View File

@ -24,7 +24,7 @@ const ChromedriverPath = path.resolve(
'bin',
'chromedriver'
);
const ChromedriverPort = 9515;
const ChromedriverPort = 8082;
const ChromedriverURLBase = '/wd/hub';
const ChromedriverStatusURL = `http://localhost:${ChromedriverPort}${ChromedriverURLBase}/status`;
@ -68,8 +68,8 @@ const buildAtomClient = async (args, env) => {
host: 'localhost',
port: ChromedriverPort,
capabilities: {
browserName: 'atom',
chromeOptions: {
browserName: 'chrome', // Webdriverio will figure it out on it's own, but I will leave it in case it's helpful in the future https://webdriver.io/docs/configurationfile.html
'goog:chromeOptions': {
binary: AtomLauncherPath,
args: [
`atom-path=${AtomPath}`,

View File

@ -5,11 +5,13 @@ module.exports = function(params) {
const arch = os.arch();
const { uploadToServer, releaseChannel } = params;
const parsedUploadToServer = uploadToServer !== null ? uploadToServer : false;
crashReporter.start({
productName: 'Atom',
companyName: 'GitHub',
submitURL: 'https://atom.io/crash_reports',
uploadToServer,
parsedUploadToServer,
extra: { platformRelease, arch, releaseChannel }
});
};

View File

@ -49,7 +49,9 @@ module.exports = class AtomWindow extends EventEmitter {
// (Ref: https://github.com/atom/atom/pull/12696#issuecomment-290496960)
disableBlinkFeatures: 'Auxclick',
nodeIntegration: true,
webviewTag: true
webviewTag: true,
// multi-threading
nodeIntegrationInWorker: true
}
};

View File

@ -1,7 +1,7 @@
const { app } = require('electron');
const nslog = require('nslog');
const path = require('path');
const temp = require('temp').track();
const temp = require('temp');
const parseCommandLine = require('./parse-command-line');
const startCrashReporter = require('../crash-reporter-start');
const getReleaseChannel = require('../get-release-channel');

View File

@ -294,8 +294,8 @@ function registerBuiltins(devMode) {
const rendererBuiltins = [
'crash-reporter',
'ipc-renderer',
'remote',
'screen'
'remote'
// 'screen' Deprecated https://www.electronjs.org/docs/breaking-changes#api-changed-electronscreen-in-the-renderer-process-should-be-accessed-via-remote
];
for (const builtin of rendererBuiltins) {
cache.builtins[builtin] = path.join(rendererRoot, `${builtin}.js`);

View File

@ -419,9 +419,16 @@ module.exports = class PackageManager {
for (const packageDirPath of this.packageDirPaths) {
if (fs.isDirectorySync(packageDirPath)) {
// checks for directories.
// dirent is faster, but for checking symbolic link we need stat.
const packageNames = fs
.readdirSync(packageDirPath, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.filter(
dirent =>
dirent.isDirectory() ||
(dirent.isSymbolicLink() &&
fs.isDirectorySync(path.join(packageDirPath, dirent.name)))
)
.map(dirent => dirent.name);
for (const packageName of packageNames) {

View File

@ -881,8 +881,9 @@ module.exports = class Package {
requireMainModule() {
if (this.bundledPackage && this.packageManager.packagesCache[this.name]) {
if (this.packageManager.packagesCache[this.name].main) {
this.mainModule = require(this.packageManager.packagesCache[this.name]
.main);
this.mainModule = this._require(
this.packageManager.packagesCache[this.name].main
);
return this.mainModule;
}
} else if (this.mainModuleRequired) {
@ -904,7 +905,7 @@ module.exports = class Package {
const previousViewProviderCount = this.viewRegistry.getViewProviderCount();
const previousDeserializerCount = this.deserializerManager.getDeserializerCount();
this.mainModule = require(mainModulePath);
this.mainModule = this._require(mainModulePath);
if (
this.viewRegistry.getViewProviderCount() ===
previousViewProviderCount &&
@ -921,6 +922,27 @@ module.exports = class Package {
}
}
// a require function with both ES5 and ES6 default export support
_require(path) {
const modul = require(path);
if (modul === null || modul === undefined) {
// if null do not bother
return modul;
} else {
if (
modul.__esModule === true &&
typeof modul.default === 'object' &&
typeof modul.default.activate === 'function'
) {
// __esModule flag is true and the activate function exists inside it, which means
// an object containing the main functions (e.g. activate, etc) is default exported
return modul.default;
} else {
return modul;
}
}
}
getMainModulePath() {
if (this.resolvedMainModulePath) return this.mainModulePath;
this.resolvedMainModulePath = true;