lbry-desktop/build/afterSignHook.js

34 lines
872 B
JavaScript
Raw Permalink Normal View History

2019-10-11 05:26:05 +02:00
// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db
const fs = require('fs');
const path = require('path');
var electron_notarize = require('electron-notarize');
2020-12-08 22:50:10 +01:00
module.exports = async function() {
if (process.env.RUNNER_OS !== 'macOS') {
2019-10-11 05:26:05 +02:00
return;
}
2020-12-08 22:50:10 +01:00
const appId = 'io.lbry.LBRY';
const appPath = path.resolve(__dirname, '../dist/electron/mac/LBRY.app');
2019-10-11 05:26:05 +02:00
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,
2020-12-08 22:50:10 +01:00
appleId: process.env.NOTARIZATION_USERNAME,
appleIdPassword: process.env.NOTARIZATION_PASSWORD,
2019-10-11 05:26:05 +02:00
});
} catch (error) {
console.error(error);
}
console.log(`Done notarizing ${appId}`);
};