Speed up CI builds, rewrite package.json scripts

上级 ad53463c
......@@ -11,20 +11,28 @@ matrix:
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libc6-dev-i386 gcc-multilib g++-multilib ; fi
- "if [[ \"$TRAVIS_OS_NAME\" == \"linux\" ]]; then curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash; fi"
- sudo npm install -g snyk
before_script:
- npm install snyk
- npm install
- snyk auth $SNYK_TOKEN
- snyk protect
- snyk test
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then fossa init && fossa; fi
- mkdir prebuild-src
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then cp -R src/ prebuild-src; fi
- if [[ "$TRAVIS_OS_NAME == "windows" ]]; then xcopy src\\* prebuild-src\\ /E /C /Q /Y; fi
- node prebuild-minify.js
- cd prebuild-src
- npm install
- snyk protect
- snyk test
- cd ..
script:
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then npm run test ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm run build-darwin ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then npm run build-linux ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then npm run build-windows ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./node_modules/.bin/electron-builder build -l -p never ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./node_modules/.bin/electron-builder build -m -p never ; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then node_modules\\.bin\\electron-builder build -w -p never ; fi
deploy:
skip_cleanup: true
......
......@@ -96,15 +96,14 @@ on Windows:
- clone the repository
- `npm run install-windows`
- `npm start`
#### Building
Note: Due to native modules, you can only compile binaries for the OS you are compiling from.
Note²: It is recommended to start building from a fresh clone to prevent the code minifier script from parsing an entire `node_modules` folder.
- make a fresh clone (recommended)
- `npm install` (NOT `install-linux` or `install-windows`)
- `npm run build-linux` or `build-windows` or `build-darwin`
Resulting binaries and assets will be in the `dist` folder.
The script will minify the source code, recompile native dependencies and create distributable assets in the `dist` folder.
#### A note about versioning, branches, and commit messages
Currently, development is done directly on the `master` branch. The version tag on this branch is the version tag of the next release with the `-pre` suffix (e.g `v2.6.1-pre`), to avoid confusion when both release and source versions are installed on one's system.
......
......@@ -17,12 +17,12 @@
"install-linux": "npm install && cd src && npm install && ./../node_modules/.bin/electron-rebuild -f -w node-pty && cd ..",
"preinstall-windows": "npm install --global --production windows-build-tools && npm install --global node-gyp && setx PYTHON \"%USERPROFILE%\\.windows-build-tools\\python27\\python.exe\"",
"install-windows": "npm install && cd src && npm install && ..\\node_modules\\.bin\\electron-rebuild -f -w node-pty && cd ..",
"prebuild-linux": "mkdir prebuild-src && cp -Rv src/* prebuild-src/ && node prebuild-minify.js && cd prebuild-src && npm install",
"prebuild-darwin": "mkdir prebuild-src && cp -Rv src/* prebuild-src/ && node prebuild-minify.js && cd prebuild-src && npm install",
"prebuild-windows": "mkdir prebuild-src && xcopy src\\* prebuild-src\\ /E /C /Q /Y && node prebuild-minify.js && cd prebuild-src && npm install",
"prebuild-linux": "rsync -a --info=progress2 src/ prebuild-src --exclude node_modules && node prebuild-minify.js && cd prebuild-src && npm install",
"prebuild-darwin": "rsync -a src/ prebuild-src --exclude node_modules && node prebuild-minify.js && cd prebuild-src && npm install",
"prebuild-windows": "rmdir /S /Q src\\node_modules && mkdir prebuild-src && xcopy src\\* prebuild-src\\ /E /C /Q /Y && node prebuild-minify.js && cd prebuild-src && npm install",
"build-linux": "./node_modules/.bin/electron-builder build -l -p never",
"build-darwin": "./node_modules/.bin/electron-builder build -m -p never",
"build-windows": "node_modules\\.bin\\electron-builder -w -p never",
"build-windows": "node_modules\\.bin\\electron-builder build -w -p never",
"postbuild-linux": "rm -R prebuild-src",
"postbuild-darwin": "rm -R prebuild-src",
"postbuild-windows": "rmdir /S /Q prebuild-src",
......
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.3
ignore: {}
patch: {}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册