mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 18:26:51 +00:00
fix(ci): isolate trusted release tooling dependencies
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user