diff --git a/package.json b/package.json index 7517647c075..e99627ed314 100644 --- a/package.json +++ b/package.json @@ -401,6 +401,7 @@ }, "beforeBuild": "scripts/install-cross-deps.js", "afterPack": "ts/scripts/after-pack.js", + "afterSign": "ts/scripts/after-sign.js", "asarUnpack": [ "ts/workers/heicConverter.bundle.js", "ts/sql/mainWorker.bundle.js", diff --git a/ts/scripts/after-pack.ts b/ts/scripts/after-pack.ts index 2c6441d91d3..48cf928125c 100644 --- a/ts/scripts/after-pack.ts +++ b/ts/scripts/after-pack.ts @@ -6,14 +6,10 @@ import { afterPack as fuseElectron } from './fuse-electron'; import { afterPack as mergeASARs } from './merge-macos-asars'; import { afterPack as copyPacks } from './copy-language-packs'; import { afterPack as pruneMacOSRelease } from './prune-macos-release'; -import { afterPack as notarize } from './notarize'; export async function afterPack(context: AfterPackContext): Promise { await pruneMacOSRelease(context); await mergeASARs(context); await fuseElectron(context); await copyPacks(context); - - // This must be the last step - await notarize(context); } diff --git a/ts/scripts/after-sign.ts b/ts/scripts/after-sign.ts new file mode 100644 index 00000000000..a80d5dd31f2 --- /dev/null +++ b/ts/scripts/after-sign.ts @@ -0,0 +1,12 @@ +// Copyright 2022 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +import type { AfterPackContext } from 'electron-builder'; +import { afterSign as notarize } from './notarize'; + +// NOTE: It is AfterPackContext here even though it is afterSign. +// See: https://www.electron.build/configuration/configuration.html#aftersign +export async function afterSign(context: AfterPackContext): Promise { + // This must be the last step + await notarize(context); +} diff --git a/ts/scripts/notarize.ts b/ts/scripts/notarize.ts index 04a76462db4..8c4c8f8c42e 100644 --- a/ts/scripts/notarize.ts +++ b/ts/scripts/notarize.ts @@ -10,7 +10,7 @@ import * as packageJson from '../../package.json'; /* eslint-disable no-console */ -export async function afterPack({ +export async function afterSign({ appOutDir, packager, electronPlatformName,