diff --git a/.travis.yml b/.travis.yml index 9964482f7..00a1df5e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,22 +10,18 @@ matrix: - os: osx osx_image: xcode9.0 - os: linux - sudo: false + sudo: required dist: trusty group: stable addons: apt: packages: - - bsdtar - - g++-multilib - - gcc-multilib - gnome-keyring - - icnsutils - libgnome-keyring-dev - libsecret-1-dev - python-gnomekeyring - - rpm - - xz-utils + services: + - docker env: global: - ELECTRON_CACHE=$HOME/.cache/electron @@ -36,6 +32,7 @@ cache: - node_modules - $HOME/.cache/electron - $HOME/.cache/electron-builder + - $HOME/.cache/snapcraft before_install: - pip install --user awscli ; export PATH=$PATH:$HOME/.local/bin - | @@ -51,7 +48,20 @@ install: - npm install script: - npm run app:dist - - npm run electron-builder:release + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm run electron-builder:release:x64; fi + - | + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + docker run --rm -ti \ + --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \ + --env ELECTRON_CACHE="/root/.cache/electron" \ + --env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \ + -v ${PWD}:/project \ + -v ~/.cache/electron:/root/.cache/electron \ + -v ~/.cache/electron-builder:/root/.cache/electron-builder \ + -v ~/.cache/snapcraft:/root/.cache/snapcraft \ + electronuserland/builder:8 \ + /bin/bash -c "apt-get update && apt-get install libsecret-1-dev -y && npm run electron-builder:release:x64:linux" + fi after_failure: - $(git ls-files -o | grep -Fv -e node_modules -e app -e dist >> failure-files.list) - find /home/travis/.npm/_logs/*.log >> failure-files.list diff --git a/README.md b/README.md index 7f6b3a290..4670bbd1d 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,17 @@ is an unofficial [ProtonMail](https://protonmail.com/) desktop client. It's basi - Run `nvm use 8`. - [keytar](https://github.com/atom/node-keytar) module requires compiling prebuild node files and for that Python and C++ compiler need to be installed on your system: - **`On Windows`**: the simplest way to install all the needed stuff on Windows is to run `npm install --global --production windows-build-tools` CLI command. - - **`On Linux`**: `python v2.7`, `make` and a C/C++ compiler toolchain, like `GCC` are most likely already installed. + - **`On Linux`**: `python v2.7`, `make` and a C/C++ compiler toolchain, like `GCC` are most likely already installed. Besides there is a need to install `libsecret` dependency, see `Installing` section [here](https://github.com/atom/node-keytar). - **`On Mac OS X`**: `python v2.7` and [Xcode](https://developer.apple.com/xcode/download/) need to be installed. You also need to install the `Command Line Tools` via Xcode, can be found under the `Xcode -> Preferences -> Downloads` menu. - [Clone](https://help.github.com/articles/cloning-a-repository/) this project to your local device. If you are going to contribute, consider cloning the [forked](https://help.github.com/articles/fork-a-repo/) into your own GitHub account project. - Install dependencies running `npm install`. - Build app running `npm run app:dist`. It's better to not touch a mouse during the process, since it might interfere with the `e2e` tests running at the end of the process. -- Build the final Electron binary running `npm run electron-builder:dist`. Outcome will be placed under the `./dist` folder. +- Build a package to install running `npm run electron-builder:dist` command to build Windows/Mac OS X package and one of the following commands to build Linux package: + - `electron-builder:dist:linux:appimage` + - `electron-builder:dist:linux:deb` + - `electron-builder:dist:linux:freebsd` + - `electron-builder:dist:linux:pacman` + - `electron-builder:dist:linux:rpm` + - `electron-builder:dist:linux:snap` +- If you don't need a package to install, but a folder to execute app from, simply run `electron-builder:dir` command. +- Outcome, whether it's a folder or package to install, comes into the `./dist` folder. diff --git a/appveyor.yml b/appveyor.yml index 924213229..ff1b21562 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,4 +24,4 @@ build_script: - node --version - npm --version - npm run app:dist - - npm run electron-builder:release + - npm run electron-builder:release:x64 diff --git a/electron-builder.yml b/electron-builder.yml index df055a9a5..2527e0f7c 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -21,8 +21,8 @@ files: [ "!node_modules/stacktrace-gps/dist", "!node_modules/stacktrace-js/dist", ] -asar: true compression: maximum +asar: true mac: icon: ./app/assets/icons/mac/icon.icns @@ -39,12 +39,8 @@ linux: icon: ./app/assets/icons/png category: Office packageCategory: Office - target: - - {target: AppImage} - - {target: deb} - - {target: freebsd} - - {target: pacman} - - {target: rpm} + asarUnpack: + - "**/node_modules/sodium-native/**/*" win: artifactName: ${name}-${version}-windows-${arch}.${ext} diff --git a/package.json b/package.json index c65e67807..97eddc706 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,15 @@ "postinstall:cross-os": "cross-os 7zip-bin", "electron-builder:dir": "electron-builder --dir", "electron-builder:dist": "electron-builder", - "electron-builder:release": "electron-builder -p onTagOrDraft --x64", + "electron-builder:dist:linux": "electron-builder --linux AppImage deb freebsd pacman rpm snap", + "electron-builder:dist:linux:appimage": "electron-builder --linux AppImage", + "electron-builder:dist:linux:deb": "electron-builder --linux deb", + "electron-builder:dist:linux:freebsd": "electron-builder --linux freebsd", + "electron-builder:dist:linux:pacman": "electron-builder --linux pacman", + "electron-builder:dist:linux:rpm": "electron-builder --linux rpm", + "electron-builder:dist:linux:snap": "electron-builder --linux snap", + "electron-builder:release:x64": "electron-builder -p onTagOrDraft --x64", + "electron-builder:release:x64:linux": "electron-builder -p onTagOrDraft --x64 --linux AppImage deb freebsd pacman rpm snap", "dist": "npm-run-all app:build electron-builder:dist", "app:dist": "cross-env NODE_ENV=production npm-run-all lint test:electron:main app:clean app:compile app:assets test:e2e", "app:clean": "rimraf ./app/", @@ -64,7 +72,7 @@ "deep-equal": "1.0.1", "electron-log": "2.2.13", "electron-unhandled": "1.0.0", - "electron-updater": "2.18.0", + "electron-updater": "2.18.2", "fs-json-store": "1.0.0", "fs-json-store-encryption-adapter": "0.0.2", "jimp": "0.2.28", @@ -77,17 +85,17 @@ }, "devDependencies": { "@angular-devkit/build-optimizer": "0.0.36", - "@angular/animations": "5.1.2", - "@angular/common": "5.1.2", - "@angular/compiler": "5.1.2", - "@angular/compiler-cli": "5.1.2", - "@angular/core": "5.1.2", - "@angular/forms": "5.1.2", - "@angular/http": "5.1.2", - "@angular/language-service": "5.1.2", - "@angular/platform-browser": "5.1.2", - "@angular/platform-browser-dynamic": "5.1.2", - "@angular/router": "5.1.2", + "@angular/animations": "5.1.3", + "@angular/common": "5.1.3", + "@angular/compiler": "5.1.3", + "@angular/compiler-cli": "5.1.3", + "@angular/core": "5.1.3", + "@angular/forms": "5.1.3", + "@angular/http": "5.1.3", + "@angular/language-service": "5.1.3", + "@angular/platform-browser": "5.1.3", + "@angular/platform-browser-dynamic": "5.1.3", + "@angular/router": "5.1.3", "@angularclass/hmr": "2.1.3", "@ngrx/effects": "4.1.1", "@ngrx/router-store": "4.1.1", @@ -96,15 +104,15 @@ "@types/keytar": "4.0.1", "@types/lodash.pick": "4.4.3", "@types/mkdirp": "0.5.2", - "@types/node": "8.5.2", + "@types/node": "8.5.7", "@types/randomstring": "1.1.6", "@types/sinon": "4.1.2", "@types/stacktrace-js": "0.0.32", "@types/valid-url": "1.0.2", "@types/webdriverio": "4.8.7", - "@types/webpack": "3.8.1", + "@types/webpack": "3.8.2", "@types/webpack-env": "1.13.3", - "autoprefixer": "7.2.3", + "autoprefixer": "7.2.4", "ava": "0.24.0", "ava-ts": "0.23.0", "awesome-typescript-loader": "3.4.1", @@ -115,12 +123,12 @@ "cross-env": "5.1.3", "cross-os": "1.2.2", "cross-spawn": "5.1.0", - "css-loader": "0.28.7", + "css-loader": "0.28.8", "cssnano": "3.10.0", "devtron": "1.4.0", "electron": "1.8.2-beta.3", - "electron-builder": "19.50.0", - "electron-builder-squirrel-windows": "19.50.0", + "electron-builder": "19.52.1", + "electron-builder-squirrel-windows": "19.52.0", "electron-rebuild": "1.6.0", "exports-loader": "0.6.4", "extended-define-webpack-plugin": "0.1.3", @@ -128,7 +136,7 @@ "file-loader": "1.1.6", "font-awesome": "4.7.0", "gulp": "3.9.1", - "html-loader": "0.5.1", + "html-loader": "0.5.4", "html-webpack-plugin": "2.30.1", "less-loader": "4.0.5", "mkdirp": "0.5.1", @@ -136,7 +144,7 @@ "node-sass": "4.7.2", "npm-run-all": "4.1.2", "postcss-custom-properties": "6.2.0", - "postcss-loader": "2.0.9", + "postcss-loader": "2.0.10", "postcss-url": "7.3.0", "pre-commit": "1.2.2", "ps-tree": "1.1.0", @@ -156,15 +164,15 @@ "stylus-loader": "3.0.1", "to-string-loader": "1.1.5", "ts-node": "4.1.0", - "tsconfig-paths": "2.6.0", + "tsconfig-paths": "2.7.3", "tslint": "5.8.0", "tslint-rules-bunch": "0.0.3", "typescript": "2.6.2", - "uglifyjs-webpack-plugin": "1.1.5", + "uglifyjs-webpack-plugin": "1.1.6", "url-loader": "0.6.2", "wait-on": "2.0.2", "webpack": "3.10.0", - "webpack-dev-server": "2.9.7", + "webpack-dev-server": "2.10.0", "webpack-merge": "4.1.1", "webpack-split-by-path": "2.0.0", "zone.js": "0.8.19"