Fully notarize universal dmg instead of stapling
This commit is contained in:
parent
b8c1faf086
commit
11d54f6769
2 changed files with 16 additions and 11 deletions
|
@ -2,11 +2,11 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { BuildResult } from 'electron-builder';
|
||||
import { afterAllArtifactBuild as stapleNotarization } from './staple-notarization';
|
||||
import { afterAllArtifactBuild as notarizeUniversalDMG } from './notarize-universal-dmg';
|
||||
|
||||
export async function afterAllArtifactBuild(
|
||||
result: BuildResult
|
||||
): Promise<Array<string>> {
|
||||
await stapleNotarization(result);
|
||||
await notarizeUniversalDMG(result);
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import type { BuildResult } from 'electron-builder';
|
||||
|
||||
import { stapleApp } from 'electron-notarize';
|
||||
import { notarize } from 'electron-notarize';
|
||||
|
||||
import * as packageJson from '../../package.json';
|
||||
|
||||
|
@ -50,14 +50,19 @@ export async function afterAllArtifactBuild({
|
|||
}
|
||||
|
||||
const artifactsToStaple = artifactPaths.filter(artifactPath =>
|
||||
/\.(zip|dmg)$/.test(artifactPath)
|
||||
/^.*mac-universal.*\.dmg$/.test(artifactPath)
|
||||
);
|
||||
|
||||
for (const artifactPath of artifactsToStaple) {
|
||||
console.log(`Stapling notariation for: ${artifactPath}`);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await stapleApp({
|
||||
appPath: artifactPath,
|
||||
});
|
||||
if (artifactsToStaple.length !== 1) {
|
||||
console.log(`notarize: Skipping, too many dmgs ${artifactsToStaple}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const [dmgPath] = artifactsToStaple;
|
||||
console.log(`Notarizing dmg: ${dmgPath}`);
|
||||
await notarize({
|
||||
appBundleId,
|
||||
appPath: dmgPath,
|
||||
appleId,
|
||||
appleIdPassword,
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue