|
24 | 24 | description: Approved OpenClaw Release Publish workflow run id |
25 | 25 | required: false |
26 | 26 | type: string |
| 27 | + dry_run: |
| 28 | + description: Validate the full ClawHub artifact handoff without publishing. |
| 29 | + required: false |
| 30 | + default: false |
| 31 | + type: boolean |
27 | 32 |
|
28 | 33 | concurrency: |
29 | 34 | group: plugin-clawhub-release-${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.sha }} |
|
35 | 40 | CLAWHUB_REGISTRY: "https://clawhub.ai" |
36 | 41 | CLAWHUB_REPOSITORY: "openclaw/clawhub" |
37 | 42 | # Pinned to a reviewed ClawHub commit so release behavior stays reproducible. |
38 | | - CLAWHUB_REF: "facf20ceb6cc459e2872d941e71335a784bbc55c" |
| 43 | + CLAWHUB_REF: "c9bb13023598dcc547fdf4a93b9d42512b8c8854" |
39 | 44 |
|
40 | 45 | jobs: |
41 | 46 | preview_plugins_clawhub: |
@@ -326,15 +331,12 @@ jobs: |
326 | 331 | PACKAGE_DIR: ${{ matrix.plugin.packageDir }} |
327 | 332 | run: bash scripts/plugin-clawhub-publish.sh --dry-run "${PACKAGE_DIR}" |
328 | 333 |
|
329 | | - publish_plugins_clawhub: |
| 334 | + pack_plugins_clawhub_artifacts: |
330 | 335 | needs: [preview_plugins_clawhub, preview_plugin_pack, validate_release_publish_approval] |
331 | 336 | if: github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' |
332 | 337 | runs-on: ubuntu-latest |
333 | | - environment: clawhub-plugin-release |
334 | 338 | permissions: |
335 | | - actions: read |
336 | 339 | contents: read |
337 | | - id-token: write |
338 | 340 | strategy: |
339 | 341 | fail-fast: false |
340 | 342 | max-parallel: 32 |
@@ -407,82 +409,73 @@ jobs: |
407 | 409 | chmod +x "$RUNNER_TEMP/clawhub" |
408 | 410 | echo "$RUNNER_TEMP" >> "$GITHUB_PATH" |
409 | 411 |
|
410 | | - - name: Write ClawHub token config |
411 | | - env: |
412 | | - CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }} |
413 | | - CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }} |
414 | | - run: | |
415 | | - set -euo pipefail |
416 | | - if [[ -z "${CLAWHUB_TOKEN}" ]]; then |
417 | | - echo "No CLAWHUB_TOKEN secret configured; publish will rely on GitHub OIDC trusted publishing." |
418 | | - exit 0 |
419 | | - fi |
420 | | - node --input-type=module <<'EOF' |
421 | | - import { writeFileSync } from "node:fs"; |
422 | | - import { join } from "node:path"; |
423 | | -
|
424 | | - const path = join(process.env.RUNNER_TEMP, "clawhub-config.json"); |
425 | | - writeFileSync( |
426 | | - path, |
427 | | - `${JSON.stringify( |
428 | | - { |
429 | | - registry: process.env.CLAWHUB_REGISTRY, |
430 | | - token: process.env.CLAWHUB_TOKEN, |
431 | | - }, |
432 | | - null, |
433 | | - 2, |
434 | | - )}\n`, |
435 | | - ); |
436 | | - console.log(path); |
437 | | - EOF |
438 | | - echo "CLAWHUB_CONFIG_PATH=${RUNNER_TEMP}/clawhub-config.json" >> "$GITHUB_ENV" |
439 | | -
|
440 | | - - name: Check ClawHub package version |
441 | | - id: clawhub_package_version |
442 | | - env: |
443 | | - PACKAGE_NAME: ${{ matrix.plugin.packageName }} |
444 | | - PACKAGE_VERSION: ${{ matrix.plugin.version }} |
445 | | - CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }} |
446 | | - run: | |
447 | | - set -euo pipefail |
448 | | - encoded_name="$(node -e 'console.log(encodeURIComponent(process.env.PACKAGE_NAME ?? ""))')" |
449 | | - encoded_version="$(node -e 'console.log(encodeURIComponent(process.env.PACKAGE_VERSION ?? ""))')" |
450 | | - url="${CLAWHUB_REGISTRY%/}/api/v1/packages/${encoded_name}/versions/${encoded_version}" |
451 | | - status="" |
452 | | - for attempt in $(seq 1 8); do |
453 | | - status="$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' "${url}")" |
454 | | - if [[ "${status}" == "404" || "${status}" =~ ^2 ]]; then |
455 | | - break |
456 | | - fi |
457 | | - if [[ "${status}" == "429" || "${status}" =~ ^5 ]]; then |
458 | | - echo "ClawHub availability check returned ${status} for ${PACKAGE_NAME}@${PACKAGE_VERSION}; retrying (${attempt}/8)." |
459 | | - sleep 60 |
460 | | - continue |
461 | | - fi |
462 | | - break |
463 | | - done |
464 | | - if [[ "${status}" =~ ^2 ]]; then |
465 | | - echo "${PACKAGE_NAME}@${PACKAGE_VERSION} is already published on ClawHub." |
466 | | - echo "already_published=true" >> "$GITHUB_OUTPUT" |
467 | | - exit 0 |
468 | | - fi |
469 | | - if [[ "${status}" != "404" ]]; then |
470 | | - echo "Unexpected ClawHub response (${status}) for ${PACKAGE_NAME}@${PACKAGE_VERSION}." |
471 | | - exit 1 |
472 | | - fi |
473 | | - echo "already_published=false" >> "$GITHUB_OUTPUT" |
474 | | -
|
475 | | - - name: Publish |
476 | | - if: steps.clawhub_package_version.outputs.already_published != 'true' |
| 412 | + - name: Pack ClawHub package artifact |
477 | 413 | env: |
478 | 414 | CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }} |
479 | 415 | SOURCE_REPO: ${{ github.repository }} |
480 | 416 | SOURCE_COMMIT: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }} |
481 | 417 | SOURCE_REF: ${{ github.ref }} |
482 | 418 | PACKAGE_TAG: ${{ matrix.plugin.publishTag }} |
483 | 419 | PACKAGE_DIR: ${{ matrix.plugin.packageDir }} |
484 | | - run: bash scripts/plugin-clawhub-publish.sh --publish "${PACKAGE_DIR}" |
| 420 | + OPENCLAW_CLAWHUB_PACK_OUTPUT_DIR: ${{ runner.temp }}/clawhub-package-artifact |
| 421 | + run: bash scripts/plugin-clawhub-publish.sh --pack "${PACKAGE_DIR}" |
485 | 422 |
|
| 423 | + - name: Upload ClawHub package artifact |
| 424 | + uses: actions/upload-artifact@v7 |
| 425 | + with: |
| 426 | + name: ${{ matrix.plugin.artifactName }} |
| 427 | + path: ${{ runner.temp }}/clawhub-package-artifact/*.tgz |
| 428 | + if-no-files-found: error |
| 429 | + retention-days: 7 |
| 430 | + |
| 431 | + approve_plugin_clawhub_release: |
| 432 | + needs: [preview_plugins_clawhub, pack_plugins_clawhub_artifacts] |
| 433 | + if: github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' |
| 434 | + runs-on: ubuntu-latest |
| 435 | + environment: clawhub-plugin-release |
| 436 | + permissions: {} |
| 437 | + steps: |
| 438 | + - name: Approve ClawHub package publish |
| 439 | + run: echo "ClawHub package publish approved." |
| 440 | + |
| 441 | + publish_plugins_clawhub: |
| 442 | + needs: [preview_plugins_clawhub, pack_plugins_clawhub_artifacts, approve_plugin_clawhub_release] |
| 443 | + if: github.event_name == 'workflow_dispatch' && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' |
| 444 | + permissions: |
| 445 | + actions: read |
| 446 | + contents: read |
| 447 | + id-token: write |
| 448 | + strategy: |
| 449 | + fail-fast: false |
| 450 | + max-parallel: 32 |
| 451 | + matrix: |
| 452 | + plugin: ${{ fromJson(needs.preview_plugins_clawhub.outputs.matrix) }} |
| 453 | + uses: openclaw/clawhub/.github/workflows/package-publish.yml@c9bb13023598dcc547fdf4a93b9d42512b8c8854 |
| 454 | + with: |
| 455 | + dry_run: ${{ inputs.dry_run }} |
| 456 | + json: true |
| 457 | + package_artifact_name: ${{ matrix.plugin.artifactName }} |
| 458 | + registry: https://clawhub.ai |
| 459 | + site: https://clawhub.ai |
| 460 | + source_repo: ${{ github.repository }} |
| 461 | + source_commit: ${{ needs.preview_plugins_clawhub.outputs.ref_revision }} |
| 462 | + source_ref: ${{ github.ref }} |
| 463 | + tags: ${{ matrix.plugin.publishTag }} |
| 464 | + secrets: |
| 465 | + clawhub_token: ${{ secrets.CLAWHUB_TOKEN }} |
| 466 | + |
| 467 | + verify_published_clawhub_package: |
| 468 | + needs: [preview_plugins_clawhub, publish_plugins_clawhub] |
| 469 | + if: github.event_name == 'workflow_dispatch' && inputs.dry_run != true && needs.preview_plugins_clawhub.outputs.has_candidates == 'true' |
| 470 | + runs-on: ubuntu-latest |
| 471 | + permissions: |
| 472 | + contents: read |
| 473 | + strategy: |
| 474 | + fail-fast: false |
| 475 | + max-parallel: 32 |
| 476 | + matrix: |
| 477 | + plugin: ${{ fromJson(needs.preview_plugins_clawhub.outputs.matrix) }} |
| 478 | + steps: |
486 | 479 | - name: Verify published ClawHub package |
487 | 480 | env: |
488 | 481 | CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }} |
|
0 commit comments