@rightkit/release 0.6.40 → 0.6.43
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.
- package/README.md +110 -11
- package/admission-files.mjs +40 -0
- package/admission-host.mjs +2 -1
- package/app-check.mjs +303 -16
- package/app-closure.mjs +6 -4
- package/bin/rightkit-gate.mjs +180 -32
- package/cargo-contract.mjs +17 -31
- package/cargo-license-notices.mjs +129 -19
- package/cargo-target-shim.mjs +14 -0
- package/carried-cargo.mjs +2 -4
- package/cli/right-release.mjs +24 -2
- package/cross-targets.mjs +24 -0
- package/deterministic-scans.mjs +150 -58
- package/development-signing.mjs +25 -2
- package/development.mjs +34 -1
- package/direct-release-command.mjs +154 -0
- package/disk-policy.mjs +16 -0
- package/feature-coverage.mjs +134 -0
- package/gate-coverage.mjs +38 -0
- package/gate-stages.mjs +1 -0
- package/ghsa-audit.mjs +95 -0
- package/install-app.mjs +33 -5
- package/install-channels.mjs +301 -0
- package/interactive-session-run.mjs +105 -0
- package/legal-contract.mjs +10 -1
- package/legion-freeze-consumer.mjs +241 -0
- package/linux-publish.mjs +136 -0
- package/local-publish.mjs +31 -8
- package/nsis-pack.mjs +95 -0
- package/nsis-upgrade-template.mjs +93 -0
- package/outdated-command.mjs +19 -0
- package/ownership-class-rules.mjs +32 -10
- package/ownership-mandatory-set.json +23 -0
- package/ownership-mandatory-set.mjs +66 -8
- package/package-recipe-targets.mjs +54 -19
- package/package.json +1 -1
- package/payload-root-install.mjs +123 -0
- package/plugin-delivery.mjs +141 -0
- package/prebuild-gates.mjs +8 -4
- package/preflight.mjs +6 -1
- package/provision-model-bundle.mjs +172 -0
- package/pub-upload.mjs +1 -1
- package/publish-local-npm.mjs +34 -9
- package/publish-retention.mjs +106 -0
- package/publish-update.mjs +15 -8
- package/qa-build-features.mjs +24 -15
- package/qa-contract.mjs +5 -6
- package/qa-control-scan.mjs +14 -0
- package/qa-web-pairing.mjs +76 -0
- package/r2-s3-multipart.mjs +190 -0
- package/r2-verified-upload.mjs +28 -16
- package/recipe-build.mjs +53 -3
- package/release-checks.mjs +53 -2
- package/release-config.mjs +8 -3
- package/release-invocation.mjs +12 -2
- package/release-pin-floor.mjs +44 -0
- package/release-qa-audit.mjs +18 -2
- package/release-qa-command.mjs +17 -1
- package/release-qa-policy.mjs +30 -3
- package/release-switch-cfg.mjs +271 -0
- package/release-switch-registry.json +60 -1
- package/release-switch-scan.mjs +398 -23
- package/release.mjs +97 -6
- package/render-views.mjs +141 -0
- package/rightkit-registry-resolver.mjs +1 -1
- package/rightkit-versions.json +140 -103
- package/runtime-artifact-manifest.mjs +9 -0
- package/runtime-manifest-refresh.mjs +88 -0
- package/rustright-stage.mjs +197 -0
- package/scan-digest.mjs +15 -9
- package/scan-tool-enrolment.mjs +1 -1
- package/security-policy.mjs +196 -0
- package/shell-contract.mjs +32 -0
- package/snapshot-broker.mjs +8 -1
- package/snapshot-check.mjs +59 -1
- package/snapshot-identity.mjs +48 -0
- package/snapshot-request.mjs +25 -2
- package/snapshot.mjs +69 -9
- package/stage-commands.mjs +33 -4
- package/stage-ledger.mjs +5 -0
- package/stage-receipt.mjs +115 -0
- package/stage-sidecar.mjs +188 -17
- package/stage-xcframework.mjs +118 -0
- package/suite-api.generated.mjs +16 -1
- package/unit-gate.mjs +14 -2
- package/upload-large.mjs +4 -4
- package/upload-release.mjs +6 -0
- package/win-package-recipe.mjs +26 -4
package/upload-release.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { defaultReleaseConfigFile } from "./release-config.mjs";
|
|
|
7
7
|
import { authorizeGitHubUpload } from "./github-upload-gate.mjs";
|
|
8
8
|
import { recordPublishedVersion } from "./artifact-storage.mjs";
|
|
9
9
|
import { admitInstalledQa } from "./release-qa-audit.mjs";
|
|
10
|
+
import { retainAfterPublish } from "./publish-retention.mjs";
|
|
10
11
|
|
|
11
12
|
const args = process.argv.slice(2);
|
|
12
13
|
let platform = process.platform === "win32" ? "win" : process.platform === "darwin" ? "mac" : process.platform;
|
|
@@ -81,6 +82,11 @@ if (!dryRun) writeJson(verifiedMarker, {
|
|
|
81
82
|
// Candidate builds never enter published.json.
|
|
82
83
|
if (!dryRun) recordPublishedVersion({ app: sealed.manifest.app, version: sealed.manifest.version, platform });
|
|
83
84
|
console.log(`right-release upload: ${dryRun ? "dry-run " : ""}${result.status} ${releaseId} tier=${tier} repo=${repo}`);
|
|
85
|
+
// Only after the remote bytes were verified: bound what the sealed and state folders keep by count and age, and fail loudly above the size limit (rightkit#763).
|
|
86
|
+
if (!dryRun) {
|
|
87
|
+
try { retainAfterPublish({ root: repoRoot, keep: { releaseId }, log: (line) => console.log(line) }); }
|
|
88
|
+
catch (error) { console.error(`right-release upload: published, but ${error.message}`); process.exitCode = 1; }
|
|
89
|
+
}
|
|
84
90
|
|
|
85
91
|
function writeJson(file, value) {
|
|
86
92
|
mkdirSync(path.dirname(file), { recursive: true });
|
package/win-package-recipe.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import { resolveCommand } from "./development.mjs";
|
|
|
25
25
|
import { verifyNsisEmbeddedBinary } from "./nsis-payload.mjs";
|
|
26
26
|
import { resolveArtifactPath, splitArtifactContext } from "./release-artifact-path.mjs";
|
|
27
27
|
import { signingReceiptPath } from "./signing-receipts.mjs";
|
|
28
|
+
import { defaultManagedRoots, isUnderManagedRoot } from "./managed-target-stage.mjs";
|
|
28
29
|
import { patchTauriBundleType } from "./tauri-bundle-marker.mjs";
|
|
29
30
|
|
|
30
31
|
const TOOL_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -81,11 +82,25 @@ function relativeInside(appRoot, value, label, issues) {
|
|
|
81
82
|
return resolved;
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* An artifact path under a broker-managed root (the RustRight data root, .rightkit-managed, rightkit-build-control) may be absolute
|
|
87
|
+
* (rightkit#717): the raw EXE and the NSIS installer of a managed Cargo target live there, and the Authenticode-before-NSIS contract
|
|
88
|
+
* must address them where Tauri writes them. Anything absolute outside a managed root, or with a `..` segment, is still refused.
|
|
89
|
+
*/
|
|
90
|
+
function managedAbsolute(value, label, issues, managedRoots) {
|
|
91
|
+
if (typeof value !== "string" || value.trim() === "" || value !== value.trim() || value.includes("\0")) return undefined;
|
|
92
|
+
if (!(path.win32.isAbsolute(value) || path.posix.isAbsolute(value))) return undefined;
|
|
93
|
+
if (value.replaceAll("\\", "/").split("/").includes("..")) { issues.push(`${label} must not contain .., received ${JSON.stringify(value)}`); return null; }
|
|
94
|
+
if (!path.isAbsolute(value)) return undefined;
|
|
95
|
+
if (!isUnderManagedRoot(path.dirname(value), managedRoots)) return undefined;
|
|
96
|
+
return path.resolve(value);
|
|
97
|
+
}
|
|
98
|
+
|
|
84
99
|
/**
|
|
85
100
|
* Validate `target.winPackage` strictly and return the normalised plan. Throws WinPackageConfigError listing
|
|
86
101
|
* every problem. Unknown keys are refused so a typo cannot silently drop a sidecar or the updater step.
|
|
87
102
|
*/
|
|
88
|
-
export function validateWinPackage({ appRoot, config = {}, target } = {}) {
|
|
103
|
+
export function validateWinPackage({ appRoot, config = {}, target, env = process.env, managedRoots = defaultManagedRoots(env) } = {}) {
|
|
89
104
|
const issues = [];
|
|
90
105
|
if (typeof appRoot !== "string" || appRoot === "") issues.push("appRoot must be a non-empty string");
|
|
91
106
|
if (!isPlainObject(target)) throw new WinPackageConfigError([...issues, "target must be an object"]);
|
|
@@ -109,8 +124,14 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
|
|
|
109
124
|
const installerDeclared = spec.installerFile ?? (Array.isArray(target.sign?.files) && target.sign.files.length === 1 ? target.sign.files[0] : undefined);
|
|
110
125
|
if (rawDeclared === undefined) issues.push("the raw EXE path is unknown: set winPackage.rawExe or exactly one target.sign.prePackageFiles entry");
|
|
111
126
|
if (installerDeclared === undefined) issues.push("the installer path is unknown: set winPackage.installerFile or exactly one target.sign.files entry");
|
|
112
|
-
const
|
|
113
|
-
|
|
127
|
+
const artifactPath = (declared, label) => {
|
|
128
|
+
if (declared === undefined) return { file: null, managed: false };
|
|
129
|
+
const absolute = managedAbsolute(declared, label, issues, managedRoots);
|
|
130
|
+
if (absolute === null) return { file: null, managed: false };
|
|
131
|
+
return absolute ? { file: absolute, managed: true } : { file: relativeInside(appRoot, declared, label, issues), managed: false };
|
|
132
|
+
};
|
|
133
|
+
const { file: rawExe, managed: rawExeManaged } = artifactPath(rawDeclared, "rawExe");
|
|
134
|
+
const { file: installerFile, managed: installerFileManaged } = artifactPath(installerDeclared, "installerFile");
|
|
114
135
|
if (rawExe && !/\.exe$/i.test(rawExe)) issues.push(`rawExe must be an .exe, received ${rawDeclared}`);
|
|
115
136
|
if (installerFile && !/\.exe$/i.test(installerFile)) issues.push(`installerFile must be an .exe, received ${installerDeclared}`);
|
|
116
137
|
if (rawExe && installerFile && rawExe.toLowerCase() === installerFile.toLowerCase()) issues.push("rawExe and installerFile must be different files");
|
|
@@ -147,6 +168,7 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
|
|
|
147
168
|
triple,
|
|
148
169
|
rawExe,
|
|
149
170
|
installerFile,
|
|
171
|
+
managed: Object.freeze({ rawExe: rawExeManaged, installerFile: installerFileManaged }),
|
|
150
172
|
sidecars: Object.freeze(sidecars),
|
|
151
173
|
tauriCwd,
|
|
152
174
|
});
|
|
@@ -286,7 +308,7 @@ export function runWinPackageRecipe({ appRoot, config = {}, target, deps = {} }
|
|
|
286
308
|
|
|
287
309
|
phase("build", () => {
|
|
288
310
|
if (!dry) fs.rmSync(rawExe, { force: true });
|
|
289
|
-
tauri(["build", "--no-bundle", "--target", plan.triple], quiet);
|
|
311
|
+
tauri(["build", "--no-bundle", "--target", plan.triple, "--", "--locked"], quiet); // the reviewed lockfile only (rightkit#725)
|
|
290
312
|
if (dry) return;
|
|
291
313
|
raw = locate(rawExe, { env, fs, split });
|
|
292
314
|
if (!fs.existsSync(raw)) throw new Error(`tauri build did not produce the raw EXE: ${rawExe}`);
|