Skip to content

Commit 4c388c3

Browse files
[feat] add GitHub Actions workflow for automated building and publishing
Implements CI/CD pipeline that automatically builds React extension and publishes to ComfyUI Registry. Updates README with clear installation instructions distinguishing registry vs manual installation.
1 parent a611281 commit 4c388c3

File tree

2 files changed

+64
-4
lines changed

2 files changed

+64
-4
lines changed

.github/workflows/react-build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: React Extension Build + Publish to Comfy Registry
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.repository_owner == 'Comfy-Org' }}
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
cd ui
29+
npm install
30+
31+
- name: Build React extension
32+
run: |
33+
cd ui
34+
npm run build
35+
36+
- name: Publish Custom Node
37+
uses: Comfy-Org/publish-node-action@main
38+
with:
39+
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
40+
skip_checkout: 'true'

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ A minimal template for creating React/TypeScript frontend extensions for ComfyUI
1818

1919
## Installation
2020

21+
### From ComfyUI Registry (Recommended)
22+
23+
The easiest way to install this extension is through the ComfyUI Manager:
24+
25+
1. Open ComfyUI and go to the Manager
26+
2. Search for "React Extension Template"
27+
3. Click Install
28+
29+
### Manual Installation
30+
31+
If you want to install directly from GitHub for development purposes:
32+
2133
```bash
2234
# Go to your ComfyUI custom_nodes directory
2335
cd ComfyUI/custom_nodes
@@ -33,6 +45,8 @@ npm run build
3345
# Restart ComfyUI
3446
```
3547

48+
⚠️ **Important**: When installing manually from GitHub, you **must** run `npm run build` in the `ui/` directory before the extension will work. The extension requires the compiled React code in the `dist/` folder to function properly in ComfyUI.
49+
3650
## Usage
3751

3852
This template includes a simple example extension that displays workflow node statistics. After installation:
@@ -84,7 +98,7 @@ For comprehensive documentation on all available APIs, see the [ComfyUI JavaScri
8498
ComfyUI-React-Extension-Template/
8599
├── .github/ # GitHub configurations
86100
│ └── workflows/
87-
│ └── publish.yml # Automatic publishing workflow
101+
│ └── react-build.yml # Automatic build and publishing workflow
88102
├── __init__.py # Python entry point for ComfyUI integration
89103
├── pyproject.toml # Project metadata for ComfyUI Registry
90104
├── dist/ # Built extension files (generated)
@@ -166,9 +180,15 @@ This template includes a GitHub Actions workflow that automatically publishes to
166180
3. Commit and push an update to pyproject.toml (e.g., increment the version number)
167181
4. The GitHub Action will automatically run and publish your extension
168182

169-
The workflow configuration is already set up in `.github/workflows/publish.yml` and will trigger when:
170-
- The `pyproject.toml` file is modified
171-
- The changes are pushed to the `main` branch
183+
The workflow configuration is set up in `.github/workflows/react-build.yml` and will trigger when:
184+
- Changes are pushed to the `main` branch
185+
- Pull requests are created against the `main` branch
186+
187+
The workflow automatically:
188+
1. Sets up Node.js environment
189+
2. Installs dependencies (`npm install`)
190+
3. Builds the React extension (`npm run build`)
191+
4. Publishes the extension to the ComfyUI Registry
172192

173193
## Unit Testing
174194

0 commit comments

Comments
 (0)