Skip to content

Commit ff70339

Browse files
committed
Working branch for notarisation
1 parent d903214 commit ff70339

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"buildResources": "electron_app/build",
189189
"output": "electron_app/dist",
190190
"app": "electron_app"
191-
}
191+
},
192+
"afterSign": "scripts/electron_afterSign.js"
192193
}
193194
}

‎scripts/electron_afterSign.js‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { notarize } = require('electron-notarize');
2+
3+
exports.default = async function(context) {
4+
const { electronPlatformName, appOutDir } = context;
5+
if (electronPlatformName !== 'darwin') {
6+
return;
7+
}
8+
9+
// We get the password from keychain. The keychain stores
10+
// user IDs too, but apparently altool can't get the user ID
11+
// from the keychain, so we need to get it from the environment.
12+
const userId = process.env.NOTARIZE_APPLE_ID;
13+
if (userId === undefined) {
14+
throw new Exception("User ID not found. Set NOTARIZE_APPLE_ID.");
15+
}
16+
17+
const appName = context.packager.appInfo.productFilename;
18+
19+
return await notarize({
20+
appBundleId: 'im.riot.app',
21+
appPath: `${appOutDir}/${appName}.app`,
22+
appleId: userId,
23+
appleIdPassword: '@keychain:NOTARIZE_CREDS,
24+
});
25+
};

0 commit comments

Comments
 (0)