chore: bump version to 1.2.0 - 全面更新README文档和版本推送代码

This commit is contained in:
Cyber Dick Lang
2025-07-15 16:35:52 +08:00
parent 541b76e407
commit f51f97b2d4
10 changed files with 841 additions and 55 deletions
+50
View File
@@ -0,0 +1,50 @@
---
name: 🐛 Bug 报告
about: 创建一个bug报告以帮助我们改进
title: '[BUG] '
labels: ['bug', 'needs-triage']
assignees: ['whmc76']
---
## 🐛 Bug 描述
<!-- 请简要描述这个bug -->
## 🔄 重现步骤
<!-- 重现这个bug的步骤: -->
1. 打开 ComfyUI
2. 添加节点 '...'
3. 设置参数 '...'
4. 运行工作流
5. 看到错误
## ✅ 期望行为
<!-- 请描述您期望发生的事情 -->
## ❌ 实际行为
<!-- 请描述实际发生的事情 -->
## 📸 截图
<!-- 如果适用,请添加截图以帮助解释您的问题 -->
## 💻 环境信息
- **操作系统**: [例如 Windows 10, macOS 12.0, Ubuntu 20.04]
- **Python 版本**: [例如 3.8.10]
- **ComfyUI 版本**: [例如 v1.0.0]
- **UniversalToolkit 版本**: [例如 v1.1.9]
- **GPU**: [例如 NVIDIA RTX 3080, AMD RX 6800, CPU only]
## 📋 错误日志
<!-- 请粘贴完整的错误日志 -->
```
错误信息在这里
```
## 🔧 额外信息
<!-- 添加关于这个问题的任何其他上下文 -->
## 📝 检查清单
- [ ] 我已经搜索了现有的issues
- [ ] 我已经尝试了最新的版本
- [ ] 我提供了完整的环境信息
- [ ] 我包含了重现步骤
- [ ] 我添加了相关的截图或日志
+38
View File
@@ -0,0 +1,38 @@
---
name: 💡 功能请求
about: 为这个项目提出一个想法
title: '[FEATURE] '
labels: ['enhancement', 'needs-triage']
assignees: ['whmc76']
---
## 💡 功能描述
<!-- 请简要描述您想要的功能 -->
## 🎯 问题陈述
<!-- 请描述您遇到的问题或限制 -->
## 💭 建议的解决方案
<!-- 请描述您希望如何解决这个问题 -->
## 🔄 替代方案
<!-- 请描述您考虑过的任何替代解决方案或功能 -->
## 📸 示例
<!-- 如果适用,请添加截图或示例以帮助解释您的想法 -->
## 🎨 使用场景
<!-- 请描述这个功能将如何被使用 -->
## 🔧 技术考虑
<!-- 如果有任何技术考虑或限制,请在此说明 -->
## 📝 检查清单
- [ ] 我已经搜索了现有的issues
- [ ] 我已经检查了文档
- [ ] 我提供了清晰的功能描述
- [ ] 我解释了使用场景
- [ ] 我考虑了技术可行性
## 🔗 相关链接
<!-- 如果有相关的讨论、issues或文档,请在此链接 -->
+44
View File
@@ -0,0 +1,44 @@
## 📝 描述
<!-- 请简要描述此PR的更改 -->
## 🎯 类型
<!-- 请删除不相关的选项 -->
- [ ] 🐛 Bug修复
- [ ] 💡 新功能
- [ ] 📚 文档更新
- [ ] 🔧 代码重构
- [ ] ⚡ 性能改进
- [ ] 🧪 测试
- [ ] 🔧 构建/CI改进
## 🔄 相关Issue
<!-- 请链接相关的issue -->
Closes #(issue number)
## 📋 检查清单
<!-- 请确保在提交PR之前完成以下所有项目 -->
- [ ] 我已经阅读并遵循了项目的贡献指南
- [ ] 我的代码遵循了项目的代码风格
- [ ] 我已经进行了自我审查
- [ ] 我已经注释了我的代码,特别是在难以理解的地方
- [ ] 我已经进行了相应的更改到文档
- [ ] 我的更改不会产生新的警告
- [ ] 我已经添加了测试来证明我的修复是有效的或我的功能工作正常
- [ ] 新的和现有的单元测试通过我的更改
- [ ] 任何依赖的更改都已记录在requirements.txt中
## 🧪 测试
<!-- 请描述您为测试更改而执行的测试 -->
## 📸 截图
<!-- 如果适用,请添加截图以显示您的更改 -->
## 🔧 环境信息
- **操作系统**: [例如 Windows 10, macOS 12.0, Ubuntu 20.04]
- **Python 版本**: [例如 3.8.10]
- **ComfyUI 版本**: [例如 v1.0.0]
## 📝 额外说明
<!-- 添加关于此PR的任何其他上下文或说明 -->
+175
View File
@@ -0,0 +1,175 @@
name: CI - Code Quality & Testing
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master ]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
code-quality:
name: Code Quality Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8 black isort mypy
- name: Check code formatting with Black
run: |
black --check --diff .
- name: Check import sorting with isort
run: |
isort --check-only --diff .
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Type checking with mypy
run: |
mypy --ignore-missing-imports nodes/
test-nodes:
name: Test Node Import & Functionality
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Test node imports
run: |
python test_nodes.py
echo "✅ All nodes imported successfully on Python ${{ matrix.python-version }}"
- name: Run basic functionality tests
run: |
python -c "
import sys
sys.path.append('.')
from __init__ import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
print(f'✅ Found {len(NODE_CLASS_MAPPINGS)} nodes')
print(f'✅ Found {len(NODE_DISPLAY_NAME_MAPPINGS)} display names')
for node_name, node_class in NODE_CLASS_MAPPINGS.items():
print(f' - {node_name}: {node_class.__name__}')
"
security-check:
name: Security Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install security tools
run: |
python -m pip install --upgrade pip
pip install bandit safety
- name: Run security scan with bandit
run: |
bandit -r . -f json -o bandit-report.json || true
bandit -r . -f txt -o bandit-report.txt || true
- name: Check dependencies for known vulnerabilities
run: |
safety check --json --output safety-report.json || true
safety check --text --output safety-report.txt || true
documentation-check:
name: Documentation Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
- name: Check README formatting
run: |
if [ -f README.md ]; then
echo "✅ README.md exists"
# Check for broken links (basic check)
grep -o 'https://[^)]*' README.md | head -5
else
echo "❌ README.md missing"
exit 1
fi
- name: Check pyproject.toml
run: |
if [ -f pyproject.toml ]; then
echo "✅ pyproject.toml exists"
# Validate basic structure
grep -q '^\[project\]' pyproject.toml || exit 1
grep -q '^version = ' pyproject.toml || exit 1
echo "✅ pyproject.toml structure valid"
else
echo "❌ pyproject.toml missing"
exit 1
fi
- name: Check version consistency
run: |
PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
INIT_VERSION=$(grep '__version__ = ' __init__.py | cut -d'"' -f2)
if [ "$PYPROJECT_VERSION" = "$INIT_VERSION" ]; then
echo "✅ Version consistency: $PYPROJECT_VERSION"
else
echo "❌ Version mismatch: pyproject.toml ($PYPROJECT_VERSION) != __init__.py ($INIT_VERSION)"
exit 1
fi
notify:
name: Notify on Failure
runs-on: ubuntu-latest
needs: [code-quality, test-nodes, security-check, documentation-check]
if: failure()
steps:
- name: Notify on failure
run: |
echo "❌ One or more CI checks failed"
echo "Please check the workflow run for details:"
echo "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+4 -3
View File
@@ -1,4 +1,5 @@
name: Publish to Comfy registry
name: Publish to Comfy Registry
on:
workflow_dispatch:
push:
@@ -13,7 +14,7 @@ permissions:
jobs:
publish-node:
name: Publish Custom Node to registry
name: Publish Custom Node to Registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'whmc76' }}
steps:
@@ -21,8 +22,8 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@v1
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+197
View File
@@ -0,0 +1,197 @@
name: Version Management
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
release_notes:
description: 'Release notes (optional)'
required: false
type: string
permissions:
contents: write
issues: write
pull-requests: write
jobs:
bump-version:
name: Bump Version
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install semver
- name: Get current version
id: current-version
run: |
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | cut -d'"' -f2)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"
- name: Calculate new version
id: new-version
run: |
CURRENT_VERSION="${{ steps.current-version.outputs.current_version }}"
VERSION_TYPE="${{ github.event.inputs.version_type }}"
# Parse version components
IFS='.' read -r major minor patch <<< "$CURRENT_VERSION"
case $VERSION_TYPE in
"major")
NEW_MAJOR=$((major + 1))
NEW_MINOR=0
NEW_PATCH=0
;;
"minor")
NEW_MAJOR=$major
NEW_MINOR=$((minor + 1))
NEW_PATCH=0
;;
"patch")
NEW_MAJOR=$major
NEW_MINOR=$minor
NEW_PATCH=$((patch + 1))
;;
esac
NEW_VERSION="$NEW_MAJOR.$NEW_MINOR.$NEW_PATCH"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: $NEW_VERSION"
- name: Update pyproject.toml
run: |
NEW_VERSION="${{ steps.new-version.outputs.new_version }}"
sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
echo "Updated pyproject.toml to version $NEW_VERSION"
- name: Update __init__.py
run: |
NEW_VERSION="${{ steps.new-version.outputs.new_version }}"
sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" __init__.py
echo "Updated __init__.py to version $NEW_VERSION"
- name: Update README.md version badge
run: |
NEW_VERSION="${{ steps.new-version.outputs.new_version }}"
sed -i "s/badge\/version-.*-blue/badge\/version-$NEW_VERSION-blue/" README.md
echo "Updated README.md version badge to $NEW_VERSION"
- name: Create version bump commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add pyproject.toml __init__.py README.md
git commit -m "chore: bump version to ${{ steps.new-version.outputs.new_version }}"
git tag -a "v${{ steps.new-version.outputs.new_version }}" -m "Version ${{ steps.new-version.outputs.new_version }}"
- name: Push changes
run: |
git push origin HEAD:${{ github.ref }}
git push origin "v${{ steps.new-version.outputs.new_version }}"
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.new-version.outputs.new_version }}
release_name: ComfyUI-UniversalToolkit v${{ steps.new-version.outputs.new_version }}
body: |
## 🎉 ComfyUI-UniversalToolkit v${{ steps.new-version.outputs.new_version }} 发布
### 📋 版本信息
- **版本类型**: ${{ github.event.inputs.version_type }}
- **发布时间**: $(date -u +"%Y-%m-%d %H:%M UTC")
- **提交**: ${{ github.sha }}
### 📝 更新说明
${{ github.event.inputs.release_notes || '请查看提交历史了解详细更新内容。' }}
### 📦 安装方式
1. **ComfyUI-Manager安装(推荐)**:
- 在ComfyUI中打开ComfyUI-Manager
- 搜索 "ComfyUI-UniversalToolkit"
- 点击安装
2. **手动安装**:
```bash
git clone https://github.com/whmc76/ComfyUI-UniversalToolkit.git
cd ComfyUI-UniversalToolkit
git checkout v${{ steps.new-version.outputs.new_version }}
pip install -r requirements.txt
```
### 🎯 功能特性
- 🎨 图像处理:色彩迁移、图像拼接、尺寸调整、深度图模糊等
- 🎵 音频处理:音频加载、裁剪、重采样、增益调节等
- 🎭 掩码操作:掩码运算、填充、裁剪、预览等
- 🛠️ 实用工具:数学表达式、文本处理、显存清理、预设加载等
- 📱 智能预设:27种Kontext VLM系统预设
### 🔧 兼容性
- ComfyUI v1.0.0+
- Python 3.8+
- Windows, macOS, Linux
### 📄 详细文档
查看 [README.md](https://github.com/whmc76/ComfyUI-UniversalToolkit/blob/main/README.md) 获取完整使用说明
### 🤝 反馈与支持
- 问题反馈:[Issues](https://github.com/whmc76/ComfyUI-UniversalToolkit/issues)
- 讨论交流:[Discussions](https://github.com/whmc76/ComfyUI-UniversalToolkit/discussions)
---
⭐ 如果这个项目对您有帮助,请给我们一个Star!
draft: false
prerelease: false
- name: Notify Discord (Optional)
if: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" \
-d '{
"embeds": [{
"title": "🚀 ComfyUI-UniversalToolkit v'${{ steps.new-version.outputs.new_version }}' 版本发布",
"description": "新版本已成功发布!\n\n📋 版本信息:\n• 版本类型:'${{ github.event.inputs.version_type }}'\n• 发布时间:'$(date -u +"%Y-%m-%d %H:%M UTC")'\n\n📝 更新说明:\n'${{ github.event.inputs.release_notes || '请查看GitHub发布页面了解详细更新内容。' }}'",
"color": 3066993,
"fields": [
{
"name": "📦 安装",
"value": "通过ComfyUI-Manager搜索安装,或手动克隆仓库",
"inline": true
},
{
"name": "🔗 链接",
"value": "[GitHub](https://github.com/whmc76/ComfyUI-UniversalToolkit) | [Release](https://github.com/whmc76/ComfyUI-UniversalToolkit/releases/tag/v'${{ steps.new-version.outputs.new_version }}')",
"inline": true
}
],
"footer": {
"text": "ComfyUI-UniversalToolkit"
}
}]
}' \
${{ secrets.DISCORD_WEBHOOK_URL }}