forked from Mechanical-Advantage/AdvantageScope
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotarize.js
More file actions
34 lines (29 loc) · 995 Bytes
/
notarize.js
File metadata and controls
34 lines (29 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2021-2026 Littleton Robotics
// http://github.com/Mechanical-Advantage
//
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file
// at the root directory of this project.
const { notarize } = require("@electron/notarize");
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin") {
return;
}
const appleId = process.env.APPLE_ID;
const appleIdPwd = process.env.APPLE_ID_PWD;
const appleIdTeam = process.env.APPLE_ID_TEAM;
if (!appleId || !appleIdPwd || !appleIdTeam) {
console.log("No Apple ID provided, skipping notarization");
return;
}
const appName = context.packager.appInfo.productFilename;
console.log("Notarizing...");
return await notarize({
tool: "notarytool",
appPath: `${appOutDir}/${appName}.app`,
appleId: appleId,
appleIdPassword: appleIdPwd,
teamId: appleIdTeam
});
};