Skip to content

Commit 8858944

Browse files
committed
fix(ci): isolate trusted release tooling dependencies
1 parent 1573c78 commit 8858944

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/openclaw-release-publish.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,25 @@ jobs:
601601
- name: Setup Node environment
602602
uses: ./.github/actions/setup-node-env
603603
with:
604+
install-deps: "false"
604605
install-bun: "false"
605606

607+
- name: Install trusted release tooling dependencies
608+
env:
609+
CI: "true"
610+
run: |
611+
set -euo pipefail
612+
install_args=(
613+
--dir .release-harness
614+
install
615+
--frozen-lockfile
616+
--prefer-offline
617+
--config.engine-strict=false
618+
--config.enable-pre-post-scripts=true
619+
--config.side-effects-cache=true
620+
)
621+
pnpm "${install_args[@]}" || pnpm "${install_args[@]}"
622+
606623
- name: Resolve ClawHub release plan
607624
id: clawhub_plan
608625
env:

scripts/openclaw-npm-postpublish-verify.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import {
2525
} from "node:path";
2626
import { pathToFileURL } from "node:url";
2727
import { expectDefined } from "../packages/normalization-core/src/expect.js";
28-
import { formatErrorMessage } from "../src/infra/errors.ts";
2928
import { ALWAYS_ALLOWED_RUNTIME_DIR_NAMES } from "../src/plugin-sdk/facade-activation-contract.ts";
3029
import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts";
3130
import { readBoundedResponseText } from "./lib/bounded-response.ts";
3231
import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entries.mjs";
32+
import { formatErrorMessage } from "./lib/error-format.mjs";
3333
import { runNpmVerifyCommand } from "./lib/npm-verify-exec.ts";
3434
import {
3535
collectRuntimeDependencySpecs,

test/openclaw-npm-postpublish-verify.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { generateKeyPairSync, sign } from "node:crypto";
22
// OpenClaw npm postpublish tests validate postpublish verification behavior.
3-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
3+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
44
import { tmpdir } from "node:os";
55
import { dirname, join } from "node:path";
66
import { describe, expect, it, vi } from "vitest";
@@ -28,6 +28,13 @@ import {
2828
const INSTALLED_ROOT_DIST_JS_FILE_SCAN_LIMIT = 10_000;
2929

3030
describe("parseOpenClawNpmPostpublishVerifyArgs", () => {
31+
it("keeps trusted release verification independent from target app dependencies", () => {
32+
const source = readFileSync("scripts/openclaw-npm-postpublish-verify.ts", "utf8");
33+
34+
expect(source).toContain('from "./lib/error-format.mjs"');
35+
expect(source).not.toContain('from "../src/infra/errors.ts"');
36+
});
37+
3138
it("supports help and package-manager separators", () => {
3239
expect(parseOpenClawNpmPostpublishVerifyArgs(["--help"])).toEqual({
3340
help: true,

test/scripts/package-acceptance-workflow.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,6 +3930,11 @@ describe("package artifact reuse", () => {
39303930
releasePublishJob,
39313931
"Checkout trusted release tooling",
39323932
);
3933+
const releaseNodeSetup = workflowStep(releasePublishJob, "Setup Node environment");
3934+
const trustedReleaseToolingInstall = workflowStep(
3935+
releasePublishJob,
3936+
"Install trusted release tooling dependencies",
3937+
);
39333938
const trustedClawHubPlan = workflowStep(releasePublishJob, "Resolve ClawHub release plan");
39343939

39353940
expect(packageJson.scripts?.["release:verify-beta"]).toBe(
@@ -3944,6 +3949,9 @@ describe("package artifact reuse", () => {
39443949
expect(packageJson.scripts?.["release:fast-pretag-check"]).toBe(
39453950
"bash scripts/release-fast-pretag-check.sh",
39463951
);
3952+
expect(releaseNodeSetup.with?.["install-deps"]).toBe("false");
3953+
expect(trustedReleaseToolingInstall.run).toContain("--dir .release-harness");
3954+
expect(trustedReleaseToolingInstall.run).toContain("--frozen-lockfile");
39473955
expect(fastPretagScript).toContain(
39483956
"node --import tsx scripts/plugin-release-pretag-pack-check.ts",
39493957
);

0 commit comments

Comments
 (0)