Add GitHub Actions workflow and development tools

- Add automated publishing workflow using official ComfyUI publish action
- Add version bump script for easy version management
- Add comprehensive setup documentation
- Update README with development and publishing sections
This commit is contained in:
Niutonian
2026-01-06 16:49:23 +01:00
parent e834e43398
commit e463b2a35c
5 changed files with 218 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# Adding Your Registry API Key to GitHub
## Step-by-Step Instructions
1. **Go to your GitHub repository**: https://github.com/Niutonian/ComfyUI-Niutonian-Themes
2. **Navigate to Settings**:
- Click the **Settings** tab at the top of your repository
3. **Go to Secrets and Variables**:
- In the left sidebar, click **Secrets and variables**
- Then click **Actions**
4. **Create New Repository Secret**:
- Click **New repository secret**
- **Name**: `REGISTRY_ACCESS_TOKEN`
- **Secret**: `184be226-a615-41ab-aac5-ebdb37911cb7`
- Click **Add secret**
## Your API Key
```
184be226-a615-41ab-aac5-ebdb37911cb7
```
## What Happens Next
Once you add the secret:
1. The GitHub Action is ready to publish automatically
2. Any time you update the version in `pyproject.toml` and push to main, it will publish
3. You can also trigger it manually from the Actions tab
## Test the Setup
To test the publishing:
1. Update the version in `pyproject.toml` (currently 1.2.0 → 1.2.1)
2. Commit and push the change
3. Check the Actions tab to see the publishing workflow run
4. Your updated node should appear on the ComfyUI Registry
**Important**: Keep this API key secure and don't share it publicly!
+63
View File
@@ -0,0 +1,63 @@
# GitHub Action Setup for ComfyUI Registry Publishing
This repository includes a GitHub Action that automatically publishes your custom node to the ComfyUI Registry whenever the `pyproject.toml` file is updated, using the official ComfyUI publish action.
## Setup Instructions
### 1. Add GitHub Repository Secret (REQUIRED)
1. Go to your GitHub repository: https://github.com/Niutonian/ComfyUI-Niutonian-Themes
2. Click on **Settings** tab
3. In the left sidebar, click **Secrets and variables** → **Actions**
4. Click **New repository secret**
5. Name: `REGISTRY_ACCESS_TOKEN`
6. Value: `184be226-a615-41ab-aac5-ebdb37911cb7`
7. Click **Add secret**
### 2. Verify Branch Configuration
The workflow is configured for the `main` branch, which matches your current setup.
### 3. Test the Publishing
To publish a new version:
1. Update the `version` field in `pyproject.toml` (currently 1.2.0)
2. Commit and push the changes to your main branch
3. The GitHub Action will automatically trigger and publish the new version
4. You can also trigger it manually from the Actions tab using "workflow_dispatch"
## How It Works
The action triggers when:
- A push is made to the main branch AND the `pyproject.toml` file is modified
- You manually trigger it from the Actions tab
The workflow uses the official `Comfy-Org/publish-node-action@main` which:
1. Reads your `pyproject.toml` configuration
2. Validates the custom node structure
3. Publishes to the ComfyUI Registry using your API token
4. Makes it available in ComfyUI Manager
## Current Configuration
- **Package Name**: comfyui-niutonian-themes
- **Current Version**: 1.2.0
- **Publisher**: @Niutonian
- **Repository**: https://github.com/Niutonian/ComfyUI-Niutonian-Themes
- **Registry URL**: https://registry.comfy.org/publishers/Niutonian/nodes/comfyui-niutonian-themes
## Troubleshooting
- **Action fails**: Check the Actions tab in your GitHub repository for error logs
- **Authentication issues**: Verify your `REGISTRY_ACCESS_TOKEN` secret is correctly set
- **Version conflicts**: Make sure you're incrementing the version number in `pyproject.toml`
- **Metadata issues**: Ensure your `pyproject.toml` has all required ComfyUI fields
## Manual Publishing Alternative
You can also publish manually using the ComfyUI CLI:
```bash
# Install comfy-cli if not already installed
pip install comfy-cli
# Publish manually
comfy node publish
# Enter your API key when prompted: 184be226-a615-41ab-aac5-ebdb37911cb7
```
+21
View File
@@ -0,0 +1,21 @@
name: Publish to Comfy Registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
jobs:
publish-node:
name: Publish Custom Node to Registry
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+29
View File
@@ -294,6 +294,35 @@ const NODE_ACCENTS = {
- `glass_opacity`: Glass effect transparency (0.01-0.20)
- `node_opacity`: Node background transparency (0.10-1.0)
## Development & Publishing
### Automated Publishing
This repository includes automated publishing to the ComfyUI Registry via GitHub Actions. When you update the version in `pyproject.toml` and push to the main branch, a new version is automatically published.
### Version Management
Use the included version bump script for easy version updates:
```bash
# Bump patch version (1.2.0 → 1.2.1)
python scripts/bump_version.py patch
# Bump minor version (1.2.0 → 1.3.0)
python scripts/bump_version.py minor
# Bump major version (1.2.0 → 2.0.0)
python scripts/bump_version.py major
```
After bumping the version, commit and push to trigger automatic publishing:
```bash
git add pyproject.toml
git commit -m "Bump version to X.X.X"
git push origin main
```
### Setup Instructions for Maintainers
See [.github/SETUP.md](.github/SETUP.md) for detailed setup instructions for the GitHub Action publishing workflow.
## Contributing
Contributions are welcome! Feel free to:
+65
View File
@@ -0,0 +1,65 @@
#!/usr/bin/env python3
"""
Simple script to bump the version in pyproject.toml
Usage: python scripts/bump_version.py [major|minor|patch]
"""
import sys
import re
from pathlib import Path
def bump_version(version_type="patch"):
"""Bump version in pyproject.toml"""
pyproject_path = Path("pyproject.toml")
if not pyproject_path.exists():
print("❌ pyproject.toml not found!")
return False
# Read current content
content = pyproject_path.read_text()
# Find current version
version_match = re.search(r'version = "(\d+)\.(\d+)\.(\d+)"', content)
if not version_match:
print("❌ Could not find version in pyproject.toml")
return False
major, minor, patch = map(int, version_match.groups())
# Bump version based on type
if version_type == "major":
major += 1
minor = 0
patch = 0
elif version_type == "minor":
minor += 1
patch = 0
elif version_type == "patch":
patch += 1
else:
print(f"❌ Invalid version type: {version_type}")
return False
old_version = f"{version_match.group(1)}.{version_match.group(2)}.{version_match.group(3)}"
new_version = f"{major}.{minor}.{patch}"
# Replace version in content
new_content = re.sub(
r'version = "\d+\.\d+\.\d+"',
f'version = "{new_version}"',
content
)
# Write back to file
pyproject_path.write_text(new_content)
print(f"✅ Version bumped from {old_version} to {new_version}")
print(f"📝 Updated pyproject.toml")
print(f"🚀 Commit and push to trigger publishing!")
return True
if __name__ == "__main__":
version_type = sys.argv[1] if len(sys.argv) > 1 else "patch"
bump_version(version_type)