chore: prepare registry publishing
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
name: Publish to Comfy Registry
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- pyproject.toml
|
||||
|
||||
jobs:
|
||||
publish-node:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Publish node
|
||||
uses: Comfy-Org/publish-node-action@main
|
||||
with:
|
||||
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||
@@ -19,6 +19,23 @@ ComfyUI/custom_nodes/ComfyUI-KieAPI
|
||||
|
||||
Then restart ComfyUI.
|
||||
|
||||
## Registry publishing
|
||||
|
||||
This repository is prepared for Comfy Registry publishing.
|
||||
|
||||
### Required GitHub secret
|
||||
|
||||
Add a repository secret named `REGISTRY_ACCESS_TOKEN` with your Comfy Registry publisher API key.
|
||||
|
||||
### Release flow
|
||||
|
||||
- bump the version in `pyproject.toml`
|
||||
- push to `main`
|
||||
- GitHub Actions runs `.github/workflows/publish_action.yml`
|
||||
- the node is published through `Comfy-Org/publish-node-action`
|
||||
|
||||
Once published to the Registry, users can install it through ComfyUI-Manager without using Git URL installation.
|
||||
|
||||
## Configure API key
|
||||
|
||||
The node resolves the Kie API key in this order:
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
# ComfyUI-KieAPI Registry Publishing Design
|
||||
|
||||
**Date:** 2026-04-10
|
||||
|
||||
## Goal
|
||||
|
||||
Prepare `ComfyUI-KieAPI` for publication to the Comfy Registry so it can be installed through ComfyUI-Manager without requiring the user to lower Manager security for Git URL installation.
|
||||
|
||||
## Scope
|
||||
|
||||
### In scope
|
||||
|
||||
- Add `pyproject.toml` with required `[project]` and `[tool.comfy]` metadata
|
||||
- Add dependency declaration so Registry packaging can resolve runtime requirements
|
||||
- Add GitHub Actions workflow for Registry publishing
|
||||
- Update README with Registry publication/install guidance
|
||||
- Add tests that validate the presence of Registry metadata and workflow files
|
||||
|
||||
### Out of scope
|
||||
|
||||
- Publishing the first release if local publish tooling is unavailable
|
||||
- Choosing a software license on the user's behalf
|
||||
- Adding icons or banners
|
||||
- Broadening node functionality
|
||||
|
||||
## Options
|
||||
|
||||
### Option 1: Manual publish only
|
||||
|
||||
Add `pyproject.toml` and leave publication as a local `comfy node publish` command.
|
||||
|
||||
Pros:
|
||||
- smallest change
|
||||
- no GitHub secret setup required
|
||||
|
||||
Cons:
|
||||
- easy to forget
|
||||
- every release is manual
|
||||
|
||||
### Option 2: Registry metadata plus GitHub Action
|
||||
|
||||
Add `pyproject.toml`, dependency metadata, and a publish workflow that uses `REGISTRY_ACCESS_TOKEN`.
|
||||
|
||||
Pros:
|
||||
- aligns with official Comfy docs
|
||||
- supports normal Manager installation after publication
|
||||
- easy future releases
|
||||
|
||||
Cons:
|
||||
- requires setting a GitHub repository secret
|
||||
|
||||
### Option 3: Full release packaging with icons, license, and branding
|
||||
|
||||
Build the full marketing/package surface now.
|
||||
|
||||
Pros:
|
||||
- polished launch
|
||||
|
||||
Cons:
|
||||
- slower
|
||||
- requires legal/design choices we should not invent
|
||||
|
||||
## Recommendation
|
||||
|
||||
Use **Option 2**.
|
||||
|
||||
It gets the repository into a proper Registry-publishable state with minimal assumptions. We avoid choosing a license for the user, but we do add everything necessary for Registry metadata and future automated publishing.
|
||||
|
||||
## Approved Design
|
||||
|
||||
### Metadata
|
||||
|
||||
Add `pyproject.toml` with:
|
||||
|
||||
- `project.name = "kie-api"`
|
||||
- semantic version starting at `0.1.0`
|
||||
- repository/documentation/bug tracker URLs pointing at `Song367/ComfyUI-KieAPI`
|
||||
- dynamic dependencies loaded from `requirements.txt`
|
||||
- `tool.comfy.PublisherId = "wade"`
|
||||
- `tool.comfy.DisplayName = "ComfyUI-KieAPI"`
|
||||
|
||||
### Dependencies
|
||||
|
||||
Declare runtime dependencies used by the current plugin:
|
||||
|
||||
- `aiohttp`
|
||||
- `numpy`
|
||||
- `Pillow`
|
||||
- `pydantic`
|
||||
|
||||
### Publishing
|
||||
|
||||
Add `/.github/workflows/publish_action.yml` using the official `Comfy-Org/publish-node-action@main` action and `REGISTRY_ACCESS_TOKEN` secret.
|
||||
|
||||
### Documentation
|
||||
|
||||
Update README to explain:
|
||||
|
||||
- this repo is intended for Comfy Registry publication
|
||||
- the required GitHub secret name
|
||||
- how future releases are triggered by version bumps in `pyproject.toml`
|
||||
|
||||
### Testing
|
||||
|
||||
Add tests that assert:
|
||||
|
||||
- `pyproject.toml` exists and contains required metadata fields
|
||||
- workflow file exists and references `REGISTRY_ACCESS_TOKEN`
|
||||
@@ -0,0 +1,124 @@
|
||||
# ComfyUI-KieAPI Registry Publishing Implementation Plan
|
||||
|
||||
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
||||
|
||||
**Goal:** Add the metadata and automation needed to publish `ComfyUI-KieAPI` to the Comfy Registry.
|
||||
|
||||
**Architecture:** Keep the plugin code unchanged and layer Registry support around it through repository metadata, dependency declarations, README updates, and a GitHub Actions publish workflow.
|
||||
|
||||
**Tech Stack:** TOML metadata, GitHub Actions, pytest, Comfy Registry conventions
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Add failing tests for Registry metadata
|
||||
|
||||
**Files:**
|
||||
- Create: `tests/test_registry.py`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Add tests that assert:
|
||||
|
||||
- `pyproject.toml` exists
|
||||
- `pyproject.toml` contains `[project]`
|
||||
- `pyproject.toml` contains `[tool.comfy]`
|
||||
- `pyproject.toml` contains `PublisherId = "wade"`
|
||||
- `.github/workflows/publish_action.yml` exists and references `REGISTRY_ACCESS_TOKEN`
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: FAIL because the files do not exist yet.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Create the metadata and workflow files with only the fields needed to satisfy Registry publication requirements.
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: PASS.
|
||||
|
||||
### Task 2: Add Registry metadata and dependency declarations
|
||||
|
||||
**Files:**
|
||||
- Create: `pyproject.toml`
|
||||
- Create: `requirements.txt`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Extend the Registry test to assert:
|
||||
|
||||
- `project.name`
|
||||
- `project.version`
|
||||
- `project.urls.Repository`
|
||||
- dynamic dependencies using `requirements.txt`
|
||||
- `tool.comfy.DisplayName`
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: FAIL on missing or incomplete fields.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Add:
|
||||
|
||||
- project metadata
|
||||
- dependency source from `requirements.txt`
|
||||
- Comfy publisher/display metadata
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: PASS.
|
||||
|
||||
### Task 3: Add publish automation and docs
|
||||
|
||||
**Files:**
|
||||
- Create: `.github/workflows/publish_action.yml`
|
||||
- Modify: `README.md`
|
||||
|
||||
**Step 1: Write the failing test**
|
||||
|
||||
Extend the Registry test to assert the workflow:
|
||||
|
||||
- uses `Comfy-Org/publish-node-action`
|
||||
- references `REGISTRY_ACCESS_TOKEN`
|
||||
|
||||
**Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: FAIL until the workflow is present.
|
||||
|
||||
**Step 3: Write minimal implementation**
|
||||
|
||||
Add the workflow and README sections describing:
|
||||
|
||||
- the required `REGISTRY_ACCESS_TOKEN` GitHub secret
|
||||
- version bump driven release publishing
|
||||
|
||||
**Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: PASS.
|
||||
|
||||
### Task 4: Verify the repository state
|
||||
|
||||
**Files:**
|
||||
- Verify only
|
||||
|
||||
**Step 1: Run focused tests**
|
||||
|
||||
Run: `pytest tests/test_registry.py -v`
|
||||
Expected: PASS.
|
||||
|
||||
**Step 2: Run full plugin tests**
|
||||
|
||||
Run: `pytest tests -v`
|
||||
Expected: PASS.
|
||||
|
||||
**Step 3: Check git status**
|
||||
|
||||
Run: `git status --short`
|
||||
Expected: only the intended metadata, docs, and workflow changes are present.
|
||||
@@ -0,0 +1,19 @@
|
||||
[project]
|
||||
name = "wade-kieapi"
|
||||
description = "ComfyUI custom node for Kie Nano Banana 2 image generation with optional reference images."
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.10"
|
||||
dynamic = ["dependencies"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/Song367/ComfyUI-KieAPI"
|
||||
Documentation = "https://github.com/Song367/ComfyUI-KieAPI#readme"
|
||||
"Bug Tracker" = "https://github.com/Song367/ComfyUI-KieAPI/issues"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "wade"
|
||||
DisplayName = "ComfyUI-KieAPI"
|
||||
Icon = ""
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
dependencies = { file = ["requirements.txt"] }
|
||||
@@ -0,0 +1,4 @@
|
||||
aiohttp>=3.9
|
||||
numpy>=1.24
|
||||
Pillow>=10.0
|
||||
pydantic>=2.0
|
||||
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_registry_metadata_and_workflow_files_exist():
|
||||
pyproject_path = REPO_ROOT / "pyproject.toml"
|
||||
workflow_path = REPO_ROOT / ".github" / "workflows" / "publish_action.yml"
|
||||
|
||||
assert pyproject_path.exists(), f"Expected {pyproject_path} to exist"
|
||||
assert workflow_path.exists(), f"Expected {workflow_path} to exist"
|
||||
|
||||
pyproject_text = pyproject_path.read_text(encoding="utf-8")
|
||||
workflow_text = workflow_path.read_text(encoding="utf-8")
|
||||
|
||||
assert "[project]" in pyproject_text
|
||||
assert '[tool.comfy]' in pyproject_text
|
||||
assert 'name = "wade-kieapi"' in pyproject_text
|
||||
assert 'version = "0.1.0"' in pyproject_text
|
||||
assert 'dynamic = ["dependencies"]' in pyproject_text
|
||||
assert 'PublisherId = "wade"' in pyproject_text
|
||||
assert 'DisplayName = "ComfyUI-KieAPI"' in pyproject_text
|
||||
assert 'Repository = "https://github.com/Song367/ComfyUI-KieAPI"' in pyproject_text
|
||||
assert '[tool.setuptools.dynamic]' in pyproject_text
|
||||
assert 'dependencies = { file = ["requirements.txt"] }' in pyproject_text
|
||||
|
||||
assert "Comfy-Org/publish-node-action" in workflow_text
|
||||
assert "REGISTRY_ACCESS_TOKEN" in workflow_text
|
||||
Reference in New Issue
Block a user