From 5ea160f4ce26d1c863e1f95f97d663fb31075c3c Mon Sep 17 00:00:00 2001 From: Victor Kuznetsov Date: Sun, 26 Jul 2026 11:56:09 -0700 Subject: [PATCH] Include ComfyUI in library releases --- .github/workflows/distribute.yml | 77 +++++++++++++++++++++++++++++++- docs/release-and-distribution.md | 16 ++++--- 2 files changed, 85 insertions(+), 8 deletions(-) diff --git a/.github/workflows/distribute.yml b/.github/workflows/distribute.yml index 157b7e4..4cc8748 100644 --- a/.github/workflows/distribute.yml +++ b/.github/workflows/distribute.yml @@ -3,10 +3,11 @@ name: Distribute on release # Fans a published GitHub Release out to the channels that need a nudge. # PyPI is handled by publish.yml; the conda-forge channel is handled by its # autotick bot. This workflow updates the repository recipe and event-drives -# the two channels that would otherwise be manual: +# the three channels that would otherwise be manual: # - Homebrew tap: rewrite the formula's url + sha256 to the new sdist. # - HF Space: factory-rebuild so it reinstalls the latest sdist from PyPI. -# Both wait for the freshly published sdist to appear on PyPI first, since the +# - ComfyUI: sync, test, and publish the node against the exact library release. +# All wait for the freshly published sdist to appear on PyPI first, since the # Release event fires in parallel with publish.yml's upload. on: @@ -133,3 +134,75 @@ jobs: ) print("HF Space factory rebuild triggered") PY + + comfyui: + needs: resolve + runs-on: ubuntu-latest + steps: + - name: Sync and publish the ComfyUI nodes + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + run: | + set -euo pipefail + repo=wiltodelta/ComfyUI-remove-ai-watermarks + workflow=sync-library.yml + dispatched_at=$(date -u +%Y-%m-%dT%H:%M:%SZ) + + gh workflow run "$workflow" \ + --repo "$repo" \ + --ref main \ + --raw-field library_version="${{ needs.resolve.outputs.version }}" + + run_id="" + for attempt in $(seq 1 30); do + run_id=$( + gh run list \ + --repo "$repo" \ + --workflow "$workflow" \ + --event workflow_dispatch \ + --limit 10 \ + --json databaseId,createdAt \ + | python3 -c ' + import json + import sys + + dispatched_at = sys.argv[1] + runs = json.load(sys.stdin) + print(next( + (run["databaseId"] for run in runs if run["createdAt"] >= dispatched_at), + "", + )) + ' "$dispatched_at" + ) + if [ -n "$run_id" ]; then + break + fi + echo "ComfyUI sync run not visible yet (attempt $attempt), waiting..." + sleep 2 + done + + if [ -z "$run_id" ]; then + echo "::error::The dispatched ComfyUI sync run did not appear" + exit 1 + fi + + for attempt in $(seq 1 180); do + read -r status conclusion <<< "$( + gh run view "$run_id" \ + --repo "$repo" \ + --json status,conclusion \ + --jq '[.status, (.conclusion // "")] | @tsv' + )" + if [ "$status" = "completed" ]; then + if [ "$conclusion" = "success" ]; then + echo "ComfyUI sync run $run_id succeeded" + exit 0 + fi + echo "::error::ComfyUI sync run $run_id completed with $conclusion" + exit 1 + fi + echo "ComfyUI sync run $run_id is $status (attempt $attempt), waiting..." + sleep 5 + done + echo "::error::ComfyUI sync run $run_id did not finish in time" + exit 1 diff --git a/docs/release-and-distribution.md b/docs/release-and-distribution.md index 49f08aa..3fc7d6e 100644 --- a/docs/release-and-distribution.md +++ b/docs/release-and-distribution.md @@ -77,12 +77,15 @@ The package uses hatchling through the unpinned `hatchling` build requirement in The repository includes a conda recipe under `packaging/conda/recipe.yaml`. -The ComfyUI nodes are maintained and versioned in their own repository. Its -scheduled workflow detects a newer PyPI library release, updates the dependency -floor, runs compatibility tests, bumps the node patch version, and publishes to -the ComfyUI Registry only when those tests pass. The library release event does -not publish the node package directly, so the registry update follows on that -schedule rather than inside `distribute.yml`. +The ComfyUI nodes are maintained and versioned in their own repository. After +the matching source distribution appears on PyPI, `distribute.yml` dispatches +that repository's sync workflow with the exact library version and waits for it +to finish. The sync updates the dependency floor, runs compatibility tests, +bumps the node patch version, and publishes to the ComfyUI Registry only when +those tests pass. Its daily schedule remains as a recovery path if a release +dispatch is interrupted. The `HOMEBREW_TAP_TOKEN` repository secret is also the +cross-repository release token; it needs Actions read and write access to the +ComfyUI node repository. ## Release verification @@ -94,4 +97,5 @@ After publication, verify: - the distribution workflow completed successfully; - the repository's conda recipe matches the published version and source distribution; +- the ComfyUI Registry node requires the new library version; - a clean install can run `remove-ai-watermarks --version`.