fix(ci): isolate trusted release tooling dependencies

This commit is contained in:
Peter Steinberger
2026-07-17 09:12:58 +01:00
parent 1573c78f5b
commit 8858944a81
4 changed files with 34 additions and 2 deletions
@@ -601,8 +601,25 @@ jobs:
- name: Setup Node environment
uses: ./.github/actions/setup-node-env
with:
install-deps: "false"
install-bun: "false"
- name: Install trusted release tooling dependencies
env:
CI: "true"
run: |
set -euo pipefail
install_args=(
--dir .release-harness
install
--frozen-lockfile
--prefer-offline
--config.engine-strict=false
--config.enable-pre-post-scripts=true
--config.side-effects-cache=true
)
pnpm "${install_args[@]}" || pnpm "${install_args[@]}"
- name: Resolve ClawHub release plan
id: clawhub_plan
env:
+1 -1
View File
@@ -25,11 +25,11 @@ import {
} from "node:path";
import { pathToFileURL } from "node:url";
import { expectDefined } from "../packages/normalization-core/src/expect.js";
import { formatErrorMessage } from "../src/infra/errors.ts";
import { ALWAYS_ALLOWED_RUNTIME_DIR_NAMES } from "../src/plugin-sdk/facade-activation-contract.ts";
import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts";
import { readBoundedResponseText } from "./lib/bounded-response.ts";
import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entries.mjs";
import { formatErrorMessage } from "./lib/error-format.mjs";
import { runNpmVerifyCommand } from "./lib/npm-verify-exec.ts";
import {
collectRuntimeDependencySpecs,
+8 -1
View File
@@ -1,6 +1,6 @@
import { generateKeyPairSync, sign } from "node:crypto";
// OpenClaw npm postpublish tests validate postpublish verification behavior.
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { describe, expect, it, vi } from "vitest";
@@ -28,6 +28,13 @@ import {
const INSTALLED_ROOT_DIST_JS_FILE_SCAN_LIMIT = 10_000;
describe("parseOpenClawNpmPostpublishVerifyArgs", () => {
it("keeps trusted release verification independent from target app dependencies", () => {
const source = readFileSync("scripts/openclaw-npm-postpublish-verify.ts", "utf8");
expect(source).toContain('from "./lib/error-format.mjs"');
expect(source).not.toContain('from "../src/infra/errors.ts"');
});
it("supports help and package-manager separators", () => {
expect(parseOpenClawNpmPostpublishVerifyArgs(["--help"])).toEqual({
help: true,
@@ -3930,6 +3930,11 @@ describe("package artifact reuse", () => {
releasePublishJob,
"Checkout trusted release tooling",
);
const releaseNodeSetup = workflowStep(releasePublishJob, "Setup Node environment");
const trustedReleaseToolingInstall = workflowStep(
releasePublishJob,
"Install trusted release tooling dependencies",
);
const trustedClawHubPlan = workflowStep(releasePublishJob, "Resolve ClawHub release plan");
expect(packageJson.scripts?.["release:verify-beta"]).toBe(
@@ -3944,6 +3949,9 @@ describe("package artifact reuse", () => {
expect(packageJson.scripts?.["release:fast-pretag-check"]).toBe(
"bash scripts/release-fast-pretag-check.sh",
);
expect(releaseNodeSetup.with?.["install-deps"]).toBe("false");
expect(trustedReleaseToolingInstall.run).toContain("--dir .release-harness");
expect(trustedReleaseToolingInstall.run).toContain("--frozen-lockfile");
expect(fastPretagScript).toContain(
"node --import tsx scripts/plugin-release-pretag-pack-check.ts",
);