Skip to content

Commit

Permalink
Merge pull request #1657 from Automattic/merge-release-1.9-into-develop
Browse files Browse the repository at this point in the history
Merge release 1.9 into develop
  • Loading branch information
belcherj authored Oct 21, 2019
2 parents e54b2ae + 7d12416 commit 025d19a
Show file tree
Hide file tree
Showing 10 changed files with 428 additions and 59 deletions.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
openssl aes-256-cbc -md md5 -d -in ./resources/secrets/config.json.enc -out ./config.json -k ${SECRETS_ENCRYPTION_KEY}
- *npm_restore_cache
- run: npm ci
- run: patch -p1 < ./resources/macos/macPackager-patch.diff
- run: patch -p1 < ./resources/macos/scheme-patch.diff
- run: make build
- run: make test
- persist_to_workspace:
Expand All @@ -58,6 +60,8 @@ jobs:
- *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_save_cache
- run: make package-linux SKIP_BUILD=true
- run:
Expand All @@ -73,7 +77,7 @@ jobs:

mac:
macos:
xcode: '9.4.1'
xcode: '10.0.0'
shell: /bin/bash --login
working_directory: /Users/distiller/simplenote
steps:
Expand All @@ -82,6 +86,8 @@ jobs:
at: /Users/distiller/simplenote
- *npm_restore_cache
- run: npm ci
- run: patch -p1 < ./resources/macos/macPackager-patch.diff
- run: patch -p1 < ./resources/macos/scheme-patch.diff
- *npm_save_cache
- run:
name: Build Mac
Expand Down
46 changes: 46 additions & 0 deletions after_sign_hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const fs = require('fs');
const path = require('path');
var electron_notarize = require('electron-notarize');

module.exports = async function(params) {
// Only notarize the app on Mac OS only.
if (process.platform !== 'darwin') {
return;
}
console.log('afterSign hook triggered', params);

if (!process.env.CIRCLE_TAG || process.env.CIRCLE_TAG.length === 0) {
console.log('Not on a tag. Skipping notarization');
return;
}

// Same appId in electron-builder.
let appId = 'com.automattic.simplenote';

let appPath = params.appOutDir
? path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
)
: params.artifactPaths[0].replace(new RegExp('.blockmap'), '');

if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}

console.log(`Notarizing ${appId} found at ${appPath}`);

try {
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: process.env.NOTARIZATION_ID,
appleIdPassword: process.env.NOTARIZATION_PWD,
ascProvider: 'AutomatticInc',
});
} catch (error) {
console.error(error);
}

console.log(`Done notarizing ${appId}`);
};
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ install:
- ps: Install-Product node 10
- cinst make
- npm ci
- patch -p1 < ./resources/macos/macPackager-patch.diff
- patch -p1 < ./resources/macos/scheme-patch.diff

for:
# default build / .exe / signed
Expand Down
9 changes: 7 additions & 2 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"mac": {
"icon": "./resources/images/app-icon.icns",
"category": "public.app-category.social-networking",
"artifactName": "Simplenote-macOS-${version}.${ext}"
"artifactName": "Simplenote-macOS-${version}.${ext}",
"entitlements": "./resources/macos/entitlements.mac.plist",
"entitlementsInherit": "./resources/macos/entitlements.mac.inherit.plist",
"hardenedRuntime": true
},
"dmg": {
"title": "Simplenote Installer",
Expand Down Expand Up @@ -100,5 +103,7 @@
},
"deb": {
"depends": ["gconf2"]
}
},
"afterSign": "./after_sign_hook.js",
"afterAllArtifactBuild": "./after_sign_hook.js"
}
Loading

0 comments on commit 025d19a

Please sign in to comment.