Skip to content

Commit 0604d25

Browse files
committed
ci(release): preserve direct repair publishes
1 parent 1e8d966 commit 0604d25

6 files changed

Lines changed: 101 additions & 32 deletions

‎.github/workflows/full-release-validation.yml‎

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,36 @@ jobs:
210210
fi
211211
} >> "$GITHUB_STEP_SUMMARY"
212212
213+
docker_runtime_assets_preflight:
214+
name: Verify Docker runtime-assets prune path
215+
needs: [resolve_target]
216+
if: inputs.rerun_group == 'all'
217+
runs-on: ubuntu-24.04
218+
timeout-minutes: 45
219+
permissions:
220+
contents: read
221+
steps:
222+
- name: Checkout target SHA
223+
uses: actions/checkout@v6
224+
with:
225+
ref: ${{ needs.resolve_target.outputs.sha }}
226+
fetch-depth: 1
227+
persist-credentials: false
228+
229+
- name: Verify Docker runtime-assets prune path
230+
env:
231+
DOCKER_BUILDKIT: "1"
232+
run: |
233+
set -euo pipefail
234+
timeout --foreground --kill-after=30s 35m docker build \
235+
--target runtime-assets \
236+
--build-arg OPENCLAW_EXTENSIONS="matrix" \
237+
.
238+
213239
normal_ci:
214240
name: Run normal full CI
215-
needs: [resolve_target]
216-
if: contains(fromJSON('["all","ci"]'), inputs.rerun_group)
241+
needs: [resolve_target, docker_runtime_assets_preflight]
242+
if: ${{ always() && contains(fromJSON('["all","ci"]'), inputs.rerun_group) && (inputs.rerun_group != 'all' || needs.docker_runtime_assets_preflight.result == 'success') }}
217243
runs-on: ubuntu-24.04
218244
timeout-minutes: ${{ inputs.release_profile != 'minimum' && 240 || 60 }}
219245
outputs:
@@ -312,8 +338,8 @@ jobs:
312338
313339
plugin_prerelease:
314340
name: Run plugin prerelease validation
315-
needs: [resolve_target]
316-
if: contains(fromJSON('["all","plugin-prerelease"]'), inputs.rerun_group)
341+
needs: [resolve_target, docker_runtime_assets_preflight]
342+
if: ${{ always() && contains(fromJSON('["all","plugin-prerelease"]'), inputs.rerun_group) && (inputs.rerun_group != 'all' || needs.docker_runtime_assets_preflight.result == 'success') }}
317343
runs-on: ubuntu-24.04
318344
timeout-minutes: ${{ inputs.release_profile == 'full' && 300 || inputs.release_profile == 'stable' && 240 || 60 }}
319345
outputs:
@@ -412,8 +438,8 @@ jobs:
412438
413439
release_checks:
414440
name: Run release/live/Docker/QA validation
415-
needs: [resolve_target]
416-
if: contains(fromJSON('["all","release-checks","install-smoke","cross-os","live-e2e","package","qa","qa-parity","qa-live"]'), inputs.rerun_group)
441+
needs: [resolve_target, docker_runtime_assets_preflight]
442+
if: ${{ always() && contains(fromJSON('["all","release-checks","install-smoke","cross-os","live-e2e","package","qa","qa-parity","qa-live"]'), inputs.rerun_group) && (inputs.rerun_group != 'all' || needs.docker_runtime_assets_preflight.result == 'success') }}
417443
runs-on: ubuntu-24.04
418444
timeout-minutes: ${{ inputs.release_profile != 'minimum' && 240 || 60 }}
419445
outputs:
@@ -565,8 +591,8 @@ jobs:
565591
566592
prepare_release_package:
567593
name: Prepare release package artifact
568-
needs: [resolve_target]
569-
if: ${{ inputs.npm_telegram_package_spec == '' && inputs.release_package_spec == '' && inputs.rerun_group == 'all' && inputs.release_profile == 'full' }}
594+
needs: [resolve_target, docker_runtime_assets_preflight]
595+
if: ${{ always() && inputs.npm_telegram_package_spec == '' && inputs.release_package_spec == '' && inputs.rerun_group == 'all' && inputs.release_profile == 'full' && needs.docker_runtime_assets_preflight.result == 'success' }}
570596
runs-on: ubuntu-24.04
571597
timeout-minutes: 15
572598
permissions:
@@ -735,7 +761,7 @@ jobs:
735761
736762
summary:
737763
name: Verify full validation
738-
needs: [resolve_target, normal_ci, plugin_prerelease, release_checks, npm_telegram]
764+
needs: [resolve_target, docker_runtime_assets_preflight, normal_ci, plugin_prerelease, release_checks, npm_telegram]
739765
if: always()
740766
runs-on: ubuntu-24.04
741767
timeout-minutes: 5
@@ -751,6 +777,8 @@ jobs:
751777
PLUGIN_PRERELEASE_RESULT: ${{ needs.plugin_prerelease.result }}
752778
RELEASE_CHECKS_RESULT: ${{ needs.release_checks.result }}
753779
NPM_TELEGRAM_RESULT: ${{ needs.npm_telegram.result }}
780+
DOCKER_RUNTIME_ASSETS_PREFLIGHT_RESULT: ${{ needs.docker_runtime_assets_preflight.result }}
781+
RERUN_GROUP: ${{ inputs.rerun_group }}
754782
TARGET_SHA: ${{ needs.resolve_target.outputs.sha }}
755783
CHILD_WORKFLOW_REF: ${{ github.ref_name }}
756784
run: |
@@ -798,6 +826,7 @@ jobs:
798826
echo
799827
echo "| Child | Result | Minutes | Head SHA | Run |"
800828
echo "| --- | --- | ---: | --- | --- |"
829+
echo "| \`docker_runtime_assets_preflight\` | \`${DOCKER_RUNTIME_ASSETS_PREFLIGHT_RESULT}\` | | current workflow | |"
801830
} >> "$GITHUB_STEP_SUMMARY"
802831
803832
append_child_row() {
@@ -933,23 +962,29 @@ jobs:
933962
}
934963
935964
failed=0
965+
required_after_preflight=1
966+
if [[ "$RERUN_GROUP" == "all" && "$DOCKER_RUNTIME_ASSETS_PREFLIGHT_RESULT" != "success" ]]; then
967+
echo "::error::Docker runtime-assets preflight ended with ${DOCKER_RUNTIME_ASSETS_PREFLIGHT_RESULT}."
968+
failed=1
969+
required_after_preflight=0
970+
fi
936971
937972
append_child_overview
938973
939974
if [[ "$NORMAL_CI_RESULT" == "skipped" && -z "${NORMAL_CI_RUN_ID// }" ]]; then
940-
check_child "normal_ci" "" 0 || failed=1
975+
check_child "normal_ci" "" "$required_after_preflight" || failed=1
941976
else
942977
check_child "normal_ci" "$NORMAL_CI_RUN_ID" 1 || failed=1
943978
fi
944979
945980
if [[ "$PLUGIN_PRERELEASE_RESULT" == "skipped" && -z "${PLUGIN_PRERELEASE_RUN_ID// }" ]]; then
946-
check_child "plugin_prerelease" "" 0 || failed=1
981+
check_child "plugin_prerelease" "" "$required_after_preflight" || failed=1
947982
else
948983
check_child "plugin_prerelease" "$PLUGIN_PRERELEASE_RUN_ID" 1 || failed=1
949984
fi
950985
951986
if [[ "$RELEASE_CHECKS_RESULT" == "skipped" && -z "${RELEASE_CHECKS_RUN_ID// }" ]]; then
952-
check_child "release_checks" "" 0 || failed=1
987+
check_child "release_checks" "" "$required_after_preflight" || failed=1
953988
else
954989
check_child "release_checks" "$RELEASE_CHECKS_RUN_ID" 1 || failed=1
955990
fi

‎.github/workflows/openclaw-npm-release.yml‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,16 +337,6 @@ jobs:
337337
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
338338
node --import tsx scripts/openclaw-npm-prepublish-verify.ts "$TARBALL_PATH" "$PACKAGE_VERSION"
339339
340-
- name: Verify Docker runtime-assets prune path
341-
env:
342-
DOCKER_BUILDKIT: "1"
343-
run: |
344-
set -euo pipefail
345-
timeout --foreground --kill-after=30s 35m docker build \
346-
--target runtime-assets \
347-
--build-arg OPENCLAW_EXTENSIONS="matrix" \
348-
.
349-
350340
- name: Upload dependency release evidence
351341
uses: actions/upload-artifact@v7
352342
with:
@@ -415,8 +405,8 @@ jobs:
415405
echo "Real publish requires full_release_validation_run_id from a successful Full Release Validation run." >&2
416406
exit 1
417407
fi
418-
if [[ -z "${RELEASE_PUBLISH_RUN_ID// }" ]]; then
419-
echo "Real publish requires release_publish_run_id from the approved OpenClaw Release Publish workflow." >&2
408+
if [[ -z "${RELEASE_PUBLISH_RUN_ID// }" && "${GITHUB_ACTOR}" == "github-actions[bot]" ]]; then
409+
echo "Workflow-dispatched real publish requires release_publish_run_id from the approved OpenClaw Release Publish workflow." >&2
420410
exit 1
421411
fi
422412
@@ -427,6 +417,14 @@ jobs:
427417
EXPECTED_WORKFLOW_BRANCH: ${{ github.ref_name }}
428418
run: |
429419
set -euo pipefail
420+
if [[ -z "${RELEASE_PUBLISH_RUN_ID// }" ]]; then
421+
if [[ "${GITHUB_ACTOR}" == "github-actions[bot]" ]]; then
422+
echo "OpenClaw npm publish dispatched by another workflow must include release_publish_run_id." >&2
423+
exit 1
424+
fi
425+
echo "Direct OpenClaw npm publish; relying on this workflow's npm-release environment approval."
426+
exit 0
427+
fi
430428
if [[ "${GITHUB_ACTOR}" != "github-actions[bot]" ]]; then
431429
echo "OpenClaw npm publish must be dispatched by the OpenClaw Release Publish workflow, not directly by ${GITHUB_ACTOR}." >&2
432430
exit 1

‎.github/workflows/plugin-clawhub-release.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,12 @@ jobs:
217217
run: |
218218
set -euo pipefail
219219
if [[ -z "${RELEASE_PUBLISH_RUN_ID// }" ]]; then
220-
echo "Plugin ClawHub publish must be dispatched by OpenClaw Release Publish after its npm-release gate." >&2
221-
exit 1
220+
if [[ "${GITHUB_ACTOR}" == "github-actions[bot]" ]]; then
221+
echo "Plugin ClawHub publish dispatched by another workflow must include release_publish_run_id." >&2
222+
exit 1
223+
fi
224+
echo "Direct Plugin ClawHub Release dispatch; relying on this workflow's clawhub-plugin-release environment approval."
225+
exit 0
222226
fi
223227
if [[ "${GITHUB_ACTOR}" != "github-actions[bot]" ]]; then
224228
echo "Plugin ClawHub publish must be dispatched by the OpenClaw Release Publish workflow, not directly by ${GITHUB_ACTOR}." >&2

‎.github/workflows/plugin-npm-release.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ jobs:
194194
run: |
195195
set -euo pipefail
196196
if [[ -z "${RELEASE_PUBLISH_RUN_ID// }" ]]; then
197-
echo "Plugin npm publish must be dispatched by OpenClaw Release Publish after its npm-release gate." >&2
198-
exit 1
197+
if [[ "${GITHUB_ACTOR}" == "github-actions[bot]" ]]; then
198+
echo "Plugin npm publish dispatched by another workflow must include release_publish_run_id." >&2
199+
exit 1
200+
fi
201+
echo "Direct Plugin NPM Release dispatch; relying on this workflow's npm-release environment approval."
202+
exit 0
199203
fi
200204
if [[ "${GITHUB_ACTOR}" != "github-actions[bot]" ]]; then
201205
echo "Plugin npm publish must be dispatched by the OpenClaw Release Publish workflow, not directly by ${GITHUB_ACTOR}." >&2

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,12 @@ describe("package artifact reuse", () => {
721721
expect(workflow).toContain("CHILD_WORKFLOW_REF: ${{ github.ref_name }}");
722722
expect(workflow).toContain('gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@"');
723723
expect(preparePackageJob.name).toBe("Prepare release package artifact");
724-
expect(preparePackageJob.needs).toEqual(["resolve_target"]);
724+
expect(preparePackageJob.needs).toEqual(["resolve_target", "docker_runtime_assets_preflight"]);
725725
expect(preparePackageJob.if).toContain("inputs.rerun_group == 'all'");
726726
expect(preparePackageJob.if).toContain("inputs.release_profile == 'full'");
727+
expect(preparePackageJob.if).toContain(
728+
"needs.docker_runtime_assets_preflight.result == 'success'",
729+
);
727730
expectTextToIncludeAll(
728731
workflowStep(preparePackageJob, "Resolve release package artifact").run,
729732
[
@@ -883,6 +886,7 @@ describe("package artifact reuse", () => {
883886
it("keeps release publish creation compatible with gh api and prerelease notes", () => {
884887
const workflow = readFileSync(RELEASE_PUBLISH_WORKFLOW, "utf8");
885888
const npmWorkflow = readFileSync(".github/workflows/openclaw-npm-release.yml", "utf8");
889+
const fullReleaseWorkflow = readFileSync(FULL_RELEASE_VALIDATION_WORKFLOW, "utf8");
886890

887891
expect(workflow).toContain("timeout-minutes: 60");
888892
expect(workflow).toContain("environment: npm-release");
@@ -898,12 +902,20 @@ describe("package artifact reuse", () => {
898902
expect(npmWorkflow).toContain("preflight-manifest.json");
899903
expect(npmWorkflow).toContain("Verify full release validation run metadata");
900904
expect(npmWorkflow).toContain("Verify full release validation target");
901-
expect(npmWorkflow).toContain("Verify Docker runtime-assets prune path");
902-
expect(npmWorkflow).toContain("--target runtime-assets");
905+
expect(npmWorkflow).not.toContain("Verify Docker runtime-assets prune path");
906+
expect(fullReleaseWorkflow).toContain("docker_runtime_assets_preflight");
907+
expect(fullReleaseWorkflow).toContain("Verify Docker runtime-assets prune path");
908+
expect(fullReleaseWorkflow).toContain("--target runtime-assets");
909+
expect(fullReleaseWorkflow).toContain("inputs.rerun_group == 'all'");
910+
expect(fullReleaseWorkflow).toContain(
911+
"needs.docker_runtime_assets_preflight.result == 'success'",
912+
);
903913
expect(npmWorkflow).toContain("full_release_validation_run_id");
904914
expect(npmWorkflow).toContain("release_publish_run_id");
905915
expect(npmWorkflow).toContain("Real publish requires full_release_validation_run_id");
906-
expect(npmWorkflow).toContain("Real publish requires release_publish_run_id");
916+
expect(npmWorkflow).toContain(
917+
"Workflow-dispatched real publish requires release_publish_run_id",
918+
);
907919
expect(npmWorkflow).toContain("tarballSha256");
908920
expect(workflow).toContain("Checkout release SHA");
909921
expect(workflow).toContain('git show "${TARGET_SHA}:CHANGELOG.md" > "${changelog_file}"');
@@ -962,6 +974,9 @@ describe("package artifact reuse", () => {
962974
expect(pluginNpmWorkflow).toContain("Validate release publish approval run");
963975
expect(clawHubWorkflow).toContain("Validate release publish approval run");
964976
expect(openclawNpmWorkflow).toContain("Validate release publish approval run");
977+
expect(pluginNpmWorkflow).toContain("Direct Plugin NPM Release dispatch");
978+
expect(clawHubWorkflow).toContain("Direct Plugin ClawHub Release dispatch");
979+
expect(openclawNpmWorkflow).toContain("Direct OpenClaw npm publish");
965980
expect(pluginNpmWorkflow).toContain('GITHUB_ACTOR}" != "github-actions[bot]"');
966981
expect(clawHubWorkflow).toContain('GITHUB_ACTOR}" != "github-actions[bot]"');
967982
expect(openclawNpmWorkflow).toContain('GITHUB_ACTOR}" != "github-actions[bot]"');

‎test/scripts/plugin-prerelease-test-plan.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
481481
expect(releaseChecksWorkflow.jobs.summary["runs-on"]).toBe("ubuntu-24.04");
482482
for (const jobName of [
483483
"resolve_target",
484+
"docker_runtime_assets_preflight",
484485
"normal_ci",
485486
"plugin_prerelease",
486487
"release_checks",
@@ -493,6 +494,18 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
493494
expect(fullReleaseWorkflow.jobs.normal_ci["timeout-minutes"]).toBe(
494495
"${{ inputs.release_profile != 'minimum' && 240 || 60 }}",
495496
);
497+
expect(fullReleaseWorkflow.jobs.normal_ci.needs).toEqual([
498+
"resolve_target",
499+
"docker_runtime_assets_preflight",
500+
]);
501+
expect(fullReleaseWorkflow.jobs.docker_runtime_assets_preflight.if).toBe(
502+
"inputs.rerun_group == 'all'",
503+
);
504+
expect(
505+
fullReleaseWorkflow.jobs.docker_runtime_assets_preflight.steps.find(
506+
(step) => step.name === "Verify Docker runtime-assets prune path",
507+
).run,
508+
).toContain("--target runtime-assets");
496509
expect(fullReleaseWorkflow.jobs.plugin_prerelease["timeout-minutes"]).toBe(
497510
"${{ inputs.release_profile == 'full' && 300 || inputs.release_profile == 'stable' && 240 || 60 }}",
498511
);

0 commit comments

Comments
 (0)