-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Electron and associated dependencies (#1771)
This updates the Electron dependencies to the latest. In doing so we need to have a minimum of Node 12 which is required by Electron 7. We also need to move the Windows build from AppVeyor to CircleCi.
- Loading branch information
Showing
12 changed files
with
2,303 additions
and
5,298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,45 @@ | ||
version: 2 | ||
version: 2.1 | ||
|
||
orbs: | ||
win: circleci/[email protected] | ||
|
||
references: | ||
restore_nvm: &restore_nvm | ||
restore_cache: | ||
name: Restoring NVM cache | ||
keys: | ||
- v1-nvm-0-33-11-{{ arch }}-{{ checksum ".nvmrc" }} | ||
- v1-nvm-0-33-11-{{ arch }} | ||
setup_nvm: &setup_nvm | ||
run: | ||
name: Install nvm and node version | ||
command: | | ||
set +e | ||
set +u | ||
set +x | ||
NODE_VERSION=$(cat .nvmrc) | ||
export NVM_DIR="${HOME}/.nvm" | ||
mkdir -p "$NVM_DIR" | ||
if [ ! -f "${NVM_DIR}/nvm.sh" ]; then | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | ||
fi | ||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
nvm install "$NODE_VERSION" | ||
nvm alias default "$NODE_VERSION" | ||
nvm use "$NODE_VERSION" | ||
save_nvm: &save_nvm | ||
save_cache: | ||
name: Saving NVM cache | ||
key: v1-nvm-0-33-11-{{ arch }}-{{ checksum ".nvmrc" }} | ||
paths: | ||
- ~/.nvm | ||
npm_install: &npm_install | ||
run: | ||
name: Npm install | ||
command: | | ||
source $HOME/.nvm/nvm.sh | ||
nvm use | ||
npm ci | ||
npm_restore_cache: &npm_restore_cache | ||
restore_cache: | ||
name: Restore npm cache | ||
|
@@ -23,12 +62,12 @@ references: | |
command: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt update | ||
sudo apt -y install libxkbfile-dev libxkbfile-dev:i386 libx11-dev libx11-dev:i386 libxss-dev gcc-multilib g++-multilib rpm | ||
sudo apt -y install libxkbfile-dev libxkbfile-dev:i386 libxext-dev libx11-dev libx11-dev:i386 libxss-dev gcc-multilib g++-multilib rpm | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:10.15.0 | ||
- image: circleci/node:12.14.0 | ||
shell: /bin/bash --login | ||
working_directory: ~/simplenote | ||
steps: | ||
|
@@ -37,12 +76,14 @@ jobs: | |
- 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} | ||
- *restore_nvm | ||
- *setup_nvm | ||
- *save_nvm | ||
- *npm_restore_cache | ||
- run: npm ci | ||
- run: patch -p1 < ./resources/macos/macPackager-patch.diff | ||
- run: patch -p1 < ./resources/macos/scheme-patch.diff | ||
- *npm_install | ||
- run: make build | ||
- run: make lint | ||
- run: make test | ||
|
@@ -52,17 +93,18 @@ jobs: | |
|
||
linux: | ||
docker: | ||
- image: circleci/node:10.15.0 | ||
- image: circleci/node:12.14.0 | ||
working_directory: ~/simplenote | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: ~/simplenote | ||
- *restore_nvm | ||
- *setup_nvm | ||
- *save_nvm | ||
- *npm_restore_cache | ||
- *install_linux_deps | ||
- run: npm ci | ||
- run: patch -p1 < ./resources/macos/macPackager-patch.diff | ||
- run: patch -p1 < ./resources/macos/scheme-patch.diff | ||
- *npm_install | ||
- *npm_save_cache | ||
- run: make package-linux SKIP_BUILD=true | ||
- run: | ||
|
@@ -85,10 +127,11 @@ jobs: | |
- checkout | ||
- attach_workspace: | ||
at: /Users/distiller/simplenote | ||
- *restore_nvm | ||
- *setup_nvm | ||
- *save_nvm | ||
- *npm_restore_cache | ||
- run: npm ci | ||
- run: patch -p1 < ./resources/macos/macPackager-patch.diff | ||
- run: patch -p1 < ./resources/macos/scheme-patch.diff | ||
- *npm_install | ||
- *npm_save_cache | ||
- run: | ||
name: Build Mac | ||
|
@@ -108,6 +151,46 @@ jobs: | |
paths: | ||
- release | ||
|
||
windows: | ||
executor: | ||
name: win/default | ||
working_directory: C:\Users\circleci\simplenote-electron | ||
environment: | ||
CSC_FOR_PULL_REQUEST: true | ||
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: | | ||
# 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 | ||
# 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 | ||
paths: | ||
- release\*.exe | ||
- release\*.appx | ||
- release\*.yml | ||
artifacts: | ||
docker: | ||
- image: buildpack-deps:trusty | ||
|
@@ -144,10 +227,19 @@ workflows: | |
ignore: webapp | ||
tags: | ||
only: /.*/ | ||
- windows: | ||
requires: | ||
- build | ||
filters: | ||
branches: | ||
ignore: webapp | ||
tags: | ||
only: /.*/ | ||
- artifacts: | ||
requires: | ||
- linux | ||
- mac | ||
- windows | ||
filters: | ||
branches: | ||
ignore: webapp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.