Skip to content

Commit

Permalink
Revert workaround for buggy after_sign_hook (#782)
Browse files Browse the repository at this point in the history
* Revert workaround for buggy after_sign_hook

* Bump version to 5.0.0-beta3
  • Loading branch information
loremattei authored Feb 26, 2020
1 parent df398d0 commit 281a567
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 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}`);
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WordPressDesktop",
"version": "5.0.0-beta2",
"version": "5.0.0-beta3",
"repository": {
"type": "git",
"url": "https://github.com/Automattic/wp-desktop/"
Expand Down Expand Up @@ -174,6 +174,7 @@
"libnss3"
]
},
"afterSign": "./after_sign_hook.js",
"afterAllArtifactBuild": "./after_sign_hook.js"
}
}

0 comments on commit 281a567

Please sign in to comment.