[fabrica] Release: the release pipeline on a v* tag (version check, web tests, fabrica notes, the shots, approval, publish under SHA256SUMS signed by domi-release) and the highlights of 0.1.0

This commit is contained in:
2026-11-09 17:42:29 +01:00
parent 7a32eeb411
commit b9ab5006a8
4 changed files with 108 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// The release's version check (docs/release.md): every place that carries Ianitor's version agrees,
// and, given a version (the tag's, e.g. 0.1.0 for v0.1.0), is that version.
// node scripts/check-version.mjs [X.Y.Z]
// Exit codes: 0 they agree, 1 they do not, 2 usage.
import { readFileSync } from "node:fs";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const repo = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const want = process.argv[2];
if (process.argv.length > 3 || (want !== undefined && !/^\d+\.\d+\.\d+$/.test(want))) {
console.error("usage: node scripts/check-version.mjs [X.Y.Z]");
process.exit(2);
}
function cargo() {
const text = readFileSync(join(repo, "Cargo.toml"), "utf8");
const section = /^\[workspace\.package\]\s*$([\s\S]*?)(?=^\[|(?![\s\S]))/m.exec(text);
const v = section && /^version\s*=\s*"([^"]*)"\s*$/m.exec(section[1]);
return v ? v[1] : null;
}
const pkg = (p) => JSON.parse(readFileSync(join(repo, p), "utf8")).version ?? null;
const found = [
["Cargo.toml [workspace.package]", cargo()],
["apps/web/package.json", pkg("apps/web/package.json")],
["packages/ui/package.json", pkg("packages/ui/package.json")],
];
const expected = want ?? found[0][1];
const wrong = found.filter(([, v]) => v !== expected);
for (const [where, v] of found) console.log(`${where}: ${v ?? "(none)"}`);
if (wrong.length) {
console.error(`version: expected ${expected} everywhere; ${wrong.map(([w, v]) => `${w} has ${v ?? "none"}`).join(", ")}`);
process.exit(1);
}
console.log(`version: ${expected} everywhere`);