Skip to content

Commit bf23272

Browse files
feat: use notarytool by default (#141)
BREAKING CHANGE: users who do not specify tool will not use notarytool by default
1 parent 6f5116c commit bf23272

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,9 @@ For notarization, you need the following things:
4444
### Method: `notarize(opts): Promise<void>`
4545

4646
* `options` Object
47-
* `tool` String - The notarization tool to use, default is `legacy`. Can be `legacy` or `notarytool`. `notarytool` is substantially (10x) faster.
47+
* `tool` String - The notarization tool to use, default is `notarytool`. Can be `legacy` or `notarytool`. `notarytool` is substantially (10x) faster and `legacy` is deprecated and will **stop working** on November 1st 2023.
4848
* `appPath` String - The absolute path to your `.app` file
49-
* There are different options for each tool: Legacy
50-
* `appBundleId` String - The app bundle identifier your Electron app is using. E.g. `com.github.electron`
51-
* `ascProvider` String (optional) - Your [Team Short Name](#notes-on-your-team-short-name).
52-
* There are two authentication methods available: user name with password:
53-
* `appleId` String - The username of your apple developer account
54-
* `appleIdPassword` String - The [app-specific password](https://support.apple.com/HT204397) (not your Apple ID password).
55-
* ... or apiKey with apiIssuer:
56-
* `appleApiKey` String - Required for JWT authentication. See Note on JWT authentication below.
57-
* `appleApiIssuer` String - Issuer ID. Required if `appleApiKey` is specified.
58-
* ... or Notary Tool
49+
* There are different options for each tool: Notarytool
5950
* There are three authentication methods available: user name with password:
6051
* `appleId` String - The username of your apple developer account
6152
* `appleIdPassword` String - The [app-specific password](https://support.apple.com/HT204397) (not your Apple ID password).
@@ -67,6 +58,15 @@ For notarization, you need the following things:
6758
* ... or keychain with keychainProfile:
6859
* `keychain` String - The name of the keychain or path to the keychain you stored notarization credentials in.
6960
* `keychainProfile` String - The name of the profile you provided when storing notarization credentials.
61+
* ... or Legacy
62+
* `appBundleId` String - The app bundle identifier your Electron app is using. E.g. `com.github.electron`
63+
* `ascProvider` String (optional) - Your [Team Short Name](#notes-on-your-team-short-name).
64+
* There are two authentication methods available: user name with password:
65+
* `appleId` String - The username of your apple developer account
66+
* `appleIdPassword` String - The [app-specific password](https://support.apple.com/HT204397) (not your Apple ID password).
67+
* ... or apiKey with apiIssuer:
68+
* `appleApiKey` String - Required for JWT authentication. See Note on JWT authentication below.
69+
* `appleApiIssuer` String - Issuer ID. Required if `appleApiKey` is specified.
7070

7171
## Safety when using `appleIdPassword`
7272

src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { delay } from './helpers';
33
import { startLegacyNotarize, waitForLegacyNotarize } from './legacy';
44
import { isNotaryToolAvailable, notarizeAndWaitForNotaryTool } from './notarytool';
55
import { stapleApp } from './staple';
6-
import { NotarizeOptions } from './types';
6+
import { NotarizeOptions, NotaryToolStartOptions } from './types';
77

88
const d = debug('electron-notarize');
99

@@ -12,17 +12,7 @@ export { NotarizeOptions };
1212
export { validateLegacyAuthorizationArgs as validateAuthorizationArgs } from './validate-args';
1313

1414
export async function notarize({ appPath, ...otherOptions }: NotarizeOptions) {
15-
if (otherOptions.tool === 'notarytool') {
16-
d('notarizing using the new notarytool system');
17-
if (!(await isNotaryToolAvailable())) {
18-
throw new Error('notarytool is not available, you must be on at least Xcode 13');
19-
}
20-
21-
await notarizeAndWaitForNotaryTool({
22-
appPath,
23-
...otherOptions,
24-
});
25-
} else {
15+
if (otherOptions.tool === 'legacy') {
2616
console.warn(
2717
'Notarizing using the legacy altool system. The altool system will be disabled on November 1 2023. Please switch to the notarytool system before then.',
2818
);
@@ -46,6 +36,16 @@ export async function notarize({ appPath, ...otherOptions }: NotarizeOptions) {
4636
await delay(10000);
4737
d('starting to poll for notarization status');
4838
await waitForLegacyNotarize({ uuid, ...otherOptions });
39+
} else {
40+
d('notarizing using the new notarytool system');
41+
if (!(await isNotaryToolAvailable())) {
42+
throw new Error('notarytool is not available, you must be on at least Xcode 13');
43+
}
44+
45+
await notarizeAndWaitForNotaryTool({
46+
appPath,
47+
...otherOptions,
48+
} as NotaryToolStartOptions);
4949
}
5050

5151
await stapleApp({ appPath });

0 commit comments

Comments
 (0)