@rightkit/release 0.6.3 → 0.6.4

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.
@@ -130,6 +130,9 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
130
130
  }
131
131
  }
132
132
  if (spec.updater === true && target.updater !== undefined && !isPlainObject(target.updater)) issues.push("target.updater must be an object when winPackage.updater is true");
133
+ if (isPlainObject(target.updater) && Object.prototype.hasOwnProperty.call(target.updater, "keyFile")) {
134
+ issues.push("target.updater.keyFile is not supported: updater signing keys come from the OS credential provider (rightkit-credentials, namespace rightsuite-updater-key; see protected-credentials.mjs and sign-updater.mjs), never from a key file. Remove updater.keyFile");
135
+ }
133
136
 
134
137
  if (issues.length) throw new WinPackageConfigError(issues);
135
138
  return Object.freeze({
@@ -142,7 +145,6 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
142
145
  installerFile,
143
146
  sidecars: Object.freeze(sidecars),
144
147
  tauriCwd,
145
- updaterKeyFile: typeof target.updater?.keyFile === "string" ? target.updater.keyFile : null,
146
148
  });
147
149
  }
148
150
 
@@ -181,11 +183,12 @@ export function defaultWinPackageDeps({ appRoot, target, env }) {
181
183
  const evidence = JSON.parse(readFileSync(receipt, "utf8"));
182
184
  return evidence.files.map((item) => ({ file: path.resolve(item.file), sha256: item.after?.sha256 }));
183
185
  },
184
- signUpdater(file, { keyFile, dryRun = false }) {
186
+ // The signing key comes from the OS credential provider inside sign-updater; no key path is ever passed down.
187
+ signUpdater(file, { dryRun = false } = {}) {
185
188
  const childEnv = { ...env };
186
189
  delete childEnv.TAURI_SIGNING_PRIVATE_KEY;
187
190
  delete childEnv.TAURI_SIGNING_PRIVATE_KEY_PASSWORD;
188
- const result = spawn("node", [SIGN_UPDATER, "--file", file, ...(dryRun ? ["--dry-run"] : []), ...(keyFile ? ["--key-file", keyFile] : [])], { cwd: appRoot, env: childEnv });
191
+ const result = spawn("node", [SIGN_UPDATER, "--file", file, ...(dryRun ? ["--dry-run"] : [])], { cwd: appRoot, env: childEnv });
189
192
  if (result.error || result.status !== 0) throw new Error(`sign-updater exited ${result.status ?? result.error?.message}`);
190
193
  },
191
194
  patchMarker: (file, options) => patchTauriBundleType(file, options),
@@ -299,7 +302,7 @@ export function runWinPackageRecipe({ appRoot, config = {}, target, deps = {} }
299
302
  if (plan.updater) {
300
303
  phase("updater", () => {
301
304
  if (!dry) fs.rmSync(`${installer}.sig`, { force: true });
302
- d.signUpdater(installer, { keyFile: plan.updaterKeyFile, dryRun: dry });
305
+ d.signUpdater(installer, { dryRun: dry });
303
306
  if (dry) return;
304
307
  if (!fs.existsSync(`${installer}.sig`)) throw new Error(`sign-updater did not write ${installer}.sig`);
305
308
  updaterSignature = `${installer}.sig`;