@intentius/chant 0.124.62 → 0.124.63
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/dist/cli/handlers/approve.d.ts +18 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +142 -16
- package/dist/cli/handlers/plan.d.ts +10 -0
- package/dist/cli/handlers/plan.d.ts.map +1 -0
- package/dist/cli/handlers/plan.js +71 -0
- package/dist/cli/handlers/release.d.ts +6 -4
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +13 -7
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +34 -5
- package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-tools.js +2 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +31 -0
- package/dist/cli/registry.d.ts +13 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/config.d.ts +32 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/gate-decision.d.ts +1 -1
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +4 -2
- package/dist/gate-statement.schema.json +44 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +20 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts.map +1 -1
- package/dist/lifecycle/__fixtures__/publish-fakes.js +119 -3
- package/dist/lifecycle/gate-ledger.d.ts +17 -3
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-seal.d.ts +39 -3
- package/dist/lifecycle/gate-seal.d.ts.map +1 -1
- package/dist/lifecycle/gate-seal.js +50 -10
- package/dist/lifecycle/gate-statement.d.ts +70 -0
- package/dist/lifecycle/gate-statement.d.ts.map +1 -0
- package/dist/lifecycle/gate-statement.js +74 -0
- package/dist/lifecycle/gate-webauthn.d.ts +79 -0
- package/dist/lifecycle/gate-webauthn.d.ts.map +1 -0
- package/dist/lifecycle/gate-webauthn.js +105 -0
- package/dist/lifecycle/git.d.ts +1 -1
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +24 -19
- package/dist/lifecycle/ledger-remote.d.ts +37 -0
- package/dist/lifecycle/ledger-remote.d.ts.map +1 -0
- package/dist/lifecycle/ledger-remote.js +42 -0
- package/dist/lifecycle/plan-stale.d.ts +76 -0
- package/dist/lifecycle/plan-stale.d.ts.map +1 -0
- package/dist/lifecycle/plan-stale.js +121 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.d.ts.map +1 -1
- package/dist/lifecycle/publish-credentials.js +2 -0
- package/dist/lifecycle/publish-declaration.d.ts +87 -0
- package/dist/lifecycle/publish-declaration.d.ts.map +1 -1
- package/dist/lifecycle/publish-declaration.js +87 -1
- package/dist/lifecycle/publish-forge.d.ts +5 -1
- package/dist/lifecycle/publish-forge.d.ts.map +1 -1
- package/dist/lifecycle/publish-forge.js +14 -4
- package/dist/lifecycle/publish-github.d.ts +69 -0
- package/dist/lifecycle/publish-github.d.ts.map +1 -0
- package/dist/lifecycle/publish-github.js +153 -0
- package/dist/lifecycle/publish-homebrew.d.ts +66 -0
- package/dist/lifecycle/publish-homebrew.d.ts.map +1 -0
- package/dist/lifecycle/publish-homebrew.js +173 -0
- package/dist/lifecycle/publish-marketplace.d.ts +51 -0
- package/dist/lifecycle/publish-marketplace.d.ts.map +1 -0
- package/dist/lifecycle/publish-marketplace.js +254 -0
- package/dist/lifecycle/publish-targets.d.ts +6 -0
- package/dist/lifecycle/publish-targets.d.ts.map +1 -1
- package/dist/lifecycle/publish-targets.js +15 -0
- package/dist/lifecycle/publish-tauri.d.ts +61 -0
- package/dist/lifecycle/publish-tauri.d.ts.map +1 -0
- package/dist/lifecycle/publish-tauri.js +182 -0
- package/dist/lifecycle/release-publish.d.ts +5 -2
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store.js +17 -9
- package/dist/lifecycle/test-passkey.d.ts +25 -0
- package/dist/lifecycle/test-passkey.d.ts.map +1 -0
- package/dist/lifecycle/test-passkey.js +39 -0
- package/dist/notify.d.ts +23 -3
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +8 -2
- package/dist/notify.schema.json +12 -3
- package/dist/op/activities/activity-contracts.d.ts +4 -4
- package/dist/pr-forge.d.ts +20 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +61 -2
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/wave-runtime.mjs +331 -330
- package/dist/workspace/ci-builds.d.ts +21 -0
- package/dist/workspace/ci-builds.d.ts.map +1 -1
- package/dist/workspace/ci-builds.js +14 -0
- package/dist/workspace/ci-green.d.ts +45 -2
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +124 -5
- package/dist/workspace/ci-quarantine-report.d.ts +80 -0
- package/dist/workspace/ci-quarantine-report.d.ts.map +1 -0
- package/dist/workspace/ci-quarantine-report.js +205 -0
- package/dist/workspace/ci-quarantine.d.ts +73 -0
- package/dist/workspace/ci-quarantine.d.ts.map +1 -0
- package/dist/workspace/ci-quarantine.js +171 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +7 -4
- package/dist/workspace/class-data.d.ts +3 -1
- package/dist/workspace/class-data.d.ts.map +1 -1
- package/dist/workspace/class-data.js +4 -1
- package/dist/workspace/declaration.d.ts +45 -2
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +45 -2
- package/dist/workspace/declaration.schema.json +51 -3
- package/dist/workspace/forge-work.d.ts +76 -0
- package/dist/workspace/forge-work.d.ts.map +1 -0
- package/dist/workspace/forge-work.js +160 -0
- package/dist/workspace/identity-gate-rule.d.ts +3 -2
- package/dist/workspace/identity-gate-rule.d.ts.map +1 -1
- package/dist/workspace/identity-gate-rule.js +5 -7
- package/dist/workspace/identity.d.ts +3 -2
- package/dist/workspace/identity.d.ts.map +1 -1
- package/dist/workspace/identity.js +6 -3
- package/dist/workspace/intent-cli.d.ts +3 -2
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.js +26 -5
- package/dist/workspace/intent-record.d.ts +3 -0
- package/dist/workspace/intent-record.d.ts.map +1 -1
- package/dist/workspace/intent-record.schema.json +32 -0
- package/dist/workspace/intent.d.ts +9 -0
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +3 -0
- package/dist/workspace/intent.schema.json +32 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +2 -1
- package/dist/workspace/kinds.d.ts +6 -1
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +8 -3
- package/dist/workspace/plan-stale.schema.json +286 -0
- package/dist/workspace/release-candidates.d.ts +33 -6
- package/dist/workspace/release-candidates.d.ts.map +1 -1
- package/dist/workspace/release-candidates.js +49 -20
- package/dist/workspace/release-candidates.schema.json +48 -2
- package/dist/workspace/trust/policy.d.ts +10 -0
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/policy.js +19 -1
- package/dist/workspace/trust/run-commits.d.ts.map +1 -1
- package/dist/workspace/trust/run-commits.js +2 -1
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/dist/workspace/trust/seal.js +34 -3
- package/dist/workspace/trust/trust-files.d.ts.map +1 -1
- package/dist/workspace/trust/trust-files.js +6 -1
- package/package.json +2 -1
- package/src/cli/handlers/approve-external-signature.test.ts +226 -0
- package/src/cli/handlers/approve.ts +174 -16
- package/src/cli/handlers/plan.ts +74 -0
- package/src/cli/handlers/release.ts +12 -7
- package/src/cli/main.ts +34 -5
- package/src/cli/mcp/workspace-tools.ts +2 -1
- package/src/cli/parse-args.ts +24 -0
- package/src/cli/registry.ts +13 -1
- package/src/gate-decision-bundle.test.ts +4 -2
- package/src/gate-decision.ts +11 -2
- package/src/gate-statement.schema.json +44 -0
- package/src/lifecycle/__fixtures__/publish-fakes.ts +125 -5
- package/src/lifecycle/gate-ledger.ts +17 -3
- package/src/lifecycle/gate-seal.ts +62 -9
- package/src/lifecycle/gate-statement.ts +107 -0
- package/src/lifecycle/gate-webauthn.test.ts +77 -0
- package/src/lifecycle/gate-webauthn.ts +133 -0
- package/src/lifecycle/git.ts +23 -19
- package/src/lifecycle/ledger-remote.test.ts +183 -0
- package/src/lifecycle/ledger-remote.ts +46 -0
- package/src/lifecycle/plan-stale.test.ts +150 -0
- package/src/lifecycle/plan-stale.ts +173 -0
- package/src/lifecycle/publish-credentials.ts +2 -0
- package/src/lifecycle/publish-declaration.ts +93 -1
- package/src/lifecycle/publish-forge.ts +15 -4
- package/src/lifecycle/publish-github.ts +174 -0
- package/src/lifecycle/publish-homebrew.test.ts +179 -0
- package/src/lifecycle/publish-homebrew.ts +187 -0
- package/src/lifecycle/publish-marketplace.test.ts +254 -0
- package/src/lifecycle/publish-marketplace.ts +259 -0
- package/src/lifecycle/publish-target-context.test.ts +2 -2
- package/src/lifecycle/publish-targets.test.ts +23 -0
- package/src/lifecycle/publish-targets.ts +15 -0
- package/src/lifecycle/publish-tauri.test.ts +163 -0
- package/src/lifecycle/publish-tauri.ts +199 -0
- package/src/lifecycle/release-publish.ts +5 -3
- package/src/lifecycle/snapshot-store.ts +16 -9
- package/src/lifecycle/test-passkey.ts +55 -0
- package/src/notify-bundle.test.ts +3 -1
- package/src/notify.schema.json +12 -3
- package/src/notify.ts +20 -3
- package/src/override-gate-bundle.test.ts +2 -0
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +38 -0
- package/src/pr-forge.ts +68 -5
- package/src/release-floors.ts +1 -1
- package/src/stage-hooks-bundle.test.ts +2 -0
- package/src/wave-runtime-bundle.test.ts +3 -2
- package/src/workspace/ci-builds.ts +27 -0
- package/src/workspace/ci-green-stale.test.ts +193 -0
- package/src/workspace/ci-green.ts +138 -6
- package/src/workspace/ci-quarantine-report.test.ts +146 -0
- package/src/workspace/ci-quarantine-report.ts +235 -0
- package/src/workspace/ci-quarantine.test.ts +161 -0
- package/src/workspace/ci-quarantine.ts +189 -0
- package/src/workspace/ci-serve.ts +7 -4
- package/src/workspace/class-data.ts +5 -1
- package/src/workspace/declaration.schema.json +51 -3
- package/src/workspace/declaration.test.ts +1 -0
- package/src/workspace/declaration.ts +88 -5
- package/src/workspace/forge-work.test.ts +143 -0
- package/src/workspace/forge-work.ts +195 -0
- package/src/workspace/identity-gate-rule.ts +6 -8
- package/src/workspace/identity.ts +6 -3
- package/src/workspace/intent-cli.ts +24 -5
- package/src/workspace/intent-record.schema.json +32 -0
- package/src/workspace/intent-record.ts +3 -0
- package/src/workspace/intent.schema.json +32 -0
- package/src/workspace/intent.ts +10 -0
- package/src/workspace/kind-readers.ts +2 -1
- package/src/workspace/kinds.test.ts +13 -0
- package/src/workspace/kinds.ts +12 -3
- package/src/workspace/plan-stale.schema.json +286 -0
- package/src/workspace/release-candidates.schema.json +48 -2
- package/src/workspace/release-candidates.test.ts +77 -4
- package/src/workspace/release-candidates.ts +62 -20
- package/src/workspace/trust/policy.ts +24 -1
- package/src/workspace/trust/run-commits.ts +2 -1
- package/src/workspace/trust/seal.ts +35 -3
- package/src/workspace/trust/trust-files.test.ts +5 -0
- package/src/workspace/trust/trust-files.ts +15 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor marketplace target (#4676): a packaged `.vsix` published to the
|
|
3
|
+
* VS Code Marketplace or to Open VSX.
|
|
4
|
+
*
|
|
5
|
+
* The extension's publisher, name and version are read from the
|
|
6
|
+
* `extension/package.json` inside the `.vsix`, and the file must match the
|
|
7
|
+
* digest the release records for it.
|
|
8
|
+
*
|
|
9
|
+
* A marketplace has no draft: a version is visible as soon as it is
|
|
10
|
+
* uploaded, and a version can't be uploaded twice. So the stage uploads
|
|
11
|
+
* nothing. It checks what it can without changing anything: the file and its
|
|
12
|
+
* digest, the token, and whether the marketplace already has the version.
|
|
13
|
+
* The reveal uploads. A failure of another target's stage therefore leaves
|
|
14
|
+
* nothing on a marketplace, and a marketplace's own failure shows only at the
|
|
15
|
+
* reveal, after the targets before it revealed.
|
|
16
|
+
*
|
|
17
|
+
* - Open VSX, through its REST API: the stage reads
|
|
18
|
+
* `GET {registry}/api/{namespace}` (a missing namespace is refused before
|
|
19
|
+
* anything reveals) and `GET {registry}/api/{namespace}/{name}/{version}`.
|
|
20
|
+
* A version already there is `present` when its download's SHA-256 is the
|
|
21
|
+
* file's, and refused otherwise (`publish-marketplace-version-exists`). The
|
|
22
|
+
* reveal sends the file with `POST {registry}/api/-/publish`, then
|
|
23
|
+
* downloads what Open VSX serves for the version and refuses a digest that
|
|
24
|
+
* differs (`publish-marketplace-digest-mismatch`).
|
|
25
|
+
* - The VS Code Marketplace, through `vsce`: the stage asks the gallery's
|
|
26
|
+
* public `extensionquery` API for the extension's versions, and a version
|
|
27
|
+
* already there is `present`, by version only, since the gallery reports no
|
|
28
|
+
* digest. The reveal runs `vsce publish --packagePath <file>` with the
|
|
29
|
+
* token in `VSCE_PAT`. `vsce` must be on `PATH` (`npm i -g @vscode/vsce`).
|
|
30
|
+
*
|
|
31
|
+
* The token is read from `tokenEnv`, else `VSCE_PAT` or `OVSX_PAT`, the
|
|
32
|
+
* variables `vsce` and `ovsx` read, and is masked in all output.
|
|
33
|
+
*/
|
|
34
|
+
import { spawn } from "node:child_process";
|
|
35
|
+
import { readFileSync } from "node:fs";
|
|
36
|
+
import { inflateRawSync } from "node:zlib";
|
|
37
|
+
import { readCredential } from "./publish-credentials.js";
|
|
38
|
+
import { bytesDigest, checkReleaseDigest, memberFile, publishTargetKey } from "./publish-targets.js";
|
|
39
|
+
import { PublishTargetError } from "./release-publish.js";
|
|
40
|
+
import { NEXT_RELEASE } from "../release-floors.js";
|
|
41
|
+
/** The first chant that publishes a `marketplace` target (#4676). */
|
|
42
|
+
export const PUBLISH_MARKETPLACE_FLOOR = NEXT_RELEASE;
|
|
43
|
+
export const OPEN_VSX_REGISTRY = "https://open-vsx.org";
|
|
44
|
+
export const VSCODE_GALLERY = "https://marketplace.visualstudio.com";
|
|
45
|
+
/** The variables a marketplace's token is read from. */
|
|
46
|
+
export function marketplaceTokenEnv(decl) {
|
|
47
|
+
return [decl.tokenEnv ?? (decl.marketplace === "vscode" ? "VSCE_PAT" : "OVSX_PAT")];
|
|
48
|
+
}
|
|
49
|
+
/** One file of a zip archive, or null when it holds none by that name. Reads stored and deflated entries; refuses a zip64 archive. */
|
|
50
|
+
export function readZipEntry(zip, name) {
|
|
51
|
+
let end = -1;
|
|
52
|
+
for (let i = zip.length - 22; i >= Math.max(0, zip.length - 22 - 0xffff); i--) {
|
|
53
|
+
if (zip.readUInt32LE(i) === 0x06054b50) {
|
|
54
|
+
end = i;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (end < 0)
|
|
59
|
+
throw new Error("not a zip archive: no end of central directory");
|
|
60
|
+
const count = zip.readUInt16LE(end + 10);
|
|
61
|
+
let at = zip.readUInt32LE(end + 16);
|
|
62
|
+
if (count === 0xffff || at === 0xffffffff)
|
|
63
|
+
throw new Error("a zip64 archive, which chant does not read");
|
|
64
|
+
for (let i = 0; i < count; i++) {
|
|
65
|
+
if (zip.readUInt32LE(at) !== 0x02014b50)
|
|
66
|
+
throw new Error("a malformed zip central directory");
|
|
67
|
+
const method = zip.readUInt16LE(at + 10);
|
|
68
|
+
const size = zip.readUInt32LE(at + 20);
|
|
69
|
+
const nameLen = zip.readUInt16LE(at + 28);
|
|
70
|
+
const skip = nameLen + zip.readUInt16LE(at + 30) + zip.readUInt16LE(at + 32);
|
|
71
|
+
const local = zip.readUInt32LE(at + 42);
|
|
72
|
+
if (zip.toString("utf-8", at + 46, at + 46 + nameLen) === name) {
|
|
73
|
+
const data = local + 30 + zip.readUInt16LE(local + 26) + zip.readUInt16LE(local + 28);
|
|
74
|
+
const raw = zip.subarray(data, data + size);
|
|
75
|
+
if (method === 0)
|
|
76
|
+
return Buffer.from(raw);
|
|
77
|
+
if (method === 8)
|
|
78
|
+
return inflateRawSync(raw);
|
|
79
|
+
throw new Error(`${name} is compressed with method ${method}, which chant does not read`);
|
|
80
|
+
}
|
|
81
|
+
at += 46 + skip;
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/** The publisher, name and version a `.vsix` declares. */
|
|
86
|
+
export function vsixIdentity(bytes, path) {
|
|
87
|
+
let manifest;
|
|
88
|
+
try {
|
|
89
|
+
const entry = readZipEntry(bytes, "extension/package.json");
|
|
90
|
+
if (!entry)
|
|
91
|
+
throw new Error("it holds no extension/package.json");
|
|
92
|
+
manifest = JSON.parse(entry.toString("utf-8"));
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
throw new PublishTargetError("publish-marketplace-vsix-invalid", `${path} is not a .vsix chant can read: ${err instanceof Error ? err.message : String(err)}`, "Package it with vsce package.");
|
|
96
|
+
}
|
|
97
|
+
const { publisher, name, version } = manifest;
|
|
98
|
+
if (typeof publisher !== "string" || typeof name !== "string" || typeof version !== "string" || !publisher || !name || !version) {
|
|
99
|
+
throw new PublishTargetError("publish-marketplace-vsix-invalid", `${path}'s extension/package.json needs publisher, name and version`);
|
|
100
|
+
}
|
|
101
|
+
return { publisher, name, version };
|
|
102
|
+
}
|
|
103
|
+
function run(bin, args, ctx, env) {
|
|
104
|
+
return new Promise((resolvePromise, reject) => {
|
|
105
|
+
const child = spawn(bin, args, { cwd: ctx.cwd, env, stdio: ["ignore", "pipe", "pipe"] });
|
|
106
|
+
const chunks = [];
|
|
107
|
+
child.stdout.on("data", (c) => chunks.push(c.toString("utf-8")));
|
|
108
|
+
child.stderr.on("data", (c) => chunks.push(c.toString("utf-8")));
|
|
109
|
+
child.on("error", reject);
|
|
110
|
+
child.on("close", (code) => resolvePromise({
|
|
111
|
+
code: code ?? 1,
|
|
112
|
+
output: chunks.join("").split("\n").filter((l) => l.trim() !== "").map((l) => ctx.redactor.redact(l)),
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function marketplaceTarget(decl, deps) {
|
|
117
|
+
const fetchImpl = deps.fetch ?? ((url, init) => fetch(url, init));
|
|
118
|
+
const tokenNames = marketplaceTokenEnv(decl);
|
|
119
|
+
const label = decl.marketplace === "vscode" ? "VS Code Marketplace" : "Open VSX";
|
|
120
|
+
const registry = (decl.registry ?? (decl.marketplace === "vscode" ? VSCODE_GALLERY : OPEN_VSX_REGISTRY)).replace(/\/+$/, "");
|
|
121
|
+
const setup = (ctx) => {
|
|
122
|
+
const abs = memberFile(ctx.cwd, decl.vsix);
|
|
123
|
+
const bytes = readFileSync(abs);
|
|
124
|
+
const digest = bytesDigest(new Uint8Array(bytes));
|
|
125
|
+
checkReleaseDigest(ctx.release, "asset", ctx.cwd, decl.vsix, [digest]);
|
|
126
|
+
const id = vsixIdentity(bytes, decl.vsix);
|
|
127
|
+
const token = readCredential(ctx.env, tokenNames, ctx.redactor);
|
|
128
|
+
if (!token) {
|
|
129
|
+
throw new PublishTargetError("publish-credentials-missing", `the ${label} target reads its token from ${tokenNames[0]}, and it is not set`, `Set ${tokenNames[0]} in the job's or the shell's environment.`);
|
|
130
|
+
}
|
|
131
|
+
const destination = decl.marketplace === "vscode" ? `${registry}/items?itemName=${id.publisher}.${id.name}` : `${registry}/extension/${id.publisher}/${id.name}/${id.version}`;
|
|
132
|
+
const item = { name: `${id.publisher}.${id.name}@${id.version}`, destination, digest };
|
|
133
|
+
return { abs, bytes, digest, id, token, item };
|
|
134
|
+
};
|
|
135
|
+
const get = async (url, init = { method: "GET", headers: {} }) => {
|
|
136
|
+
const res = await fetchImpl(url, { ...init, headers: { "user-agent": "chant", ...init.headers } });
|
|
137
|
+
return { status: res.status, text: await res.text().catch(() => "") };
|
|
138
|
+
};
|
|
139
|
+
function fail(ctx, what, status, text) {
|
|
140
|
+
throw new PublishTargetError("publish-marketplace-failed", ctx.redactor.redact(`${what} on ${label} answered ${status}${text ? `: ${text.slice(0, 300)}` : ""}`));
|
|
141
|
+
}
|
|
142
|
+
/** Open VSX: the SHA-256 of what it serves for the version, or null when it has no such version. */
|
|
143
|
+
const openVsxServed = async (ctx, id) => {
|
|
144
|
+
const meta = await get(`${registry}/api/${encodeURIComponent(id.publisher)}/${encodeURIComponent(id.name)}/${encodeURIComponent(id.version)}`);
|
|
145
|
+
if (meta.status === 404)
|
|
146
|
+
return null;
|
|
147
|
+
if (meta.status !== 200)
|
|
148
|
+
fail(ctx, `reading ${id.publisher}.${id.name}@${id.version}`, meta.status, meta.text);
|
|
149
|
+
const download = JSON.parse(meta.text).files?.download;
|
|
150
|
+
if (typeof download !== "string")
|
|
151
|
+
fail(ctx, `reading the download of ${id.publisher}.${id.name}@${id.version}`, meta.status, "no files.download");
|
|
152
|
+
const res = await fetchImpl(download, { method: "GET", headers: { "user-agent": "chant" } });
|
|
153
|
+
if (res.status !== 200)
|
|
154
|
+
fail(ctx, `downloading ${id.publisher}.${id.name}@${id.version}`, res.status, "");
|
|
155
|
+
if (!res.arrayBuffer)
|
|
156
|
+
throw new PublishTargetError("publish-marketplace-failed", "the fetch this publish runs with can't read a response's bytes, so the download's digest can't be checked");
|
|
157
|
+
return bytesDigest(new Uint8Array(await res.arrayBuffer()));
|
|
158
|
+
};
|
|
159
|
+
/** VS Code Marketplace: whether the gallery lists the version. */
|
|
160
|
+
const galleryHas = async (ctx, id) => {
|
|
161
|
+
const res = await get(`${registry}/_apis/public/gallery/extensionquery`, {
|
|
162
|
+
method: "POST",
|
|
163
|
+
headers: { "content-type": "application/json", accept: "application/json;api-version=3.0-preview.1" },
|
|
164
|
+
body: JSON.stringify({ filters: [{ criteria: [{ filterType: 7, value: `${id.publisher}.${id.name}` }], pageNumber: 1, pageSize: 1 }], flags: 1 }),
|
|
165
|
+
});
|
|
166
|
+
if (res.status !== 200)
|
|
167
|
+
fail(ctx, `asking for ${id.publisher}.${id.name}`, res.status, res.text);
|
|
168
|
+
const body = JSON.parse(res.text);
|
|
169
|
+
return (body.results?.[0]?.extensions?.[0]?.versions ?? []).some((v) => v.version === id.version);
|
|
170
|
+
};
|
|
171
|
+
const target = {
|
|
172
|
+
kind: "marketplace",
|
|
173
|
+
name: `${label} ${decl.vsix}`,
|
|
174
|
+
destination: label,
|
|
175
|
+
credentialEnv: tokenNames,
|
|
176
|
+
key: publishTargetKey(decl),
|
|
177
|
+
async plan(ctx) {
|
|
178
|
+
return [setup(ctx).item];
|
|
179
|
+
},
|
|
180
|
+
async stage(ctx) {
|
|
181
|
+
const { id, digest, token, item } = setup(ctx);
|
|
182
|
+
ctx.log(`using the token from ${token.from}`);
|
|
183
|
+
const done = (present) => ({ target: target.name, destination: target.destination, items: [{ ...item, ...(present ? { present: true } : {}) }], state: present ? { present: "true" } : {} });
|
|
184
|
+
if (decl.marketplace === "openvsx") {
|
|
185
|
+
const ns = await get(`${registry}/api/${encodeURIComponent(id.publisher)}`);
|
|
186
|
+
if (ns.status === 404) {
|
|
187
|
+
throw new PublishTargetError("publish-marketplace-no-namespace", `Open VSX at ${registry} has no namespace ${id.publisher}`, `Create it once with: npx ovsx create-namespace ${id.publisher}`);
|
|
188
|
+
}
|
|
189
|
+
if (ns.status !== 200)
|
|
190
|
+
fail(ctx, `reading namespace ${id.publisher}`, ns.status, ns.text);
|
|
191
|
+
const served = await openVsxServed(ctx, id);
|
|
192
|
+
if (served === null) {
|
|
193
|
+
ctx.log(`${item.name} is not on Open VSX yet; it is uploaded at the reveal, since Open VSX has no draft`);
|
|
194
|
+
return done(false);
|
|
195
|
+
}
|
|
196
|
+
if (served !== digest) {
|
|
197
|
+
throw new PublishTargetError("publish-marketplace-version-exists", `Open VSX already has ${item.name}, with digest ${served}, not ${digest}`, "A marketplace version can't be replaced: cut a release with a new version.");
|
|
198
|
+
}
|
|
199
|
+
ctx.log(`${item.name} is already on Open VSX with the same bytes`);
|
|
200
|
+
return done(true);
|
|
201
|
+
}
|
|
202
|
+
if (await galleryHas(ctx, id)) {
|
|
203
|
+
ctx.log(`${item.name} is already on the VS Code Marketplace; it reports no digest to compare`);
|
|
204
|
+
return done(true);
|
|
205
|
+
}
|
|
206
|
+
ctx.log(`${item.name} is not on the VS Code Marketplace yet; it is uploaded at the reveal, since the marketplace has no draft`);
|
|
207
|
+
return done(false);
|
|
208
|
+
},
|
|
209
|
+
async reveal(ctx, staged) {
|
|
210
|
+
const items = staged.items.map((i) => ({ name: i.name, destination: i.destination, ...(i.digest ? { digest: i.digest } : {}) }));
|
|
211
|
+
if (staged.state.present === "true")
|
|
212
|
+
return { target: target.name, destination: target.destination, items: items.map((i) => ({ ...i, present: true })) };
|
|
213
|
+
const { abs, bytes, id, digest, token, item } = setup(ctx);
|
|
214
|
+
if (decl.marketplace === "openvsx") {
|
|
215
|
+
// Run again after an upload whose record was lost, the version is there: check it rather than send it twice.
|
|
216
|
+
const before = await openVsxServed(ctx, id);
|
|
217
|
+
if (before === null) {
|
|
218
|
+
ctx.log(`uploading ${item.name} (${bytes.byteLength} bytes) to Open VSX`);
|
|
219
|
+
const res = await fetchImpl(`${registry}/api/-/publish?token=${encodeURIComponent(token.value)}`, {
|
|
220
|
+
method: "POST",
|
|
221
|
+
headers: { "user-agent": "chant", "content-type": "application/octet-stream" },
|
|
222
|
+
body: new Uint8Array(bytes),
|
|
223
|
+
});
|
|
224
|
+
if (res.status !== 201 && res.status !== 200)
|
|
225
|
+
fail(ctx, `publishing ${item.name}`, res.status, await res.text().catch(() => ""));
|
|
226
|
+
}
|
|
227
|
+
const served = before ?? (await openVsxServed(ctx, id));
|
|
228
|
+
if (served !== digest) {
|
|
229
|
+
throw new PublishTargetError("publish-marketplace-digest-mismatch", `Open VSX serves ${item.name} with digest ${served ?? "none"}, and the file published is ${digest}`);
|
|
230
|
+
}
|
|
231
|
+
return { target: target.name, destination: target.destination, items: before === null ? items : items.map((i) => ({ ...i, present: true })) };
|
|
232
|
+
}
|
|
233
|
+
if (await galleryHas(ctx, id)) {
|
|
234
|
+
ctx.log(`${item.name} is already on the VS Code Marketplace`);
|
|
235
|
+
return { target: target.name, destination: target.destination, items: items.map((i) => ({ ...i, present: true })) };
|
|
236
|
+
}
|
|
237
|
+
ctx.log(`running vsce publish --packagePath ${decl.vsix}`);
|
|
238
|
+
const result = await run(deps.vsce ?? "vsce", ["publish", "--packagePath", abs], ctx, vsceEnv(ctx.env, token)).catch((err) => {
|
|
239
|
+
throw new PublishTargetError("publish-marketplace-failed", `vsce could not be run: ${err instanceof Error ? err.message : String(err)}`, "Install it on the job's PATH: npm install -g @vscode/vsce");
|
|
240
|
+
});
|
|
241
|
+
for (const l of result.output)
|
|
242
|
+
ctx.log(`vsce: ${l}`);
|
|
243
|
+
if (result.code !== 0) {
|
|
244
|
+
throw new PublishTargetError("publish-marketplace-failed", `vsce publish of ${item.name} exited ${result.code}${result.output.length ? `: ${result.output.slice(-3).join(" ")}` : ""}`);
|
|
245
|
+
}
|
|
246
|
+
return { target: target.name, destination: target.destination, items };
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
return target;
|
|
250
|
+
}
|
|
251
|
+
/** The environment vsce runs with: the run's, with the token in `VSCE_PAT`. */
|
|
252
|
+
function vsceEnv(env, token) {
|
|
253
|
+
return { ...env, VSCE_PAT: token.value };
|
|
254
|
+
}
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* as GHCR or Docker Hub over the registry HTTP API, by digest, then tagged.
|
|
10
10
|
* - `forge` (./publish-forge.ts): files attached to the GitHub, GitLab or
|
|
11
11
|
* Forgejo release named by the release's tag.
|
|
12
|
+
* - `homebrew` (./publish-homebrew.ts): a formula in a tap repository on
|
|
13
|
+
* GitHub, rendered from a template with each asset's URL and SHA-256.
|
|
14
|
+
* - `marketplace` (./publish-marketplace.ts): a `.vsix` on the VS Code
|
|
15
|
+
* Marketplace (through `vsce`) or Open VSX (through its REST API).
|
|
16
|
+
* - `tauri-updater` (./publish-tauri.ts): a Tauri updater manifest and the
|
|
17
|
+
* app's bundles on a rolling GitHub release, replaced on each publish.
|
|
12
18
|
*
|
|
13
19
|
* A file a target reads that the release records as an artifact at the same
|
|
14
20
|
* path is checked against the release's digest, and a file that differs is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-targets.d.ts","sourceRoot":"","sources":["../../src/lifecycle/publish-targets.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"publish-targets.d.ts","sourceRoot":"","sources":["../../src/lifecycle/publish-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAsB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGhE,6DAA6D;AAC7D,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAyBjI;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAEjE;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,+BAA+B;AAC/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,sCAAsC;AACtC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAID,uGAAuG;AACvG,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAGzI;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAQ/I"}
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* as GHCR or Docker Hub over the registry HTTP API, by digest, then tagged.
|
|
10
10
|
* - `forge` (./publish-forge.ts): files attached to the GitHub, GitLab or
|
|
11
11
|
* Forgejo release named by the release's tag.
|
|
12
|
+
* - `homebrew` (./publish-homebrew.ts): a formula in a tap repository on
|
|
13
|
+
* GitHub, rendered from a template with each asset's URL and SHA-256.
|
|
14
|
+
* - `marketplace` (./publish-marketplace.ts): a `.vsix` on the VS Code
|
|
15
|
+
* Marketplace (through `vsce`) or Open VSX (through its REST API).
|
|
16
|
+
* - `tauri-updater` (./publish-tauri.ts): a Tauri updater manifest and the
|
|
17
|
+
* app's bundles on a rolling GitHub release, replaced on each publish.
|
|
12
18
|
*
|
|
13
19
|
* A file a target reads that the release records as an artifact at the same
|
|
14
20
|
* path is checked against the release's digest, and a file that differs is
|
|
@@ -34,6 +40,15 @@ export async function createPublishTargets(decls, deps = {}) {
|
|
|
34
40
|
case "forge":
|
|
35
41
|
out.push((await import("./publish-forge.js")).forgeTarget(d, deps));
|
|
36
42
|
break;
|
|
43
|
+
case "homebrew":
|
|
44
|
+
out.push((await import("./publish-homebrew.js")).homebrewTarget(d, deps));
|
|
45
|
+
break;
|
|
46
|
+
case "marketplace":
|
|
47
|
+
out.push((await import("./publish-marketplace.js")).marketplaceTarget(d, deps));
|
|
48
|
+
break;
|
|
49
|
+
case "tauri-updater":
|
|
50
|
+
out.push((await import("./publish-tauri.js")).tauriUpdaterTarget(d, deps));
|
|
51
|
+
break;
|
|
37
52
|
}
|
|
38
53
|
}
|
|
39
54
|
return out;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Tauri updater target (#4676): the updater manifest a Tauri v2 app reads
|
|
3
|
+
* (`latest.json`), and a rolling GitHub release under a fixed tag, such as
|
|
4
|
+
* `app-latest`, that holds the release's bundles and that manifest. Each
|
|
5
|
+
* publish replaces what the rolling release held.
|
|
6
|
+
*
|
|
7
|
+
* The manifest is the updater's static JSON:
|
|
8
|
+
*
|
|
9
|
+
* ```json
|
|
10
|
+
* {
|
|
11
|
+
* "version": "1.4.0",
|
|
12
|
+
* "notes": "...",
|
|
13
|
+
* "pub_date": "2026-10-17T10:00:00.000Z",
|
|
14
|
+
* "platforms": {
|
|
15
|
+
* "darwin-aarch64": { "signature": "<the .sig file's text>", "url": "https://.../Acme_aarch64.app.tar.gz" }
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* `version` is the release's label from its first digit on; `notes` is the
|
|
21
|
+
* text of the declared `notes` file, left out without one; `pub_date` is the
|
|
22
|
+
* time of the cut whose signature the publish carries, left out when none is
|
|
23
|
+
* known, so the manifest is the same bytes on every run. Each platform's
|
|
24
|
+
* `signature` is the text of the `.sig` file the Tauri build wrote beside its
|
|
25
|
+
* updater bundle, and `url` is the `url` pattern for that bundle, by default
|
|
26
|
+
* its download URL on the rolling release.
|
|
27
|
+
*
|
|
28
|
+
* GitHub can't replace a release's contents in one request, so the two steps
|
|
29
|
+
* (#4048) are a draft and a swap:
|
|
30
|
+
*
|
|
31
|
+
* - The stage makes a draft release for the rolling tag named
|
|
32
|
+
* `<tag> <version>` at the release's commit, or finds the one an earlier
|
|
33
|
+
* stage made, and uploads each bundle, each declared asset and the manifest
|
|
34
|
+
* to it. A file already on the draft with the same digest is not sent
|
|
35
|
+
* again; one that differs is refused (`publish-tauri-asset-exists`). The
|
|
36
|
+
* published rolling release is untouched, so the updater sees nothing new.
|
|
37
|
+
* A rolling release that already holds every file with the same digests is
|
|
38
|
+
* what an earlier reveal left, and the stage does nothing.
|
|
39
|
+
* - The reveal deletes the published rolling release, deletes the tag so it
|
|
40
|
+
* is made again at the release's commit, and publishes the draft with
|
|
41
|
+
* `make_latest` from `latest` (default `false`: a rolling release is not
|
|
42
|
+
* the repository's latest). Between the delete and the publish, a few
|
|
43
|
+
* requests apart, the rolling release's URLs answer 404, which an updater
|
|
44
|
+
* treats as no update.
|
|
45
|
+
*/
|
|
46
|
+
import type { TauriUpdaterPublishDeclaration } from "./publish-declaration.js";
|
|
47
|
+
import { type PublishDeps, type PublishTarget } from "./release-publish.js";
|
|
48
|
+
/** The first chant that publishes a `tauri-updater` target (#4676). */
|
|
49
|
+
export declare const PUBLISH_TAURI_UPDATER_FLOOR = "0.124.63";
|
|
50
|
+
/** The updater manifest's bytes: 2-space JSON with a trailing newline, keys in the order Tauri's docs show them. */
|
|
51
|
+
export declare function tauriManifest(m: {
|
|
52
|
+
version: string;
|
|
53
|
+
notes: string | null;
|
|
54
|
+
pubDate: string | null;
|
|
55
|
+
platforms: Record<string, {
|
|
56
|
+
signature: string;
|
|
57
|
+
url: string;
|
|
58
|
+
}>;
|
|
59
|
+
}): Uint8Array;
|
|
60
|
+
export declare function tauriUpdaterTarget(decl: TauriUpdaterPublishDeclaration, deps: PublishDeps): PublishTarget;
|
|
61
|
+
//# sourceMappingURL=publish-tauri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-tauri.d.ts","sourceRoot":"","sources":["../../src/lifecycle/publish-tauri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAI5E,OAAO,EAA2C,KAAK,WAAW,EAAuC,KAAK,aAAa,EAAqB,MAAM,mBAAmB,CAAC;AAG1K,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,aAAe,CAAC;AASxD,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,UAAU,CAK7K;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,WAAW,GAAG,aAAa,CA4HzG"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Tauri updater target (#4676): the updater manifest a Tauri v2 app reads
|
|
3
|
+
* (`latest.json`), and a rolling GitHub release under a fixed tag, such as
|
|
4
|
+
* `app-latest`, that holds the release's bundles and that manifest. Each
|
|
5
|
+
* publish replaces what the rolling release held.
|
|
6
|
+
*
|
|
7
|
+
* The manifest is the updater's static JSON:
|
|
8
|
+
*
|
|
9
|
+
* ```json
|
|
10
|
+
* {
|
|
11
|
+
* "version": "1.4.0",
|
|
12
|
+
* "notes": "...",
|
|
13
|
+
* "pub_date": "2026-10-17T10:00:00.000Z",
|
|
14
|
+
* "platforms": {
|
|
15
|
+
* "darwin-aarch64": { "signature": "<the .sig file's text>", "url": "https://.../Acme_aarch64.app.tar.gz" }
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* `version` is the release's label from its first digit on; `notes` is the
|
|
21
|
+
* text of the declared `notes` file, left out without one; `pub_date` is the
|
|
22
|
+
* time of the cut whose signature the publish carries, left out when none is
|
|
23
|
+
* known, so the manifest is the same bytes on every run. Each platform's
|
|
24
|
+
* `signature` is the text of the `.sig` file the Tauri build wrote beside its
|
|
25
|
+
* updater bundle, and `url` is the `url` pattern for that bundle, by default
|
|
26
|
+
* its download URL on the rolling release.
|
|
27
|
+
*
|
|
28
|
+
* GitHub can't replace a release's contents in one request, so the two steps
|
|
29
|
+
* (#4048) are a draft and a swap:
|
|
30
|
+
*
|
|
31
|
+
* - The stage makes a draft release for the rolling tag named
|
|
32
|
+
* `<tag> <version>` at the release's commit, or finds the one an earlier
|
|
33
|
+
* stage made, and uploads each bundle, each declared asset and the manifest
|
|
34
|
+
* to it. A file already on the draft with the same digest is not sent
|
|
35
|
+
* again; one that differs is refused (`publish-tauri-asset-exists`). The
|
|
36
|
+
* published rolling release is untouched, so the updater sees nothing new.
|
|
37
|
+
* A rolling release that already holds every file with the same digests is
|
|
38
|
+
* what an earlier reveal left, and the stage does nothing.
|
|
39
|
+
* - The reveal deletes the published rolling release, deletes the tag so it
|
|
40
|
+
* is made again at the release's commit, and publishes the draft with
|
|
41
|
+
* `make_latest` from `latest` (default `false`: a rolling release is not
|
|
42
|
+
* the repository's latest). Between the delete and the publish, a few
|
|
43
|
+
* requests apart, the rolling release's URLs answer 404, which an updater
|
|
44
|
+
* treats as no update.
|
|
45
|
+
*/
|
|
46
|
+
import { readFileSync } from "node:fs";
|
|
47
|
+
import { basename } from "node:path";
|
|
48
|
+
import { readCredential } from "./publish-credentials.js";
|
|
49
|
+
import { GitHubRepo, githubApi } from "./publish-github.js";
|
|
50
|
+
import { fillUrl, releaseVersion } from "./publish-homebrew.js";
|
|
51
|
+
import { bytesDigest, checkReleaseDigest, memberFile, publishTargetKey } from "./publish-targets.js";
|
|
52
|
+
import { PublishTargetError } from "./release-publish.js";
|
|
53
|
+
import { NEXT_RELEASE } from "../release-floors.js";
|
|
54
|
+
/** The first chant that publishes a `tauri-updater` target (#4676). */
|
|
55
|
+
export const PUBLISH_TAURI_UPDATER_FLOOR = NEXT_RELEASE;
|
|
56
|
+
/** The updater manifest's bytes: 2-space JSON with a trailing newline, keys in the order Tauri's docs show them. */
|
|
57
|
+
export function tauriManifest(m) {
|
|
58
|
+
const platforms = {};
|
|
59
|
+
for (const key of Object.keys(m.platforms).sort())
|
|
60
|
+
platforms[key] = { signature: m.platforms[key].signature, url: m.platforms[key].url };
|
|
61
|
+
const doc = { version: m.version, ...(m.notes !== null ? { notes: m.notes } : {}), ...(m.pubDate !== null ? { pub_date: m.pubDate } : {}), platforms };
|
|
62
|
+
return new Uint8Array(Buffer.from(`${JSON.stringify(doc, null, 2)}\n`, "utf-8"));
|
|
63
|
+
}
|
|
64
|
+
export function tauriUpdaterTarget(decl, deps) {
|
|
65
|
+
const fetchImpl = deps.fetch ?? ((url, init) => fetch(url, init));
|
|
66
|
+
const tokenNames = [decl.tokenEnv ?? "GITHUB_TOKEN"];
|
|
67
|
+
const manifestName = decl.manifest ?? "latest.json";
|
|
68
|
+
const urlPattern = decl.url ?? `https://github.com/${decl.repo}/releases/download/{tag}/{name}`;
|
|
69
|
+
const read = (ctx, path) => {
|
|
70
|
+
const bytes = new Uint8Array(readFileSync(memberFile(ctx.cwd, path)));
|
|
71
|
+
const digest = bytesDigest(bytes);
|
|
72
|
+
checkReleaseDigest(ctx.release, "asset", ctx.cwd, path, [digest]);
|
|
73
|
+
return { path, name: basename(path), bytes, digest };
|
|
74
|
+
};
|
|
75
|
+
const setup = (ctx) => {
|
|
76
|
+
const version = releaseVersion(ctx.label);
|
|
77
|
+
if (!version || !ctx.label) {
|
|
78
|
+
throw new PublishTargetError("publish-tauri-no-version", `the updater manifest's version is the release's label from its first digit, and release ${ctx.release.releaseDigest} has ${ctx.label ? `the label ${ctx.label}, which has no digit` : "no label"}`, "Cut the release with a label such as app-v1.4.0.");
|
|
79
|
+
}
|
|
80
|
+
const token = readCredential(ctx.env, tokenNames, ctx.redactor);
|
|
81
|
+
if (!token) {
|
|
82
|
+
throw new PublishTargetError("publish-credentials-missing", `the tauri-updater target reads its token from ${tokenNames[0]}, and it is not set`, `Set ${tokenNames[0]} to a token that may write releases on ${decl.repo}.`);
|
|
83
|
+
}
|
|
84
|
+
const files = [];
|
|
85
|
+
const platforms = {};
|
|
86
|
+
for (const [platform, path] of Object.entries(decl.platforms)) {
|
|
87
|
+
const bundle = read(ctx, path);
|
|
88
|
+
const sig = read(ctx, `${path}.sig`);
|
|
89
|
+
const signature = Buffer.from(sig.bytes).toString("utf-8").trim();
|
|
90
|
+
if (!signature)
|
|
91
|
+
throw new PublishTargetError("publish-tauri-signature-missing", `${path}.sig is empty, and the updater installs only a signed bundle`);
|
|
92
|
+
if (!files.some((f) => f.name === bundle.name))
|
|
93
|
+
files.push(bundle);
|
|
94
|
+
platforms[platform] = { signature, url: fillUrl(urlPattern, { tag: decl.tag, label: ctx.label, version, name: bundle.name }) };
|
|
95
|
+
}
|
|
96
|
+
for (const path of decl.assets ?? [])
|
|
97
|
+
files.push(read(ctx, path));
|
|
98
|
+
const notes = decl.notes ? readFileSync(memberFile(ctx.cwd, decl.notes), "utf-8").trim() : null;
|
|
99
|
+
const bytes = tauriManifest({ version, notes, pubDate: ctx.cut?.timestamp ?? null, platforms });
|
|
100
|
+
files.push({ path: manifestName, name: manifestName, bytes, digest: bytesDigest(bytes) });
|
|
101
|
+
const names = new Set();
|
|
102
|
+
for (const f of files) {
|
|
103
|
+
if (names.has(f.name))
|
|
104
|
+
throw new PublishTargetError("publish-tauri-asset-name-taken", `two files are named ${f.name}, and a release holds one asset per name`);
|
|
105
|
+
names.add(f.name);
|
|
106
|
+
}
|
|
107
|
+
const repo = new GitHubRepo(githubApi(decl.api, ctx.env), decl.repo, token, fetchImpl, ctx, "publish-tauri-failed");
|
|
108
|
+
return { version, token, files, repo, draftName: `${decl.tag} ${version}` };
|
|
109
|
+
};
|
|
110
|
+
const where = (name) => `github ${decl.repo} release ${decl.tag}, asset ${name}`;
|
|
111
|
+
const itemOf = (f, present = false) => ({ name: f.path, destination: where(f.name), digest: f.digest, ...(present ? { present: true } : {}) });
|
|
112
|
+
const holdsAll = (rel, files) => rel.assets.size === files.length && files.every((f) => rel.assets.get(f.name) === f.digest);
|
|
113
|
+
const target = {
|
|
114
|
+
kind: "tauri-updater",
|
|
115
|
+
name: `tauri updater ${decl.repo} ${decl.tag}`,
|
|
116
|
+
destination: `github ${decl.repo} release ${decl.tag}`,
|
|
117
|
+
credentialEnv: tokenNames,
|
|
118
|
+
key: publishTargetKey(decl),
|
|
119
|
+
async plan(ctx) {
|
|
120
|
+
return setup(ctx).files.map((f) => itemOf(f));
|
|
121
|
+
},
|
|
122
|
+
async stage(ctx) {
|
|
123
|
+
const { version, token, files, repo, draftName } = setup(ctx);
|
|
124
|
+
ctx.log(`using the token from ${token.from}`);
|
|
125
|
+
const done = (items, state) => ({ target: target.name, destination: target.destination, items, state });
|
|
126
|
+
const published = await repo.publishedRelease(decl.tag);
|
|
127
|
+
if (published && holdsAll(published, files)) {
|
|
128
|
+
ctx.log(`release ${decl.tag} already holds ${version}'s files`);
|
|
129
|
+
return done(files.map((f) => itemOf(f, true)), { published: published.id });
|
|
130
|
+
}
|
|
131
|
+
let draft = await repo.draftRelease(decl.tag, draftName);
|
|
132
|
+
if (draft)
|
|
133
|
+
ctx.log(`using the draft release ${draftName}`);
|
|
134
|
+
else {
|
|
135
|
+
ctx.log(`creating a draft release ${draftName} at ${ctx.release.commit.slice(0, 12)}`);
|
|
136
|
+
draft = await repo.createDraft(decl.tag, ctx.release.commit, draftName);
|
|
137
|
+
}
|
|
138
|
+
const items = [];
|
|
139
|
+
for (const f of files) {
|
|
140
|
+
if (draft.assets.has(f.name)) {
|
|
141
|
+
const theirs = draft.assets.get(f.name);
|
|
142
|
+
if (theirs !== f.digest) {
|
|
143
|
+
throw new PublishTargetError("publish-tauri-asset-exists", `the draft release ${draftName} on ${decl.repo} already has ${f.name}${theirs ? ` with digest ${theirs}, not ${f.digest}` : ", and GitHub reports no digest to compare"}`, "Delete the draft on GitHub so the stage makes it again.");
|
|
144
|
+
}
|
|
145
|
+
items.push(itemOf(f, true));
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
ctx.log(`uploading ${f.name} (${f.bytes.byteLength} bytes) to the draft`);
|
|
149
|
+
await repo.uploadAsset(draft, f.name, f.bytes);
|
|
150
|
+
items.push(itemOf(f));
|
|
151
|
+
}
|
|
152
|
+
return done(items, { releaseId: draft.id });
|
|
153
|
+
},
|
|
154
|
+
async reveal(ctx, staged) {
|
|
155
|
+
const items = staged.items.map((i) => ({ name: i.name, destination: i.destination, ...(i.digest ? { digest: i.digest } : {}) }));
|
|
156
|
+
if (staged.state.published)
|
|
157
|
+
return { target: target.name, destination: target.destination, items: items.map((i) => ({ ...i, present: true })) };
|
|
158
|
+
const id = staged.state.releaseId;
|
|
159
|
+
if (!id)
|
|
160
|
+
throw new PublishTargetError("publish-tauri-failed", `the staged release for ${decl.tag} has no draft id to publish`);
|
|
161
|
+
const { repo } = setup(ctx);
|
|
162
|
+
const old = await repo.publishedRelease(decl.tag);
|
|
163
|
+
if (old?.id === id) {
|
|
164
|
+
ctx.log(`release ${decl.tag} is already the staged draft, published`);
|
|
165
|
+
return { target: target.name, destination: target.destination, items };
|
|
166
|
+
}
|
|
167
|
+
if (old) {
|
|
168
|
+
ctx.log(`deleting the published release ${decl.tag} (${old.id}) and its tag`);
|
|
169
|
+
await repo.deleteRelease(old.id);
|
|
170
|
+
}
|
|
171
|
+
// A tag that is there stays where it is when a release is published on it, so it goes, and the publish makes it at the release's commit.
|
|
172
|
+
await repo.deleteRef(`tags/${decl.tag}`);
|
|
173
|
+
const makeLatest = String(decl.latest ?? false);
|
|
174
|
+
ctx.log(`publishing the draft as ${decl.tag} with make_latest ${makeLatest}`);
|
|
175
|
+
const res = await repo.publishDraft(id, makeLatest);
|
|
176
|
+
if (res.status !== 200)
|
|
177
|
+
repo.fail(`publishing the draft release ${decl.tag}`, res);
|
|
178
|
+
return { target: target.name, destination: target.destination, items };
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
return target;
|
|
182
|
+
}
|
|
@@ -104,10 +104,12 @@ export interface PublishedTarget {
|
|
|
104
104
|
}
|
|
105
105
|
/** Injected into the targets, so tests drive them with fakes. */
|
|
106
106
|
export interface PublishDeps {
|
|
107
|
-
/** The HTTP client the OCI and
|
|
107
|
+
/** The HTTP client the OCI, forge, homebrew, marketplace and tauri-updater targets use. Default: the global `fetch`. */
|
|
108
108
|
fetch?: PublishFetch;
|
|
109
109
|
/** The npm executable. Default: `npm` on `PATH`. */
|
|
110
110
|
npm?: string;
|
|
111
|
+
/** The vsce executable the VS Code Marketplace target runs (#4676). Default: `vsce` on `PATH`. */
|
|
112
|
+
vsce?: string;
|
|
111
113
|
/** How a target waits between polls of a registry (#4244). Default: a timer. */
|
|
112
114
|
sleep?: (ms: number) => Promise<void>;
|
|
113
115
|
/** The clock a target's wait reads (#4244). Default: `Date.now`. */
|
|
@@ -126,6 +128,7 @@ export type PublishFetch = (url: string, init: {
|
|
|
126
128
|
get(name: string): string | null;
|
|
127
129
|
};
|
|
128
130
|
text(): Promise<string>;
|
|
131
|
+
arrayBuffer?(): Promise<ArrayBuffer>;
|
|
129
132
|
}>;
|
|
130
133
|
/**
|
|
131
134
|
* The part of a target's context every kind of target is given, whatever it
|
|
@@ -178,7 +181,7 @@ export declare class PublishTargetError extends Error {
|
|
|
178
181
|
constructor(code: string, message: string, fix?: string | undefined);
|
|
179
182
|
}
|
|
180
183
|
/** The kinds `release.publish` declares and `createPublishTargets` makes. */
|
|
181
|
-
export type ReleasePublishKind = "npm" | "oci" | "forge";
|
|
184
|
+
export type ReleasePublishKind = "npm" | "oci" | "forge" | "homebrew" | "marketplace" | "tauri-updater";
|
|
182
185
|
/** The npm dist-tag a set of packages is staged under before `latest` moves (#4048), as chant's own releases do (#3903). */
|
|
183
186
|
export declare const NPM_STAGE_TAG = "next";
|
|
184
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-publish.d.ts","sourceRoot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cAAc,CAAC;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiFtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-store.d.ts","sourceRoot":"","sources":["../../src/lifecycle/snapshot-store.ts"],"names":[],"mappings":"AA2DA,OAAO,EAWL,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"snapshot-store.d.ts","sourceRoot":"","sources":["../../src/lifecycle/snapshot-store.ts"],"names":[],"mappings":"AA2DA,OAAO,EAWL,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAY,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnF,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C,wCAAwC;AACxC,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAEnD,sIAAsI;AACtI,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,eAAe,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtF,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,kIAAkI;IAClI,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,gHAAgH;AAChH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OA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