@rightkit/release 0.2.91 → 0.2.92
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/package.json +2 -2
- package/publish-update.mjs +7 -4
- package/rightkit-versions.json +3 -2
- package/upload-release.mjs +14 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rightkit/release",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Portable
|
|
3
|
+
"version": "0.2.92",
|
|
4
|
+
"description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
package/publish-update.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const API_BASE = process.env.RIGHTAPPS_API_URL || "https://api.spoares.com";
|
|
|
14
14
|
const DOWNLOAD_BASE = process.env.RIGHTAPPS_UPDATE_DOWNLOAD_BASE || "https://rightapps-license-gate.adrdsouza.workers.dev";
|
|
15
15
|
const PUBLIC_BASE = process.env.RIGHTAPPS_PUBLIC_DOWNLOAD_BASE || "https://pub-6c73208d46c245a9b4881d5e02f6b618.r2.dev";
|
|
16
16
|
const PIPELINE_VERSION = JSON.parse(await readFile(path.join(TOOL_ROOT, "package.json"), "utf8")).version;
|
|
17
|
-
|
|
17
|
+
let tier = process.env.RIGHT_RELEASE_TIER || "";
|
|
18
18
|
const args = process.argv.slice(2);
|
|
19
19
|
let configName = "right-release.config.mjs";
|
|
20
20
|
let platform = process.platform === "win32" ? "win" : "mac";
|
|
@@ -24,17 +24,20 @@ for (let i = 0; i < args.length; i++) {
|
|
|
24
24
|
const arg = args[i];
|
|
25
25
|
if (arg === "--config") configName = args[++i];
|
|
26
26
|
else if (arg === "--platform") platform = args[++i];
|
|
27
|
+
else if (arg === "--tier") tier = args[++i];
|
|
28
|
+
else if (arg.startsWith("--tier=")) tier = arg.slice("--tier=".length);
|
|
27
29
|
else if (arg === "--dry-run") dryRun = true;
|
|
28
30
|
else fail(`unknown argument: ${arg}`);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
if (tier !== "patch" && tier !== "update")
|
|
32
|
-
fail("RIGHT_RELEASE_TIER is required (patch|update)");
|
|
33
|
-
}
|
|
33
|
+
if (tier !== "patch" && tier !== "update") fail("tier is required (--tier patch|update or RIGHT_RELEASE_TIER)");
|
|
34
34
|
|
|
35
35
|
const configPath = path.resolve(configName);
|
|
36
36
|
const root = path.dirname(configPath);
|
|
37
37
|
const config = (await import(pathToFileURL(configPath))).default;
|
|
38
|
+
if (config?.distribution?.provider !== "r2-rightapps") {
|
|
39
|
+
fail("release config distribution.provider must be r2-rightapps");
|
|
40
|
+
}
|
|
38
41
|
const target = config?.targets?.[platform];
|
|
39
42
|
const artifacts = target?.updater?.artifacts ?? [];
|
|
40
43
|
const installers = target?.installer?.artifacts ?? [];
|
package/rightkit-versions.json
CHANGED
|
@@ -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.
|
|
25
|
+
"@rightkit/release": "0.2.92",
|
|
26
26
|
"@rightkit/tauri": "0.1.1",
|
|
27
27
|
"@rightkit/updates": "0.2.4"
|
|
28
28
|
},
|
|
@@ -93,7 +93,8 @@
|
|
|
93
93
|
"0.2.75",
|
|
94
94
|
"0.2.76",
|
|
95
95
|
"0.2.82",
|
|
96
|
-
"0.2.83"
|
|
96
|
+
"0.2.83",
|
|
97
|
+
"0.2.91"
|
|
97
98
|
],
|
|
98
99
|
"@rightkit/qa": [
|
|
99
100
|
"0.1.0",
|
package/upload-release.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
|
-
import { prepareGitHubRelease, publishGitHubRelease
|
|
6
|
+
import { prepareGitHubRelease, publishGitHubRelease } from "./github-release.mjs";
|
|
7
7
|
import { assertPrimaryReleaseCheckout } from "./release-invocation.mjs";
|
|
8
8
|
import { verifySealedRelease } from "./release-state.mjs";
|
|
9
9
|
import { assertCleanSource } from "./source-gate.mjs";
|
|
@@ -43,22 +43,23 @@ const platformDir = platform === "win" ? "windows" : "mac";
|
|
|
43
43
|
const sealed = verifySealedRelease(path.join(repoRoot, ".right-release", "sealed", releaseId, platformDir));
|
|
44
44
|
if (sealed.manifest.commit !== candidateCommit) fail("sealed release was built from a different commit than the current checkout");
|
|
45
45
|
|
|
46
|
+
const configPath = path.resolve(configName);
|
|
47
|
+
if (!existsSync(configPath)) fail(`release config is required: ${configName}`);
|
|
48
|
+
const releaseConfig = (await import(`${pathToFileURL(configPath).href}?upload=${Date.now()}`)).default;
|
|
49
|
+
if (releaseConfig?.distribution?.provider !== "github-releases") {
|
|
50
|
+
fail("release config distribution.provider must be github-releases");
|
|
51
|
+
}
|
|
52
|
+
const configuredRepo = releaseConfig?.distribution?.repository ?? "";
|
|
53
|
+
if (!configuredRepo) fail("release config distribution.repository is required for github-releases");
|
|
54
|
+
if (repo && repo !== configuredRepo) fail(`--repo must match configured distribution.repository (${configuredRepo})`);
|
|
55
|
+
repo = configuredRepo;
|
|
56
|
+
|
|
46
57
|
const stateRoot = path.join(repoRoot, ".right-release", "state", releaseId, platformDir);
|
|
47
|
-
const verifiedMarker = path.join(stateRoot, `verified-${tier}.json`);
|
|
58
|
+
const verifiedMarker = path.join(stateRoot, `verified-${tier}-github-releases.json`);
|
|
48
59
|
if (existsSync(verifiedMarker)) {
|
|
49
|
-
console.log(`right-release upload: already verified ${releaseId} tier=${tier}`);
|
|
60
|
+
console.log(`right-release upload: already verified ${releaseId} tier=${tier} provider=github-releases`);
|
|
50
61
|
process.exit(0);
|
|
51
62
|
}
|
|
52
|
-
|
|
53
|
-
const configPath = path.resolve(configName);
|
|
54
|
-
if (existsSync(configPath)) {
|
|
55
|
-
const releaseConfig = (await import(`${pathToFileURL(configPath).href}?upload=${Date.now()}`)).default;
|
|
56
|
-
if (releaseConfig?.distribution?.provider && releaseConfig.distribution.provider !== "github-releases") {
|
|
57
|
-
fail("release config distribution.provider must be github-releases");
|
|
58
|
-
}
|
|
59
|
-
repo ||= releaseConfig?.distribution?.repository ?? "";
|
|
60
|
-
}
|
|
61
|
-
repo ||= repositoryFromRemote(repoRoot);
|
|
62
63
|
const plan = prepareGitHubRelease({ repoRoot, releaseId, platform, repo });
|
|
63
64
|
const result = publishGitHubRelease(plan, { repo, dryRun });
|
|
64
65
|
if (!dryRun) writeJson(verifiedMarker, {
|