ci: use Node 8.2.1 to build binary on Windows CI #1390 (#1391)

* ci: use Node 8.2.1 to build binary on Windows CI #1390

* use Node 8.2.1 on Mac buildkite

* add comment

* source bashrc

* print home folder

* do not source bashrc

* install nvm using curl

* back to nvm using bash_profile

* hmm, maybe it is using different shell

* hmm, login into bash

* remove nvm commands

* chore: add script to check Node version against .node-version
This commit is contained in:
Gleb Bahmutov
2018-02-28 15:37:43 -05:00
committed by GitHub
parent 518c4014bd
commit 586d677b3d
5 changed files with 30 additions and 3 deletions
+4
View File
@@ -6,7 +6,11 @@ env:
steps:
- label: "install tools"
command:
# assuming we have installed the same Node.js version
# as the one included in Electron
- "node --version"
# make sure we are using correct version of Node to build
- "npm run check-node-version"
- "npm --version"
- "security find-identity -p codesigning"
- "security list-keychains"
+3 -2
View File
@@ -5,9 +5,9 @@ branches:
- /win*/
# https://www.appveyor.com/docs/lang/nodejs-iojs/
# Test against the latest version of this Node.js version
environment:
nodejs_version: "6"
# Test against the same version of Node.js version as included in Electron
nodejs_version: "8.2.1"
# encode secure variables which will NOT be used
# in pull requests
# https://www.appveyor.com/docs/build-configuration/#secure-variables
@@ -34,6 +34,7 @@ environment:
# Install scripts. (runs after repo cloning)
install:
- ps: Install-Product node $env:nodejs_version
- npm run check-node-version
# NPM v3 has flaky permission issues on Windows
- npm install -g npm@5
- npm install -g @bahmutov/print-env
+1
View File
@@ -22,6 +22,7 @@ jobs:
- run:
name: print global NPM cache path
command: echo $(npm -g bin)
- run: npm run check-node-version
## make sure the TERM is set to 'xterm' in node
## else colors (and tests) will fail
+2 -1
View File
@@ -41,7 +41,8 @@
"binary-release": "node ./scripts/binary.js release",
"test-scripts": "mocha --reporter spec scripts/unit/*spec.js",
"test-mocha": "mocha --reporter spec scripts/spec.js",
"test-mocha-snapshot": "mocha scripts/mocha-snapshot-spec.js"
"test-mocha-snapshot": "mocha scripts/mocha-snapshot-spec.js",
"check-node-version": "node scripts/check-node-version.js"
},
"lint-staged": {
"*.js": [
+20
View File
@@ -0,0 +1,20 @@
// TODO make this check a 3rd party little tool
// we want to ensure we are building using the same major version
// as the one specified in ../.node-version file
const read = require('fs').readFileSync
const join = require('path').join
const nodeVersionNeededString = read(join(__dirname, '..', '.node-version'), 'utf8')
const nodeVersionNeeded = nodeVersionNeededString.split('.')
const nodeVersion = process.versions.node.split('.')
// check just major version for now
if (nodeVersionNeeded[0] !== nodeVersion[0]) {
/* eslint-disable no-console */
console.error('🛑 .node-version specified %s', nodeVersionNeededString)
console.error('but current Node is %s', process.versions.node)
/* eslint-enable no-console */
process.exit(1)
}