From a6445235f48d6f21fe52b7924239aa97421b2531 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 10:57:31 -0800 Subject: [PATCH 1/7] Allow macOS signing cert to be specified by ATOM_MAC_CODE_SIGNING_CERT_PATH --- script/lib/code-sign-on-mac.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/script/lib/code-sign-on-mac.js b/script/lib/code-sign-on-mac.js index 80d316566..c496fbf6d 100644 --- a/script/lib/code-sign-on-mac.js +++ b/script/lib/code-sign-on-mac.js @@ -5,15 +5,17 @@ const path = require('path') const spawnSync = require('./spawn-sync') module.exports = function (packagedAppPath) { - if (!process.env.ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL) { + if (!process.env.ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL && !process.env.ATOM_MAC_CODE_SIGNING_CERT_PATH) { console.log('Skipping code signing because the ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL environment variable is not defined'.gray) return } - try { - const certPath = path.join(os.tmpdir(), 'mac.p12') + let certPath = process.env.ATOM_MAC_CODE_SIGNING_CERT_PATH; + if (!certPath) { + certPath = path.join(os.tmpdir(), 'mac.p12') downloadFileFromGithub(process.env.ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath) - + } + try { console.log(`Unlocking keychain ${process.env.ATOM_MAC_CODE_SIGNING_KEYCHAIN}`) const unlockArgs = ['unlock-keychain'] // For signing on local workstations, password could be entered interactively @@ -38,7 +40,9 @@ module.exports = function (packagedAppPath) { '--sign', 'Developer ID Application: GitHub', packagedAppPath ], {stdio: 'inherit'}) } finally { - console.log(`Deleting certificate at ${certPath}`) - fs.removeSync(certPath) + if (!process.env.ATOM_MAC_CODE_SIGNING_CERT_PATH) { + console.log(`Deleting certificate at ${certPath}`) + fs.removeSync(certPath) + } } } From b931c925d583ec4c44ee5e92a58dffd74471104d Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 10:59:34 -0800 Subject: [PATCH 2/7] Allow Windows signing cert to be specified by ATOM_WIN_CODE_SIGNING_CERT_PATH --- script/lib/create-windows-installer.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/script/lib/create-windows-installer.js b/script/lib/create-windows-installer.js index 4b9e0f3a3..ecc3c5dd5 100644 --- a/script/lib/create-windows-installer.js +++ b/script/lib/create-windows-installer.js @@ -22,11 +22,14 @@ module.exports = function (packagedAppPath, codeSign) { setupIcon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico') } - const certPath = path.join(os.tmpdir(), 'win.p12') - const signing = codeSign && process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL + const signing = codeSign && (process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL || process.env.ATOM_WIN_CODE_SIGNING_CERT_PATH) + let certPath = ATOM_WIN_CODE_SIGNING_CERT_PATH; + if (!certPath) { + certPath = path.join(os.tmpdir(), 'win.p12') + downloadFileFromGithub(process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath) + } if (signing) { - downloadFileFromGithub(process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath) var signParams = [] signParams.push(`/f ${certPath}`) // Signing cert file signParams.push(`/p ${process.env.ATOM_WIN_CODE_SIGNING_CERT_PASSWORD}`) // Signing cert password @@ -39,7 +42,7 @@ module.exports = function (packagedAppPath, codeSign) { } const cleanUp = function () { - if (fs.existsSync(certPath)) { + if (fs.existsSync(certPath) && !process.env.ATOM_WIN_CODE_SIGNING_CERT_PATH) { console.log(`Deleting certificate at ${certPath}`) fs.removeSync(certPath) } From e4362aa1b9cafa320ca681c3e82157189e1787d0 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 11:03:05 -0800 Subject: [PATCH 3/7] Update Circle node version --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index ee4eafc1f..c264754d4 100644 --- a/circle.yml +++ b/circle.yml @@ -16,8 +16,8 @@ general: dependencies: pre: - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash - - nvm install 4.4.7 - - nvm use 4.4.7 + - nvm install 6.9.4 + - nvm use 6.9.4 - npm install -g npm override: From 6f6865f9cd13df21be14e6a8fffc5412a97966d2 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 11:10:36 -0800 Subject: [PATCH 4/7] Don't download cert on Windows unless we're signing --- script/lib/create-windows-installer.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/lib/create-windows-installer.js b/script/lib/create-windows-installer.js index ecc3c5dd5..000ab976e 100644 --- a/script/lib/create-windows-installer.js +++ b/script/lib/create-windows-installer.js @@ -24,12 +24,13 @@ module.exports = function (packagedAppPath, codeSign) { const signing = codeSign && (process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL || process.env.ATOM_WIN_CODE_SIGNING_CERT_PATH) let certPath = ATOM_WIN_CODE_SIGNING_CERT_PATH; - if (!certPath) { - certPath = path.join(os.tmpdir(), 'win.p12') - downloadFileFromGithub(process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath) - } if (signing) { + if (!certPath) { + certPath = path.join(os.tmpdir(), 'win.p12') + downloadFileFromGithub(process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL, certPath) + } + var signParams = [] signParams.push(`/f ${certPath}`) // Signing cert file signParams.push(`/p ${process.env.ATOM_WIN_CODE_SIGNING_CERT_PASSWORD}`) // Signing cert password From dcaadb8870437c2ba60c880ea5e2236bdce561ec Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 11:15:46 -0800 Subject: [PATCH 5/7] Upgrade Node on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5918dc8d..fa5636d17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ git: matrix: include: - os: linux - env: NODE_VERSION=4.4.7 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1 + env: NODE_VERSION=6.9.4 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1 sudo: false From c7bc416ceaf4a585a56fb393c7e23ae4d0ca4bc7 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 11:25:43 -0800 Subject: [PATCH 6/7] Require Node 6 for building --- docs/build-instructions/linux.md | 2 +- docs/build-instructions/macOS.md | 2 +- docs/build-instructions/windows.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build-instructions/linux.md b/docs/build-instructions/linux.md index 5f0211c0d..1caf740ba 100644 --- a/docs/build-instructions/linux.md +++ b/docs/build-instructions/linux.md @@ -7,7 +7,7 @@ Ubuntu LTS 12.04 64-bit is the recommended platform. * OS with 64-bit or 32-bit architecture * C++11 toolchain * Git -* Node.js 4.4.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm)) +* Node.js 6.x (we recommend installing it via [nvm](https://github.com/creationix/nvm)) * npm 3.10.x or later (run `npm install -g npm`) * Ensure node-gyp uses python2 (run `npm config set python /usr/bin/python2 -g`, use `sudo` if you didn't install node via nvm) * Development headers for [GNOME Keyring](https://wiki.gnome.org/Projects/GnomeKeyring). diff --git a/docs/build-instructions/macOS.md b/docs/build-instructions/macOS.md index 18169435f..0d9335eea 100644 --- a/docs/build-instructions/macOS.md +++ b/docs/build-instructions/macOS.md @@ -3,7 +3,7 @@ ## Requirements * macOS 10.8 or later - * Node.js 4.4.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm)) + * Node.js 6.x (we recommend installing it via [nvm](https://github.com/creationix/nvm)) * npm 3.10.x or later (run `npm install -g npm`) * Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install) diff --git a/docs/build-instructions/windows.md b/docs/build-instructions/windows.md index 5c8c189ef..2c231b2dc 100644 --- a/docs/build-instructions/windows.md +++ b/docs/build-instructions/windows.md @@ -2,7 +2,7 @@ ## Requirements -* Node.js 4.4.x or later (the architecture of node available to the build system will determine whether you build 32-bit or 64-bit Atom) +* Node.js 6.x (the architecture of node available to the build system will determine whether you build 32-bit or 64-bit Atom) * Python v2.7.x * The python.exe must be available at `%SystemDrive%\Python27\python.exe`. If it is installed elsewhere create a symbolic link to the directory containing the python.exe using: `mklink /d %SystemDrive%\Python27 D:\elsewhere\Python27` * 7zip (7z.exe available from the command line) - for creating distribution zip files From 1b6394955be13c3b3111ff8ce077f1133d7b6bf2 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 25 Jan 2017 11:47:31 -0800 Subject: [PATCH 7/7] :keyboard: Fix typo --- script/lib/create-windows-installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/create-windows-installer.js b/script/lib/create-windows-installer.js index 000ab976e..ae123c319 100644 --- a/script/lib/create-windows-installer.js +++ b/script/lib/create-windows-installer.js @@ -23,7 +23,7 @@ module.exports = function (packagedAppPath, codeSign) { } const signing = codeSign && (process.env.ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL || process.env.ATOM_WIN_CODE_SIGNING_CERT_PATH) - let certPath = ATOM_WIN_CODE_SIGNING_CERT_PATH; + let certPath = process.env.ATOM_WIN_CODE_SIGNING_CERT_PATH; if (signing) { if (!certPath) {