mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 13:42:27 -05:00
support notarize with password or keychain
This commit is contained in:
parent
61251d111f
commit
000bff75ed
1 changed files with 10 additions and 6 deletions
|
@ -6,10 +6,10 @@ const notarizeMacBuild = async function (context) {
|
||||||
|
|
||||||
if (!process.env.AC_USERNAME) {
|
if (!process.env.AC_USERNAME) {
|
||||||
console.error([
|
console.error([
|
||||||
'Notarizing the macOS build requires an Apple ID.',
|
'This build is not notarized and will not run on newer versions of macOS!',
|
||||||
'Please set the environment variable AC_USERNAME.',
|
'Notarizing the macOS build requires an Apple ID. To notarize future builds:',
|
||||||
'Make sure your keychain has an item for "Application Loader: your@apple.id"',
|
'* Set the environment variable AC_USERNAME to your@apple.id and',
|
||||||
'This build will not run on newer versions of macOS!'
|
'* Either set AC_PASSWORD or ensure your keychain has an item for "Application Loader: your@apple.id"'
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,11 @@ const notarizeMacBuild = async function (context) {
|
||||||
const appleId = process.env.AC_USERNAME;
|
const appleId = process.env.AC_USERNAME;
|
||||||
const appleIdKeychainItem = `Application Loader: ${appleId}`;
|
const appleIdKeychainItem = `Application Loader: ${appleId}`;
|
||||||
|
|
||||||
console.log(`Notarizing with Apple ID "${appleId}" and keychain item "${appleIdKeychainItem}"`);
|
if (process.env.AC_PASSWORD) {
|
||||||
|
console.log(`Notarizing with Apple ID "${appleId}" and a password`);
|
||||||
|
} else {
|
||||||
|
console.log(`Notarizing with Apple ID "${appleId}" and keychain item "${appleIdKeychainItem}"`);
|
||||||
|
}
|
||||||
|
|
||||||
const {appOutDir} = context;
|
const {appOutDir} = context;
|
||||||
const productFilename = context.packager.appInfo.productFilename;
|
const productFilename = context.packager.appInfo.productFilename;
|
||||||
|
@ -25,7 +29,7 @@ const notarizeMacBuild = async function (context) {
|
||||||
appBundleId: appId,
|
appBundleId: appId,
|
||||||
appPath: `${appOutDir}/${productFilename}.app`,
|
appPath: `${appOutDir}/${productFilename}.app`,
|
||||||
appleId,
|
appleId,
|
||||||
appleIdPassword: `@keychain:${appleIdKeychainItem}`
|
appleIdPassword: process.env.AC_PASSWORD || `@keychain:${appleIdKeychainItem}`
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue