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