


























@@ -15,6 +15,10 @@ on:
1515description: Successful Full Release Validation run id for this tag/SHA, required when publish_openclaw_npm=true
1616required: false
1717type: string
18+npm_telegram_run_id:
19+description: Optional successful NPM Telegram Beta E2E run id to include in final release evidence
20+required: false
21+type: string
1822npm_dist_tag:
1923description: npm dist-tag for the OpenClaw package
2024required: true
@@ -323,6 +327,12 @@ jobs:
323327fetch-depth: 1
324328persist-credentials: false
325329330+ - name: Setup Node environment
331+uses: ./.github/actions/setup-node-env
332+with:
333+install-bun: "false"
334+cache-key-suffix: release-publish
335+326336 - name: Dispatch publish workflows
327337env:
328338GH_TOKEN: ${{ github.token }}
@@ -337,6 +347,8 @@ jobs:
337347PUBLISH_OPENCLAW_NPM: ${{ inputs.publish_openclaw_npm && 'true' || 'false' }}
338348WAIT_FOR_CLAWHUB: ${{ inputs.wait_for_clawhub && 'true' || 'false' }}
339349PREFLIGHT_ARTIFACT_NAME: ${{ needs.resolve_release_target.outputs.preflight_artifact_name }}
350+NPM_TELEGRAM_RUN_ID: ${{ inputs.npm_telegram_run_id }}
351+POSTPUBLISH_EVIDENCE_DIR: ${{ runner.temp }}/openclaw-release-postpublish-evidence
340352run: |
341353 set -euo pipefail
342354@@ -402,6 +414,56 @@ jobs:
402414 done < <(printf '%s' "${pending_json}" | jq -r '.[] | [.environment.id, .environment.name, .current_user_can_approve] | @tsv')
403415 }
404416417+ approve_pending_deployments() {
418+ local workflow="$1"
419+ local run_id="$2"
420+ local pending_json approved
421+422+ pending_json="$(gh api -X GET "repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/pending_deployments" 2>/dev/null || true)"
423+ if [[ -z "${pending_json}" ]] || ! printf '%s' "${pending_json}" | jq -e 'length > 0' >/dev/null 2>&1; then
424+ return 0
425+ fi
426+427+ approved=0
428+ while IFS=$'\t' read -r env_id env_name; do
429+ if [[ -z "${env_id}" ]]; then
430+ continue
431+ fi
432+ echo "${workflow}: approving pending environment ${env_name} (${env_id})"
433+ gh api -X POST "repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/pending_deployments" \
434+ -F "environment_ids[]=${env_id}" \
435+ -f state=approved \
436+ -f comment="Approve release gate from OpenClaw Release Publish wrapper" >/dev/null
437+ approved=1
438+ done < <(printf '%s' "${pending_json}" | jq -r '.[] | select(.current_user_can_approve == true) | [.environment.id, .environment.name] | @tsv')
439+440+ if [[ "${approved}" == "1" ]]; then
441+ echo "${workflow}: approved available pending environment gates"
442+ fi
443+ }
444+445+ print_failed_run_summary() {
446+ local run_id="$1"
447+ local failed_json
448+449+ failed_json="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json jobs \
450+ --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {databaseId, name, conclusion, url}' || true)"
451+ if [[ -z "${failed_json}" ]]; then
452+ return 0
453+ fi
454+455+ echo "Failed child job summary:"
456+ printf '%s\n' "${failed_json}"
457+ while IFS=$'\t' read -r job_id job_name; do
458+ if [[ -z "${job_id}" ]]; then
459+ continue
460+ fi
461+ echo "--- ${job_name} (${job_id}) log tail ---"
462+ gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --job "${job_id}" --log 2>/dev/null |
463+ tail -200 || true
464+ done < <(printf '%s\n' "${failed_json}" | jq -r '[.databaseId, .name] | @tsv' 2>/dev/null || true)
465+ }
466+405467 wait_for_run() {
406468 local workflow="$1"
407469 local run_id="$2"
@@ -420,6 +482,7 @@ jobs:
420482 if [[ "$state" != "$last_state" ]]; then
421483 echo "${workflow} still ${status} (updated ${updated_at}): ${url}"
422484 print_pending_deployments "${workflow}" "${run_id}"
485+ approve_pending_deployments "${workflow}" "${run_id}"
423486 last_state="$state"
424487 fi
425488 sleep 30
@@ -447,7 +510,7 @@ jobs:
447510 echo "- ${workflow}: ${conclusion} in ${duration_label} (${url})"
448511 } >> "$GITHUB_STEP_SUMMARY"
449512 if [[ "$conclusion" != "success" ]]; then
450- gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json jobs --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, conclusion, url}' || true
513+ print_failed_run_summary "${run_id}"
451514 return 1
452515 fi
453516 }
@@ -547,6 +610,42 @@ jobs:
547610 echo "- Dependency evidence asset: \`${asset_name}\`" >> "$GITHUB_STEP_SUMMARY"
548611 }
549612613+ verify_published_release() {
614+ local release_version evidence_path
615+ local -a verify_args
616+617+ release_version="${RELEASE_TAG#v}"
618+ evidence_path="${POSTPUBLISH_EVIDENCE_DIR}/release-postpublish-evidence.json"
619+ mkdir -p "${POSTPUBLISH_EVIDENCE_DIR}"
620+621+ verify_args=(
622+ release:verify-beta
623+ --
624+ "${release_version}"
625+ --tag "${RELEASE_TAG}"
626+ --dist-tag "${RELEASE_NPM_DIST_TAG}"
627+ --repo "${GITHUB_REPOSITORY}"
628+ --workflow-ref "${CHILD_WORKFLOW_REF}"
629+ --full-release-validation-run "${FULL_RELEASE_VALIDATION_RUN_ID}"
630+ --plugin-npm-run "${plugin_npm_run_id}"
631+ --plugin-clawhub-run "${plugin_clawhub_run_id}"
632+ --openclaw-npm-run "${openclaw_npm_run_id}"
633+ --evidence-out "${evidence_path}"
634+ )
635+ if [[ -n "${PLUGINS// }" ]]; then
636+ verify_args+=(--plugins "${PLUGINS}")
637+ fi
638+ if [[ -n "${NPM_TELEGRAM_RUN_ID// }" ]]; then
639+ verify_args+=(--npm-telegram-run "${NPM_TELEGRAM_RUN_ID}")
640+ fi
641+642+ pnpm "${verify_args[@]}"
643+ {
644+ echo "- Postpublish verification: passed"
645+ echo "- Postpublish evidence: \`${evidence_path}\`"
646+ } >> "$GITHUB_STEP_SUMMARY"
647+ }
648+550649 {
551650 echo "### Publish sequence"
552651 echo
@@ -555,11 +654,11 @@ jobs:
555654 echo "- Release SHA: \`${TARGET_SHA}\`"
556655 echo "- Plugin npm and ClawHub publish: dispatched in parallel"
557656 if [[ "${PUBLISH_OPENCLAW_NPM}" == "true" ]]; then
558- echo "- OpenClaw npm publish: starts after plugin npm succeeds; ClawHub may still be running"
657+ echo "- OpenClaw npm publish: starts after plugin npm succeeds; final verification waits for ClawHub"
559658 else
560659 echo "- OpenClaw npm publish: skipped by input"
561660 fi
562- if [[ "${WAIT_FOR_CLAWHUB}" == "true" ]]; then
661+ if [[ "${WAIT_FOR_CLAWHUB}" == "true" || "${PUBLISH_OPENCLAW_NPM}" == "true" ]]; then
563662 echo "- Workflow completion waits for ClawHub"
564663 else
565664 echo "- Workflow completion does not wait for ClawHub; monitor the dispatched ClawHub run separately"
@@ -601,7 +700,7 @@ jobs:
601700602701 clawhub_result=""
603702 clawhub_pid=""
604- if [[ "${WAIT_FOR_CLAWHUB}" == "true" ]]; then
703+ if [[ "${WAIT_FOR_CLAWHUB}" == "true" || "${PUBLISH_OPENCLAW_NPM}" == "true" ]]; then
605704 clawhub_result="$RUNNER_TEMP/clawhub-result.txt"
606705 wait_run_pid=""
607706 wait_for_run_background plugin-clawhub-release.yml "${plugin_clawhub_run_id}" "${clawhub_result}"
@@ -620,23 +719,39 @@ jobs:
620719 fi
621720622721 failed=0
623- if [[ -n "${clawhub_pid}" ]] && ! wait "${clawhub_pid}"; then
722+ openclaw_failed=0
723+ if [[ -n "${openclaw_pid}" ]] && ! wait "${openclaw_pid}"; then
624724 failed=1
725+ openclaw_failed=1
625726 fi
626- if [[ -n "${openclaw_pid}" ]] && ! wait "${openclaw_pid}"; then
727+ if [[ -n "${openclaw_result}" && -f "${openclaw_result}" && "$(cat "${openclaw_result}")" != "success" ]]; then
627728 failed=1
729+ openclaw_failed=1
628730 fi
629- if [[ -f "${clawhub_result}" && "$(cat "${clawhub_result}")" != "success" ]]; then
731+732+ if [[ -n "${openclaw_npm_run_id}" && "${openclaw_failed}" == "0" ]]; then
733+ create_or_update_github_release
734+ upload_dependency_evidence_release_asset
735+ fi
736+737+ if [[ -n "${clawhub_pid}" ]] && ! wait "${clawhub_pid}"; then
630738 failed=1
631739 fi
632- if [[ -n "${openclaw_result}" && -f "${openclaw_result}" && "$(cat "${openclaw_result}")" != "success" ]]; then
740+ if [[ -f "${clawhub_result}" && "$(cat "${clawhub_result}")" != "success" ]]; then
633741 failed=1
634742 fi
743+744+ if [[ "${failed}" == "0" && -n "${openclaw_npm_run_id}" ]]; then
745+ verify_published_release
746+ fi
635747 if [[ "${failed}" != "0" ]]; then
636748 exit 1
637749 fi
638750639- if [[ -n "${openclaw_npm_run_id}" ]]; then
640- create_or_update_github_release
641- upload_dependency_evidence_release_asset
642- fi
751+ - name: Upload postpublish evidence
752+if: ${{ always() }}
753+uses: actions/upload-artifact@v7
754+with:
755+name: openclaw-release-postpublish-evidence-${{ inputs.tag }}
756+path: ${{ runner.temp }}/openclaw-release-postpublish-evidence
757+if-no-files-found: ignore
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。