Skip to content

Commit

Permalink
Merge pull request #1946 from Automattic/release/1.15
Browse files Browse the repository at this point in the history
Merge Release/1.15 into master
  • Loading branch information
loremattei authored Mar 10, 2020
2 parents 65561d6 + 20c5413 commit 563ea5e
Show file tree
Hide file tree
Showing 88 changed files with 9,350 additions and 6,812 deletions.
118 changes: 105 additions & 13 deletions .circleci/config.yml
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
Expand All @@ -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.16.3
- image: circleci/node:12.14.0
shell: /bin/bash --login
working_directory: ~/simplenote
steps:
Expand All @@ -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
Expand All @@ -52,17 +93,18 @@ jobs:

linux:
docker:
- image: circleci/node:10.16.3
- 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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.14.0
Loading

0 comments on commit 563ea5e

Please sign in to comment.