@crossbind/extension-app-store 2.0.0-beta.79 → 2.0.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,9 +21,11 @@ const NO_APP_ID = 'crossbind: App Store Connect knows an app by its bundle id, a
21
21
  const NO_TEAM = "crossbind: App Store Connect takes uploads from an Apple Developer Program team, which neither app.team in crossbind.config.js nor this machine's XCODE_DEVELOPMENT_TEAM names: set either to its id, which developer.apple.com/account shows under Membership details.";
22
22
  const NO_CATEGORY = 'crossbind: the Mac App Store takes no app without its category: set app.category in crossbind.config.js.';
23
23
  const NO_ENCRYPTION = 'crossbind: app.encryption is not set, so App Store Connect asks whether this build uses encryption before TestFlight hands it out; set it in crossbind.config.js to answer for every build.';
24
- const NO_KEY_TO_RELEASE = "crossbind: crossbind app release hands the version to App Review through App Store Connect's API, which takes an API key: set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, as app.md's Publishing says.";
25
- const NO_KEY_TO_SEND = "crossbind: crossbind app store --send sends the page through App Store Connect's API, which takes an API key: set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, as app.md's Publishing says.";
26
- const NO_KEY_TO_SEE = "Set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, an App Store Connect API key's, to see what App Store Connect has.";
24
+ // Where an App Store Connect API key comes from: this machine's ~/.crossbind/config.json, or the environment, as in CI.
25
+ const KEY_SETTINGS = 'crossbind config set APPLE_API_KEY <its .p8 file> and APPLE_API_ISSUER <its issuer ID>, or CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, as in CI';
26
+ const NO_KEY_TO_RELEASE = `crossbind: crossbind app release hands the version to App Review through App Store Connect's API, which takes an API key: set one with ${KEY_SETTINGS}, as app.md's Publishing says.`;
27
+ const NO_KEY_TO_SEND = `crossbind: crossbind app store --send sends the page through App Store Connect's API, which takes an API key: set one with ${KEY_SETTINGS}, as app.md's Publishing says.`;
28
+ const NO_KEY_TO_SEE = `Set an App Store Connect API key with ${KEY_SETTINGS}, to see what App Store Connect has.`;
27
29
  const TEAM_ID = /^[A-Z0-9]{10}$/;
28
30
  const noIcon = (platform) => `crossbind: App Store Connect takes no ${platform} app without an icon: set app.icon in crossbind.config.js to a square PNG, at best 1024 × 1024.`;
29
31
  const notOnMac = (id, then = 'upload again, or upload the iOS app alone with -p ios') => `crossbind: App Store Connect's app ${id} is not on macOS yet: add the platform there, with the + beside its platform in the sidebar, which makes it a universal purchase, then ${then}.`;
@@ -69,8 +71,8 @@ async function askTeam(api) {
69
71
  }
70
72
  }
71
73
  api.settings.set({ XCODE_DEVELOPMENT_TEAM: id });
72
- if (api.app.team !== id) throw new Error(`crossbind: ~/.crossbind.json did not take XCODE_DEVELOPMENT_TEAM: set app.team: '${id}' in crossbind.config.js.`);
73
- api.log(`crossbind: ~/.crossbind.json keeps ${id} as XCODE_DEVELOPMENT_TEAM.`);
74
+ if (api.app.team !== id) throw new Error(`crossbind: ~/.crossbind/config.json did not take XCODE_DEVELOPMENT_TEAM: set app.team: '${id}' in crossbind.config.js.`);
75
+ api.log(`crossbind: ~/.crossbind/config.json keeps ${id} as XCODE_DEVELOPMENT_TEAM.`);
74
76
  }
75
77
 
76
78
  // The minimum macOS release of the store's build: the app's own where it is later.
@@ -181,12 +183,13 @@ async function uploadIos(api, { key, dsyms, facts }, { project }) {
181
183
  return { published: { appId: facts.id, version: api.app.appleVersion, build } };
182
184
  }
183
185
 
184
- // Puts the macOS app crossbind built in an archive Xcode exports to App Store Connect, which signs it and its installer
185
- // package in the cloud.
186
- async function uploadMac(api, { key, facts }, { apps }) {
186
+ // Puts the macOS app crossbind built in an archive, with its dSYM and Hermes', which Xcode exports to App Store Connect,
187
+ // which signs it and its installer package in the cloud.
188
+ async function uploadMac(api, { key, dsyms, facts }, { apps }) {
187
189
  const [built] = apps;
188
190
  if (!built) throw new Error('crossbind: the build made no macOS app, so nothing went to App Store Connect.');
189
191
  const archive = writeArchive(api, built, { team: facts.team });
192
+ addDsyms(archive, dsyms);
190
193
  const build = api.app.buildNumber;
191
194
  api.log(`crossbind: uploading the app to App Store Connect for team ${facts.team} with ${key ? `the API key ${key.keyId}` : "Xcode's account"}, which signs it and its installer package.`);
192
195
  await untilDone(api, () => uploadArchive(api, archive, {
@@ -278,9 +281,9 @@ export default function appStore() {
278
281
  const unready = await macRecordMissing(api, key);
279
282
  if (unready.length > 0) return { missing: unready };
280
283
  const facts = { id: api.app.id, team: api.app.team };
281
- const dsyms = api.platform === 'ios' ? { dsyms: await api.apple.dsyms() } : {};
284
+ const dsyms = await api.apple.dsyms();
282
285
  api.log(`crossbind: publishing ${facts.id} ${api.app.appleVersion} for ${platform.name} to App Store Connect for team ${facts.team}; building the app first.`);
283
- return { session: { key, ...dsyms, facts } };
286
+ return { session: { key, dsyms, facts } };
284
287
  },
285
288
 
286
289
  // Xcode numbers a build without CROSSBIND_APP_BUILD_NUMBER after those App Store Connect has.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossbind/extension-app-store",
3
- "version": "2.0.0-beta.79",
3
+ "version": "2.0.0-beta.81",
4
4
  "description": "crossbind app extension: uploads an iOS or a macOS app to App Store Connect, for TestFlight and App Review.",
5
5
  "homepage": "https://github.com/crossbind/crossbind/tree/main/extensions/app-store#readme",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "extension": "./crossbind.extension.js"
21
21
  },
22
22
  "dependencies": {
23
- "@crossbind/core-store-kit": "^2.0.0-beta.79"
23
+ "@crossbind/core-store-kit": "^2.0.0-beta.80"
24
24
  },
25
25
  "keywords": [
26
26
  "crossbind-extension",
@@ -102,7 +102,7 @@ export function appStoreGuide(api) {
102
102
  ...lackedSteps(listings, settings),
103
103
  ...(api.app.encryption === null ? [{ text: 'Set app.encryption in crossbind.config.js, whose answer App Store Connect takes of every build and App Review of every submission.' }] : []),
104
104
  ...(api.app.encryption === true ? [{ text: 'App Information › App Encryption Documentation: what export compliance takes of an app that uses encryption.' }] : []),
105
- { text: "For --send, releases and CI: Users and Access › Integrations › App Store Connect API: a key of the App Manager or Admin role, as CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER; Apple signs the uploads of an Admin key in the cloud, as it does those of Xcode's account on your Mac.", url: API_KEYS },
105
+ { text: "For --send, releases and CI: Users and Access › Integrations › App Store Connect API: a key of the App Manager or Admin role, which crossbind config set APPLE_API_KEY <its .p8 file> and APPLE_API_ISSUER <its issuer ID> keep on this Mac, and CI gives as CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER. Uploads then go with the key too: Apple signs the uploads of an Admin key in the cloud, as it does those of Xcode's account on your Mac.", url: API_KEYS },
106
106
  ];
107
107
  return {
108
108
  uploads, sends, releases, problems, where: 'App Store Connect', steps,
package/src/macArchive.js CHANGED
@@ -28,8 +28,8 @@ const plist = (root) => [
28
28
  ].join('\n');
29
29
 
30
30
  // The archive Xcode exports for App Store Connect, of the app crossbind built and signed ad hoc, as an archive of Xcode's
31
- // own holds one: the app under Products/Applications, and an Info.plist that names it, its version and its team. Xcode
32
- // takes the app's entitlements from its signature.
31
+ // own holds one: the app under Products/Applications, its dSYM under dSYMs, and an Info.plist that names it, its version
32
+ // and its team. Xcode takes the app's entitlements from its signature.
33
33
  export function writeArchive(api, { app, arch }, { team }) {
34
34
  const name = path.basename(app, '.app');
35
35
  const archive = path.join(api.workDir, `${name}.xcarchive`);
@@ -56,5 +56,12 @@ export function writeArchive(api, { app, arch }, { team }) {
56
56
  Name: name,
57
57
  SchemeName: name,
58
58
  }));
59
+ // App Store Connect asks for the dSYM of each binary. crossbind builds a macOS app without debug information, so its
60
+ // dSYM holds the symbols the binary keeps, which give crash reports functions without files and lines.
61
+ const binary = path.join(applications, path.basename(app), 'Contents', 'MacOS', name);
62
+ const dsym = spawnSync('dsymutil', [binary, '-o', path.join(archive, 'dSYMs', `${path.basename(app)}.dSYM`)], { encoding: 'utf8' });
63
+ if (dsym.error || dsym.status !== 0) {
64
+ throw new Error(`crossbind: dsymutil could not write the dSYM of ${binary}: ${(dsym.stderr || dsym.error?.message || '').trim()}`);
65
+ }
59
66
  return archive;
60
67
  }