Skip to content

Commit

Permalink
Merge Release v5.0.0 (#786)
Browse files Browse the repository at this point in the history
### Changes include:

* [notarization] Revert workaround for buggy after\_sign\_hook (#782)

* [icons] Use buildResources folder (#771)

  Updates the application icon folder structure and declarations to be aligned with updated electron-builder documentation. Specifically, we streamline the usage of application icons by:

  - Removing direct icon references for each platform in package.json, and replacing with a top-level buildResources directory
  - Removing the linux-specific icon so electron-builder can use icon.icns for both Linux and Mac (per the docs)

  Per the docs, icons in buildResources will automatically be detected and used accordingly as follows:

    - icon.icns -- Mac and Linux (installers and applications)
    - background.png and [email protected] (Mac installer backgrounds)
    - icon.ico -- Windows (installer and application)
  • Loading branch information
nsakaimbo authored Feb 26, 2020
1 parent 273c3b3 commit 6fc6e7b
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 21 deletions.
29 changes: 14 additions & 15 deletions after_sign_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ const path = require('path');
var electron_notarize = require('electron-notarize');

module.exports = async function(params) {
// Only notarize the app on Mac OS only.
for (var key of params.platformToTargets.keys()) {
if (key.name !== 'mac') {
return;
}
}

console.log('afterSign hook triggered');
// Only notarize the app on Mac OS only.
if (params.electronPlatformName !== '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');
Expand All @@ -20,16 +17,18 @@ module.exports = async function(params) {
// Same appId in electron-builder.
let appId = 'com.automattic.wordpress';

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

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

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

try {
await electron_notarize.notarize({
Expand All @@ -43,5 +42,5 @@ module.exports = async function(params) {
console.error(error);
}

console.log(`Done notarizing ${appPath}`);
console.log(`Done notarizing ${appId}`);
};
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WordPressDesktop",
"version": "4.7.0",
"version": "5.0.0",
"repository": {
"type": "git",
"url": "https://github.com/Automattic/wp-desktop/"
Expand Down Expand Up @@ -93,6 +93,7 @@
"appId": "com.automattic.wordpress",
"asar": false,
"directories": {
"buildResources": "./resource/icons",
"output": "./release"
},
"files": [
Expand All @@ -110,7 +111,6 @@
}
],
"mac": {
"icon": "./resource/image/mac/app-icon.icns",
"category": "public.app-category.social-networking",
"entitlements": "./resource/macos/entitlements.mac.plist",
"entitlementsInherit": "./resource/macos/entitlements.mac.inherit.plist",
Expand All @@ -121,9 +121,7 @@
},
"dmg": {
"title": "WordPress.com Installer",
"icon": "./resource/image/mac/dmg-icon.icns",
"iconSize": 150,
"background": "./resource/image/mac/dmg-background/background.png",
"contents": [
{
"x": 486,
Expand All @@ -146,7 +144,6 @@
"ia32"
]
},
"icon": "./resource/image/win/wordpress.ico",
"certificateSubjectName": "Automattic, Inc."
},
"nsis": {
Expand All @@ -157,7 +154,6 @@
"deb",
"tar.gz"
],
"icon": "./resource/image/linux/512x512.png",
"executableName": "wpcom",
"description": "WordPress.com Desktop Client",
"synopsis": "WordPress.com Desktop client",
Expand All @@ -178,6 +174,7 @@
"libnss3"
]
},
"afterSign": "./after_sign_hook.js",
"afterAllArtifactBuild": "./after_sign_hook.js"
}
}
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Binary file removed resource/image/linux/icon_128x128.png
Binary file not shown.
Binary file removed resource/image/linux/[email protected]
Binary file not shown.
Binary file removed resource/image/linux/icon_16x16.png
Binary file not shown.
Binary file removed resource/image/linux/[email protected]
Binary file not shown.
Binary file removed resource/image/linux/icon_256x256.png
Binary file not shown.
Binary file removed resource/image/linux/[email protected]
Binary file not shown.
Binary file removed resource/image/linux/icon_32x32.png
Binary file not shown.
Binary file removed resource/image/linux/[email protected]
Binary file not shown.
Binary file removed resource/image/linux/icon_512x512.png
Binary file not shown.
Binary file removed resource/image/linux/[email protected]
Binary file not shown.
Binary file removed resource/image/mac/dmg-icon.icns
Binary file not shown.

0 comments on commit 6fc6e7b

Please sign in to comment.