From c11e9350d548560eb38c89b151650cf479177980 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:24:48 -0800 Subject: [PATCH] Notarize in afterSign step instead of afterPack --- package.json | 1 + ts/scripts/after-pack.ts | 4 ---- ts/scripts/after-sign.ts | 12 ++++++++++++ ts/scripts/notarize.ts | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 ts/scripts/after-sign.ts diff --git a/package.json b/package.json index 7517647c0..e99627ed3 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 2c6441d91..48cf92812 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 000000000..a80d5dd31 --- /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 04a76462d..8c4c8f8c4 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,