Fix and improve CI build

This commit is contained in:
Alex Brazier 2017-07-18 22:42:23 +01:00
parent 253063d216
commit 544265383c
6 changed files with 4206 additions and 81 deletions

View file

@ -1,23 +1,31 @@
language: node_js
node_js: 7
cache:
yarn: true
directories:
- node_modules
matrix:
include:
- os: linux
dist: trusty
sudo: false
services:
- docker
script:
- docker run --rm -v ${PWD}:/project -e GH_TOKEN=${GH_TOKEN} -e TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} rocketchat/electron.builder /bin/bash -l -c "npm install && npm run release -- --x64 --ia32"
addons:
apt:
packages:
- rpm
- g++-multilib
- libxss-dev:i386
- os: osx
osx_image: xcode7.3.1
language: generic
node_js:
- '6'
before_script:
- chmod +x ./scripts/travis-build.sh
script: ./scripts/travis-build.sh
cache:
directories:
- node_modules
osx_image: xcode8.3
install:
- yarn
script:
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then export CSC_IDENTITY_AUTO_DISCOVERY=false; fi
- node --version
- yarn --version
- yarn release -- --x64 --ia32
branches:
only:

View file

@ -12,22 +12,31 @@ branches:
skip_tags: true
environment:
nodejs_version: "7"
cache:
- "%LOCALAPPDATA%/Yarn"
- node_modules -> package.json
- app/node_modules -> app/package.json
shallow_clone: true
clone_depth: 1
install:
- ps: Install-Product node 6 $env:platform
- npm install npm
- .\node_modules\.bin\npm install
- ps: Install-Product node $env:nodejs_version $env:platform
- set CI=true
- yarn
test_script:
- node --version
- .\node_modules\.bin\npm --version
# - .\node_modules\.bin\npm test
# - .\node_modules\.bin\npm run e2e
- yarn --version
# - yarn test
# - yarn e2e
build_script:
- npm run release -- --ia32 --x64
- yarn release -- --ia32 --x64
artifacts:
- path: 'dist\**\*.exe'

View file

@ -49,18 +49,17 @@
"deb",
"rpm"
]
},
"publish": [
{
"provider": "github",
"owner": "RocketChat",
"repo": "Rocket.Chat.Electron",
"vPrefixedTagName": false
}
]
},
"publish": [
{
"provider": "github",
"owner": "RocketChat",
"repo": "Rocket.Chat.Electron",
"vPrefixedTagName": false
}
]
},
"scripts": {
"postinstall": "install-app-deps && electron-rebuild",
"build": "gulp build",
"prerelease": "gulp build --env=production",
"release": "build",
@ -73,29 +72,33 @@
},
"dependencies": {
"@paulcbetts/system-idle-time": "^1.0.4",
"electron-updater": "^1.16.0",
"fs-jetpack": "^1.0.0",
"electron-updater": "^2.7.1",
"fs-jetpack": "^1.1.0",
"lodash": "^4.17.4",
"spellchecker": "^3.3.1"
"spellchecker": "^3.4.1"
},
"devDependencies": {
"chai": "^4.0.0",
"electron": "^1.6.10",
"electron-builder": "^18.0.1",
"electron-mocha": "^3.4.0",
"chai": "^4.1.0",
"electron": "^1.6.11",
"electron-builder": "^19.16.0",
"electron-mocha": "^4.0.0",
"electron-rebuild": "^1.5.11",
"gulp": "^3.9.1",
"gulp-batch": "^1.0.5",
"gulp-less": "^3.3.0",
"gulp-less": "^3.3.2",
"gulp-plumber": "^1.1.0",
"gulp-util": "^3.0.8",
"gulp-watch": "^4.3.11",
"istanbul": "^0.4.5",
"minimist": "^1.2.0",
"mocha": "^3.4.2",
"rollup": "^0.41.6",
"rollup": "^0.45.2",
"rollup-plugin-istanbul": "^1.1.0",
"source-map-support": "^0.4.15",
"spectron": "^3.7.1"
"spectron": "^3.7.2"
},
"devEngines": {
"node": ">=7.x",
"npm": ">=4.x",
"yarn": ">=0.21.3"
}
}

View file

@ -1,24 +0,0 @@
#!/usr/bin/env bash
# git clone https://github.com/creationix/nvm.git /tmp/.nvm
# source /tmp/.nvm/nvm.sh
# nvm install "$NODE_VERSION"
# nvm use --delete-prefix "$NODE_VERSION"
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3
fi
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
# Disable macOS code signing on PR
export CSC_IDENTITY_AUTO_DISCOVERY=false
fi
node --version
npm --version
npm install
# npm test & npm run e2e
npm run release -- --ia32 --x64

View file

@ -33,21 +33,24 @@ module.exports = function (src, dest, opts) {
cache: cached[src],
plugins: opts.rollupPlugins,
})
.then(function (bundle) {
cached[src] = bundle;
.then(function (bundle) {
cached[src] = bundle;
var jsFile = path.basename(dest);
var result = bundle.generate({
format: 'cjs',
sourceMap: true,
sourceMapFile: jsFile,
var jsFile = path.basename(dest);
return bundle.generate({
format: 'cjs',
sourceMap: true,
sourceMapFile: jsFile,
});
})
.then(function (result) {
// Wrap code in self invoking function so the variables don't
// pollute the global namespace.
var isolatedCode = '(function () {' + result.code + '\n}());';
var jsFile = path.basename(dest);
return Promise.all([
jetpack.writeAsync(dest, isolatedCode + '\n//# sourceMappingURL=' + jsFile + '.map'),
jetpack.writeAsync(dest + '.map', result.map.toString()),
]);
});
// Wrap code in self invoking function so the variables don't
// pollute the global namespace.
var isolatedCode = '(function () {' + result.code + '\n}());';
return Promise.all([
jetpack.writeAsync(dest, isolatedCode + '\n//# sourceMappingURL=' + jsFile + '.map'),
jetpack.writeAsync(dest + '.map', result.map.toString()),
]);
});
};

4126
yarn.lock Normal file

File diff suppressed because it is too large Load diff