You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.3 KiB
36 lines
1.3 KiB
/* eslint-disable @typescript-eslint/no-var-requires */ |
|
require("dotenv").config(); |
|
const { notarize } = require("@electron/notarize"); |
|
|
|
exports.default = async function notarizing(context) { |
|
const { electronPlatformName, appOutDir } = context; |
|
if (electronPlatformName !== "darwin") { |
|
return; |
|
} |
|
|
|
const appName = context.packager.appInfo.productFilename; |
|
if (process.env.APP_STORE_CONNECT_TEAM_ISSUER) { |
|
const appleApiIssuer = process.env.APP_STORE_CONNECT_TEAM_ISSUER; |
|
const appleApiKey = process.env.APP_STORE_CONNECT_AUTH_KEY_PATH; |
|
const appleApiKeyId = process.env.APP_STORE_CONNECT_AUTH_KEY; |
|
return await notarize({ |
|
tool: "notarytool", |
|
appBundleId: "com.bitwarden.directory-connector", |
|
appPath: `${appOutDir}/${appName}.app`, |
|
appleApiIssuer: appleApiIssuer, |
|
appleApiKey: appleApiKey, |
|
appleApiKeyId: appleApiKeyId, |
|
}); |
|
} else { |
|
const appleId = process.env.APPLE_ID_USERNAME || process.env.APPLEID; |
|
const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`; |
|
return await notarize({ |
|
tool: "notarytool", |
|
appBundleId: "com.bitwarden.directory-connector", |
|
appPath: `${appOutDir}/${appName}.app`, |
|
teamId: "LTZ2PFU5D6", |
|
appleId: appleId, |
|
appleIdPassword: appleIdPassword, |
|
}); |
|
} |
|
};
|
|
|