Skip to content

Commit

Permalink
disable feature toggles and bump 2.0.0-beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Dec 1, 2018
1 parent 1bd0ad1 commit 6eaa8a1
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 79 deletions.
75 changes: 38 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,57 @@

branches:
only:
- master
- master
- 2.0.0
language: node_js
node_js: 10
addons:
firefox: latest
matrix:
include:
- os: osx
osx_image: xcode9.0
- os: linux
sudo: required
dist: trusty
group: stable
addons:
apt:
packages:
- gnome-keyring
- libgnome-keyring-dev
- libsecret-1-dev
- python-gnomekeyring
- nasm
services:
- docker
- os: osx
osx_image: xcode9.0
- os: linux
sudo: required
dist: trusty
group: stable
addons:
apt:
packages:
- gnome-keyring
- libgnome-keyring-dev
- libsecret-1-dev
- python-gnomekeyring
- nasm
services:
- docker
env:
global:
- CI=true
- NO_AT_BRIDGE=1
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- FAILURE_ARCHIVE_FILE=travis-build-id-$TRAVIS_BUILD_ID.tar.gz
- MOZ_HEADLESS=1
- CI=true
- NO_AT_BRIDGE=1
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- FAILURE_ARCHIVE_FILE=travis-build-id-$TRAVIS_BUILD_ID.tar.gz
- MOZ_HEADLESS=1
cache: false
install:
- yarn --pure-lockfile install
- yarn generate-npm-lockfile
- npm audit
- yarn --pure-lockfile install
- yarn generate-npm-lockfile
- npm audit
before_script:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3;
eval $(dbus-launch --sh-syntax);
eval $(echo -n "" | /usr/bin/gnome-keyring-daemon --login);
eval $(/usr/bin/gnome-keyring-daemon --components=secrets --start);
/usr/bin/python -c "import gnomekeyring;gnomekeyring.create_sync('login', '');";
fi
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3;
eval $(dbus-launch --sh-syntax);
eval $(echo -n "" | /usr/bin/gnome-keyring-daemon --login);
eval $(/usr/bin/gnome-keyring-daemon --components=secrets --start);
/usr/bin/python -c "import gnomekeyring;gnomekeyring.create_sync('login', '');";
fi
script: ./scripts/travis.sh
after_failure:
- $(git ls-files -o | grep -Fv -e node_modules -e app -e dist >> failure-files.list)
- tar cvzf $FAILURE_ARCHIVE_FILE $(cat failure-files.list)
- aws --endpoint=$AWS_ENDPOINT_URL s3 cp $FAILURE_ARCHIVE_FILE s3://$AWS_BUCKET
- $(git ls-files -o | grep -Fv -e node_modules -e app -e dist >> failure-files.list)
- tar cvzf $FAILURE_ARCHIVE_FILE $(cat failure-files.list)
- aws --endpoint=$AWS_ENDPOINT_URL s3 cp $FAILURE_ARCHIVE_FILE s3://$AWS_BUCKET
notifications:
email:
on_success: never
Expand Down
92 changes: 73 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,80 @@
# http://www.appveyor.com/docs/appveyor-yml

# TODO share artifacts properly, track the following issues resolving:
# - https://github.com/appveyor/ci/issues/2438
# - https://github.com/appveyor/ci/issues/1623

branches:
only:
- master
- master
- 2.0.0
skip_tags: true
os: unstable
image:
# WARN "image" items ordering matters
- Ubuntu1804
- Visual Studio 2017
platform:
- x64
cache: false
- x64
build: off
test: off
install:
# - ps: Install-Product node $env:nodejs_version $env:platform
- ps: Install-Product node 10 $env:platform
- SET CI=true
- npm install --global yarn
- set PATH=%PATH%;C:\.yarn\bin
- node --version
- npm --version
- yarn --version
- yarn install --pure-lockfile --mutex file
- yarn generate-npm-lockfile
- npm audit
build_script:
- yarn run app:dist
- yarn run electron-builder:publish:x64
cache: false
matrix:
fast_finish: true
environment:
nodejs_version: 10
linuxJobNamePattern: 'image: Ubuntu1804'
linuxJobArtifactFile: 'app.zip'
for:
- matrix:
only:
- image: Ubuntu1804
install:
- sudo apt-get --yes install gnome-keyring libgnome-keyring-dev libsecret-1-dev nasm
- cmd: powershell Install-Product node $env:nodejs_version
- nvm install $nodejs_version
- npm install --global yarn
- node --version
- npm --version
- yarn install --pure-lockfile
build_script:
- yarn run assets:protonmail-webclient
- zip -r $linuxJobArtifactFile ./app
- ls
- appveyor PushArtifact $linuxJobArtifactFile
- matrix:
only:
- image: Visual Studio 2017
install:
- ps: Install-Product node $env:nodejs_version
- SET CI=true
- npm install --global yarn
- set PATH=%PATH%;C:\.yarn\bin
- node --version
- npm --version
- yarn --version
- yarn install --pure-lockfile --mutex file
- yarn generate-npm-lockfile
- npm audit
build_script:
- ps: |
$headers = @{
"Authorization" = "Bearer $EMAIL_SECURELY_APP_APPVEYOR_API_KEY"
"Content-type" = "application/json"
}
$project = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Headers $headers -Method GET
$linuxJob = $project.build.jobs | where {$_.name -eq $env:linuxJobNamePattern}
$linuxJobId = $linuxJob.jobId;
$linuxJobCompleted = $linuxJob.status -eq "success"
if (!$linuxJobCompleted) {
throw "Job `"$env:linuxJobNamePattern`" has been finished with `"$linuxJob.status`" status"
}
if (!$linuxJobId) {
throw "Failed to resolve i`"$env:linuxJobNamePattern`" job id"
}
Start-FileDownload https://ci.appveyor.com/api/buildjobs/$linuxJobId/artifacts/$env:linuxJobArtifactFile
7z.exe x $env:linuxJobArtifactFile
- yarn run app:dist
- yarn run electron-builder:publish:x64
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ artifactName: ${name}-${version}-${os}-${arch}.${ext}

publish: {provider: github, releaseType: draft, vPrefixedTagName: true}
forceCodeSigning: false
generateUpdatesFilesForAllChannels: true

# TODO consider moving fully bundable "dependencies" to "devDependencies" to reduce final package size

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "email-securely-app",
"description": "Unofficial desktop app for E2E encrypted email providers",
"version": "1.5.5",
"version": "2.0.0-beta.8",
"author": "Vladimir Yakovlev <[email protected]>",
"license": "MIT",
"homepage": "https://github.com/vladimiry/email-securely-app",
Expand All @@ -13,7 +13,7 @@
"scripts": {
"generate-npm-lockfile": "synp --source-file yarn.lock",
"precommit": "lint-staged",
"app:dist": "npm-run-all lint test:electron-main test:web build assets electron-builder:install-app-deps test:e2e",
"app:dist": "npm-run-all lint test:electron-main test:web build assets assets:protonmail-webclient electron-builder:install-app-deps test:e2e",
"build": "npm-run-all build:electron-main build:electron-preload build:web",
"build:dev": "cross-env NODE_ENV=development npm-run-all build",
"build:electron-main": "webpack --config ./src/webpack/electron-main.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/electron-main/app-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import logger from "electron-log";
import {autoUpdater} from "electron-updater";

export function initAutoUpdate() {
autoUpdater.channel = "beta";
autoUpdater.allowDowngrade = false;
autoUpdater.logger = logger;
autoUpdater.checkForUpdatesAndNotify();
}
5 changes: 0 additions & 5 deletions src/electron-main/web-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {URL} from "url";

import {BuildEnvironment} from "src/shared/model/common";
import {Context} from "./model";
import {getDefaultSession} from "./session";

Expand All @@ -11,10 +10,6 @@ const headerNames = {
const originsToRestoreMap = new Map<number, string>();

export function initWebRequestListeners(ctx: Context) {
if ((process.env.NODE_ENV as BuildEnvironment) !== "development") {
return;
}

const isLocalWebClientOrigin: (origin: string) => boolean = (() => {
const localOrigins = Object
.values(ctx.locations.webClients.protonmail)
Expand Down
5 changes: 2 additions & 3 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {LogLevel} from "electron-log";

import {AccountType} from "src/shared/model/account";
import {BuildEnvironment} from "./model/common";
import {EntryUrlItem} from "./types";

// tslint:disable-next-line:no-var-requires no-import-zones
Expand Down Expand Up @@ -36,10 +35,10 @@ export const ACCOUNTS_CONFIG_ENTRY_URL_LOCAL_PREFIX = "local";
export const ACCOUNTS_CONFIG: Record<AccountType, Record<"entryUrl", EntryUrlItem[]>> = {
protonmail: {
entryUrl: [
...((process.env.NODE_ENV as BuildEnvironment) === "development" ? [{
{
value: `${ACCOUNTS_CONFIG_ENTRY_URL_LOCAL_PREFIX}${ACCOUNTS_CONFIG_ENTRY_URL_SEPARATOR}https://mail.protonmail.com`,
title: `https://mail.protonmail.com (Built-in WebClient v${PROVIDER_REPO.protonmail.version})`,
}] : []),
},
{value: "https://app.protonmail.ch", title: "https://app.protonmail.ch"},
{value: "https://mail.protonmail.com", title: "https://mail.protonmail.com"},
{value: "https://beta.protonmail.com", title: "https://beta.protonmail.com (Beta)"},
Expand Down
5 changes: 0 additions & 5 deletions src/web/src/app/_accounts/account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {ACCOUNTS_ACTIONS, NAVIGATION_ACTIONS} from "src/web/src/app/store/action
import {APP_NAME, ONE_SECOND_MS} from "src/shared/constants";
import {AccountConfig} from "src/shared/model/account";
import {AccountsSelectors, OptionsSelectors} from "src/web/src/app/store/selectors";
import {BuildEnvironment} from "src/shared/model/common";
import {CoreService} from "src/web/src/app/_core/core.service";
import {DbViewModuleResolve} from "./db-view-module-resolve.service";
import {IPC_MAIN_API_NOTIFICATION_ACTIONS} from "src/shared/api/main";
Expand Down Expand Up @@ -255,10 +254,6 @@ export class AccountComponent extends NgChangesObservableComponent implements On
})),
);

if ((process.env.NODE_ENV as BuildEnvironment) !== "development") {
return;
}

this.domReadySubscription.add(
((state: { stopSyncingDeferred?: Deferred<void> } = {}) => {
return this.account$
Expand Down
2 changes: 1 addition & 1 deletion src/web/src/app/_options/account-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span *ngIf="account; else label">{{ account.login }}</span>
<ng-template #label>Add Account</ng-template>
</div>
<div class="form-check float-md-right" *ngIf="typeControlDisplayable && controls.type.value == 'tutanota'">
<div class="form-check float-md-right">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" formControlName="database">
Local store
Expand Down
8 changes: 1 addition & 7 deletions src/web/src/app/_options/account-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export class AccountEditComponent implements OnInit, OnDestroy {
mailPassword: new FormControl(null),
};
form = new FormGroup(this.controls);
// TODO release: remove temporary "typeControlDisplayable" property
typeControlDisplayable: boolean = false;
// account
account?: AccountConfig;
account$: Observable<AccountConfig> = merge(this.activatedRoute.params, this.activatedRoute.queryParams).pipe(
Expand All @@ -52,11 +50,7 @@ export class AccountEditComponent implements OnInit, OnDestroy {

constructor(private optionsService: OptionsService,
private store: Store<State>,
private activatedRoute: ActivatedRoute) {
if ((process.env.NODE_ENV/* as BuildEnvironment*/) === "development") {
this.typeControlDisplayable = true;
}
}
private activatedRoute: ActivatedRoute) {}

ngOnInit() {
const {controls} = this;
Expand Down

0 comments on commit 6eaa8a1

Please sign in to comment.