@rightkit/release 0.2.78 → 0.2.80

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.
@@ -75,10 +75,15 @@ export function createPortableArchive({ sourceDir, outputPath, commandRunner = s
75
75
  const source = realpathSync(sourceDir);
76
76
  const outputDir = resolve(dirname(outputPath));
77
77
  mkdirSync(outputDir, { recursive: true });
78
- // GNU tar reads a colon in -f as a remote host spec, so an absolute
79
- // Windows path (C:\...) fails with "Cannot connect to C:". Run from the
80
- // output directory and pass a bare filename instead.
81
- const result = commandRunner("tar", ["-a", "-c", "-f", basename(outputPath), "-C", source, "."], {
78
+ // On Windows, resolve the System32 bsdtar explicitly: PATH often finds GNU
79
+ // tar (Git Bash) first, which reads a colon in -f as a remote host spec and
80
+ // cannot write zip at all — its -a silently emits plain tar bytes for a
81
+ // .zip suffix. bsdtar writes a real zip. Run from the output directory with
82
+ // a bare filename so the invocation stays safe under either tar.
83
+ const tarProgram = process.platform === "win32"
84
+ ? join(process.env.SystemRoot ?? "C:\\Windows", "System32", "tar.exe")
85
+ : "tar";
86
+ const result = commandRunner(tarProgram, ["-a", "-c", "-f", basename(outputPath), "-C", source, "."], {
82
87
  cwd: outputDir,
83
88
  encoding: "utf8",
84
89
  windowsHide: true,
@@ -227,7 +227,18 @@ export function validateNativeFinalizationOutput(output, {
227
227
  throw new Error("native finalizer archive digest mismatch");
228
228
  }
229
229
  if (output.archive?.path != null && PLACEHOLDER.test(String(output.archive.path))) throw new Error("native finalizer archive path is a placeholder");
230
- return { ...output, provenance, signedArtifacts: signed, ...(archiveSha256 ? { archiveSha256 } : {}) };
230
+ // Echo the canonical signed set only when the finalizer actually declared
231
+ // one. Injecting `signedArtifacts: []` into an output that never mentioned
232
+ // signed artifacts turns "not declared" into a declared-empty identity,
233
+ // which createNativeFinalizationReceipt then rejects against the real
234
+ // signed set as an identity mismatch.
235
+ const declaredSigned = output.signedArtifacts != null || output.signed != null;
236
+ return {
237
+ ...output,
238
+ provenance,
239
+ ...(declaredSigned ? { signedArtifacts: signed } : {}),
240
+ ...(archiveSha256 ? { archiveSha256 } : {}),
241
+ };
231
242
  }
232
243
 
233
244
  export const validateNativeFinalization = validateNativeFinalizationOutput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.78",
3
+ "version": "0.2.80",
4
4
  "description": "Portable Right Suite release CLI/SDK: signed native archives, direct bootstrap transactions, immutable GitHub Release upload, R2 bootstrap publication, and add-on adoption.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -3,7 +3,7 @@ import { createHash } from 'node:crypto';
3
3
  import { execFileSync } from 'node:child_process';
4
4
  import { mkdtemp, mkdir, readFile, readdir, rm, writeFile } from 'node:fs/promises';
5
5
  import { tmpdir } from 'node:os';
6
- import { basename, join } from 'node:path';
6
+ import { basename, join, relative } from 'node:path';
7
7
  import { fileURLToPath, pathToFileURL } from 'node:url';
8
8
 
9
9
  const packageRoot = fileURLToPath(new URL('.', import.meta.url));
@@ -58,7 +58,10 @@ function runPnpm(args, options = {}) {
58
58
 
59
59
  async function extract(archive, destination) {
60
60
  await mkdir(destination, { recursive: true });
61
- execFileSync('tar', ['-xzf', archive, '-C', destination], { stdio: 'pipe' });
61
+ // GNU tar reads the colon in an absolute Windows path (C:\...) as a remote
62
+ // host spec, and MSYS tar rejects absolute Windows -C targets; run from the
63
+ // destination with a relative archive path so no absolute path reaches tar.
64
+ execFileSync('tar', ['-xzf', relative(destination, archive)], { cwd: destination, stdio: 'pipe' });
62
65
  return join(destination, 'package');
63
66
  }
64
67
 
@@ -22,7 +22,7 @@
22
22
  "@rightkit/logs": "0.1.4",
23
23
  "@rightkit/platform-ui": "0.1.1",
24
24
  "@rightkit/qa": "0.2.1",
25
- "@rightkit/release": "0.2.78",
25
+ "@rightkit/release": "0.2.80",
26
26
  "@rightkit/tauri": "0.1.1",
27
27
  "@rightkit/updates": "0.2.4"
28
28
  },