From bbae4e17962e7bbaed040b4f0fa21cf572b286a8 Mon Sep 17 00:00:00 2001 From: Jonathan Belcher Date: Tue, 10 Mar 2020 12:51:48 -0500 Subject: [PATCH 1/4] CircleCi: Ignore webapp-staging and webapp-develop in addition to webapp (#1931) CircleCi: Ignore webapp-staging and webapp-develop in addition to webapp (cherry picked from commit 97151da5f817b47fe2fbe1f02e3f48b5a3b23302) --- .circleci/config.yml | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83d0c030e..8d79a41c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,14 @@ orbs: win: circleci/windows@2.2.0 references: + job_filters: &job_filters + branches: + ignore: + - webapp + - webapp-develop + - webapp-staging + tags: + only: /.*/ restore_nvm: &restore_nvm restore_cache: name: Restoring NVM cache @@ -206,42 +214,22 @@ workflows: simplenote: jobs: - build: - filters: - branches: - ignore: webapp - tags: - only: /.*/ + filters: *job_filters - linux: requires: - build - filters: - branches: - ignore: webapp - tags: - only: /.*/ + filters: *job_filters - mac: requires: - build - filters: - branches: - ignore: webapp - tags: - only: /.*/ + filters: *job_filters - windows: requires: - build - filters: - branches: - ignore: webapp - tags: - only: /.*/ + filters: *job_filters - artifacts: requires: - linux - mac - windows - filters: - branches: - ignore: webapp - tags: - only: /.*/ + filters: *job_filters From 8ddec323e997c6ad43c7903a5088df9bd2eeadba Mon Sep 17 00:00:00 2001 From: Jonathan Belcher Date: Wed, 11 Mar 2020 08:31:22 -0500 Subject: [PATCH 2/4] Add testing job to CircleCi (#1952) (cherry picked from commit 3de7482f87ec61157a33580dd60b0ec5c0758f35) --- .circleci/config.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d79a41c8..805e70c07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,6 +4,13 @@ orbs: win: circleci/windows@2.2.0 references: + decrypt: &decrypt + run: + name: Decrypt assets + command: | + openssl aes-256-cbc -md md5 -d -in ./resources/certificates/win.p12.enc -out ./resources/certificates/win.p12 -k ${SECRETS_ENCRYPTION_KEY} + openssl aes-256-cbc -md md5 -d -in ./resources/certificates/mac.p12.enc -out ./resources/certificates/mac.p12 -k ${SECRETS_ENCRYPTION_KEY} + openssl aes-256-cbc -md md5 -d -in ./resources/secrets/config.json.enc -out ./config.json -k ${SECRETS_ENCRYPTION_KEY} job_filters: &job_filters branches: ignore: @@ -81,23 +88,33 @@ jobs: steps: - *install_linux_deps - checkout - - run: - name: Decrypt assets - command: | - openssl aes-256-cbc -md md5 -d -in ./resources/certificates/win.p12.enc -out ./resources/certificates/win.p12 -k ${SECRETS_ENCRYPTION_KEY} - openssl aes-256-cbc -md md5 -d -in ./resources/certificates/mac.p12.enc -out ./resources/certificates/mac.p12 -k ${SECRETS_ENCRYPTION_KEY} - openssl aes-256-cbc -md md5 -d -in ./resources/secrets/config.json.enc -out ./config.json -k ${SECRETS_ENCRYPTION_KEY} + - *decrypt - *restore_nvm - *setup_nvm - *save_nvm - *npm_restore_cache - *npm_install - run: make build - - run: make lint - - run: make test - persist_to_workspace: root: ~/simplenote paths: *app_cache_paths + test: + docker: + - image: circleci/node:12.14.0 + shell: /bin/bash --login + working_directory: ~/simplenote + steps: + - *install_linux_deps + - checkout + - *decrypt + - *restore_nvm + - *setup_nvm + - *save_nvm + - *npm_restore_cache + - *npm_install + - run: NODE_ENV=test npm run build + - run: npm test + - run: npm run lint linux: docker: @@ -215,6 +232,8 @@ workflows: jobs: - build: filters: *job_filters + - test: + filters: *job_filters - linux: requires: - build From 317c803aa3ef49012835bf72f6e15b260033297c Mon Sep 17 00:00:00 2001 From: "Jonathan (JB) Belcher" Date: Thu, 12 Mar 2020 11:51:45 -0400 Subject: [PATCH 3/4] Fix application signing to generate appx for windows store (cherry picked from commit 8e5b7d56a8ba5ef990dce74099e730b2f73b15e1) --- .circleci/config.yml | 47 +++++++++++++++++++++++++++++++++++--- electron-builder-appx.json | 13 +++++++++-- electron-builder.json | 4 ++++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 805e70c07..cf5263fc6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -204,11 +204,10 @@ jobs: command: | # Workaround for Sign Tool "private key filter" bug in Circle's Windows image. # Ref: https://travis-ci.community/t/codesigning-on-windows/ - # - # Fix: Import .p12 into the local certificate store. Sign Tool will use + # + # Fix: Import .p12 into the local certificate store. Sign Tool will use # package.json's `certificateSubjectName` to find the imported cert. Import-PfxCertificate -FilePath C:\Users\circleci\simplenote-electron\resources\certificates\win.p12 -CertStoreLocation Cert:\LocalMachine\Root -Password (ConvertTo-SecureString -String $env:WIN_CSC_KEY_PASSWORD -AsPlainText -Force) - make package-win32 IS_WINDOWS=true npx electron-builder --win -p onTag - persist_to_workspace: root: C:\Users\circleci\simplenote-electron @@ -216,6 +215,38 @@ jobs: - release\*.exe - release\*.appx - release\*.yml + windowsstore: + executor: + name: win/default + working_directory: C:\Users\circleci\simplenote-electron + environment: + CSC_LINK: '' + WIN_CSC_LINK: '' + steps: + - checkout + - attach_workspace: + at: C:\Users\circleci\simplenote-electron + - run: + name: Install make + command: cinst make + - run: + name: Install node version + command: | + $NODE_VERSION = Get-Content .\.nvmrc + nvm install $NODE_VERSION + nvm use $NODE_VERSION + - run: + name: Npm install + command: | + npm ci + - run: + name: Build windows + command: | + npx electron-builder --win --config=./electron-builder-appx.json -p onTag + - persist_to_workspace: + root: C:\Users\circleci\simplenote-electron + paths: + - release\*.appx artifacts: docker: - image: buildpack-deps:trusty @@ -246,9 +277,19 @@ workflows: requires: - build filters: *job_filters + - windowsstore: + requires: + - build + filters: + branches: + only: + - none + tags: + only: /.*/ - artifacts: requires: - linux - mac - windows + - windowsstore filters: *job_filters diff --git a/electron-builder-appx.json b/electron-builder-appx.json index bc581befd..2a53bf433 100644 --- a/electron-builder-appx.json +++ b/electron-builder-appx.json @@ -1,5 +1,13 @@ { + "productName": "Simplenote", + "appId": "com.automattic.simplenote", + "directories": { + "output": "release", + "buildResources": "resources" + }, + "files": ["desktop", "dist", "shared"], "win": { + "icon": "resources/images/simplenote.ico", "target": [ { "target": "appx" @@ -12,7 +20,8 @@ "publisher": "CN=E2E5A157-746D-4B04-9116-ABE5CB928306", "publisherDisplayName": "Automattic", "backgroundColor": "transparent", - "artifactName": "Simplenote-win-${version}-${arch}.${ext}" + "artifactName": "Simplenote-win-store-${version}-${arch}.${ext}" }, - "extends": "./electron-builder.json" + "afterSign": "./after_sign_hook.js", + "afterAllArtifactBuild": "./after_sign_hook.js" } diff --git a/electron-builder.json b/electron-builder.json index 7c1587da4..b884438aa 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -42,6 +42,10 @@ { "target": "nsis", "arch": ["ia32", "x64"] + }, + { + "target": "appx", + "arch": ["ia32", "x64"] } ] }, From 72bf987e15c5900fc5093a3dba391660321bd3c2 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Mon, 16 Mar 2020 15:24:38 -0700 Subject: [PATCH 4/4] Version bump for release (cherry picked from commit 11ab2aaca0a1896079427bc202bd83efb1a24879) --- RELEASE-NOTES.txt | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 8f6d52c95..adfecb172 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,5 +1,11 @@ # Changelog +## [v1.15.1] + +### Other Changes + +- Fix application signing to generate proper appx for Windows Store [#1960](https://github.com/Automattic/simplenote-electron/pull/1960) + ## [v1.15.0] ### Enhancements diff --git a/package-lock.json b/package-lock.json index 14f9e4eab..41b542557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simplenote", - "version": "1.15.0", + "version": "1.15.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 50f31687a..1380adee3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "email": "support@simplenote.com" }, "productName": "Simplenote", - "version": "1.15.0", + "version": "1.15.1", "main": "desktop/index.js", "license": "GPL-2.0", "homepage": "https://simplenote.com",