-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1657 from Automattic/merge-release-1.9-into-develop
Merge release 1.9 into develop
- Loading branch information
Showing
10 changed files
with
428 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.