Initial clean project import

This commit is contained in:
cat-shark
2026-06-19 18:41:41 +08:00
commit a13b804c7a
1306 changed files with 220568 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
const {notarize} = require("@electron/notarize");
const common = require('./common.cjs')
exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;
const {electronPlatformName, appOutDir} = context;
console.log(` • Notarization Start`);
// We skip notarization if the process is not running on MacOS and
// if the enviroment variable SKIP_NOTARIZE is set to `true`
// This is useful for local testing where notarization is useless
if (
electronPlatformName !== "darwin" ||
process.env.SKIP_NOTARIZE === "true"
) {
console.log(` • Skipping notarization`);
return;
}
// THIS MUST BE THE SAME AS THE `appId` property
// in your electron builder configuration
const appId = "AigcPanel";
let appPath = `${appOutDir}/${appName}.app`;
let {APPLE_ID, APPLE_ID_PASSWORD, APPLE_TEAM_ID} = process.env;
if (!APPLE_ID) {
console.info(" • Notarization ignore: APPLE_ID is empty");
await common.calcSha256()
return;
}
const notarizeOption = {
tool: "notarytool",
appBundleId: appId,
appPath,
appleId: APPLE_ID,
appleIdPassword: APPLE_ID_PASSWORD,
teamId: APPLE_TEAM_ID,
verbose: true,
}
console.log(` • Notarizing`, `appPath:${appPath} notarizeOption:${JSON.stringify(notarizeOption)}`);
try {
const result = await notarize(notarizeOption);
console.log(" • Notarization successful!");
await common.calcSha256()
return result;
} catch (error) {
console.error(" • Notarization failed:", error.message);
console.error(" • Stack trace:", error.stack);
await common.calcSha256()
throw new Error(`Notarization failed: ${error.message}`);
}
};