diff --git a/after_sign_hook.js b/after_sign_hook.js index fe28c9f25..24642db10 100644 --- a/after_sign_hook.js +++ b/after_sign_hook.js @@ -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'); @@ -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({ @@ -43,5 +42,5 @@ module.exports = async function(params) { console.error(error); } - console.log(`Done notarizing ${appPath}`); + console.log(`Done notarizing ${appId}`); }; diff --git a/package.json b/package.json index 196ebe4e0..ef49cebf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "WordPressDesktop", - "version": "4.7.0", + "version": "5.0.0", "repository": { "type": "git", "url": "https://github.com/Automattic/wp-desktop/" @@ -93,6 +93,7 @@ "appId": "com.automattic.wordpress", "asar": false, "directories": { + "buildResources": "./resource/icons", "output": "./release" }, "files": [ @@ -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", @@ -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, @@ -146,7 +144,6 @@ "ia32" ] }, - "icon": "./resource/image/win/wordpress.ico", "certificateSubjectName": "Automattic, Inc." }, "nsis": { @@ -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", @@ -178,6 +174,7 @@ "libnss3" ] }, + "afterSign": "./after_sign_hook.js", "afterAllArtifactBuild": "./after_sign_hook.js" } } diff --git a/resource/image/mac/dmg-background/background.png b/resource/icons/background.png similarity index 100% rename from resource/image/mac/dmg-background/background.png rename to resource/icons/background.png diff --git a/resource/image/mac/dmg-background/background@2x.png b/resource/icons/background@2x.png similarity index 100% rename from resource/image/mac/dmg-background/background@2x.png rename to resource/icons/background@2x.png diff --git a/resource/image/mac/app-icon.icns b/resource/icons/icon.icns similarity index 100% rename from resource/image/mac/app-icon.icns rename to resource/icons/icon.icns diff --git a/resource/image/win/wordpress.ico b/resource/icons/icon.ico similarity index 100% rename from resource/image/win/wordpress.ico rename to resource/icons/icon.ico diff --git a/resource/image/linux/icon_128x128.png b/resource/image/linux/icon_128x128.png deleted file mode 100644 index 370c0f7a1..000000000 Binary files a/resource/image/linux/icon_128x128.png and /dev/null differ diff --git a/resource/image/linux/icon_128x128@2x.png b/resource/image/linux/icon_128x128@2x.png deleted file mode 100644 index f3383187f..000000000 Binary files a/resource/image/linux/icon_128x128@2x.png and /dev/null differ diff --git a/resource/image/linux/icon_16x16.png b/resource/image/linux/icon_16x16.png deleted file mode 100644 index 629eea58b..000000000 Binary files a/resource/image/linux/icon_16x16.png and /dev/null differ diff --git a/resource/image/linux/icon_16x16@2x.png b/resource/image/linux/icon_16x16@2x.png deleted file mode 100644 index 11a38fa92..000000000 Binary files a/resource/image/linux/icon_16x16@2x.png and /dev/null differ diff --git a/resource/image/linux/icon_256x256.png b/resource/image/linux/icon_256x256.png deleted file mode 100644 index f3383187f..000000000 Binary files a/resource/image/linux/icon_256x256.png and /dev/null differ diff --git a/resource/image/linux/icon_256x256@2x.png b/resource/image/linux/icon_256x256@2x.png deleted file mode 100644 index d306ef1e7..000000000 Binary files a/resource/image/linux/icon_256x256@2x.png and /dev/null differ diff --git a/resource/image/linux/icon_32x32.png b/resource/image/linux/icon_32x32.png deleted file mode 100644 index 3d97ae5b5..000000000 Binary files a/resource/image/linux/icon_32x32.png and /dev/null differ diff --git a/resource/image/linux/icon_32x32@2x.png b/resource/image/linux/icon_32x32@2x.png deleted file mode 100644 index 7f870edea..000000000 Binary files a/resource/image/linux/icon_32x32@2x.png and /dev/null differ diff --git a/resource/image/linux/icon_512x512.png b/resource/image/linux/icon_512x512.png deleted file mode 100644 index d306ef1e7..000000000 Binary files a/resource/image/linux/icon_512x512.png and /dev/null differ diff --git a/resource/image/linux/icon_512x512@2x.png b/resource/image/linux/icon_512x512@2x.png deleted file mode 100644 index c3fe59228..000000000 Binary files a/resource/image/linux/icon_512x512@2x.png and /dev/null differ diff --git a/resource/image/mac/dmg-icon.icns b/resource/image/mac/dmg-icon.icns deleted file mode 100644 index 195299674..000000000 Binary files a/resource/image/mac/dmg-icon.icns and /dev/null differ