From 634fba171e4e0cb8397bf8c11a8c2a8cc217d3f1 Mon Sep 17 00:00:00 2001 From: Minidoracat Date: Fri, 13 Jun 2025 19:28:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E8=AA=BF=E6=95=B4=E7=99=BC?= =?UTF-8?q?=E5=B8=83=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 50 ++++++++++++++++++++++++++++---- RELEASE_NOTES/CHANGELOG.en.md | 2 +- RELEASE_NOTES/CHANGELOG.zh-CN.md | 2 +- RELEASE_NOTES/CHANGELOG.zh-TW.md | 2 +- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e1c7529..c5cf2f6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,14 +4,18 @@ on: workflow_dispatch: inputs: version_type: - description: 'Version bump type' - required: true + description: 'Version bump type (ignored if custom_version is provided)' + required: false default: 'patch' type: choice options: - patch # 2.0.0 -> 2.0.1 (bug fixes, security patches, documentation updates) - minor # 2.0.0 -> 2.1.0 (new features, enhancements, backward-compatible changes) - major # 2.0.0 -> 3.0.0 (breaking changes, architecture refactoring, API changes) + custom_version: + description: 'Custom version number (e.g., 2.5.0) - overrides version_type if provided' + required: false + type: string jobs: release: @@ -57,11 +61,35 @@ jobs: echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT echo "Current version: $CURRENT_VERSION" - - name: Bump version + - name: Determine new version id: bump_version run: | - uv run bump2version --allow-dirty ${{ github.event.inputs.version_type }} - NEW_VERSION=$(grep '^version =' pyproject.toml | cut -d'"' -f2) + CUSTOM_VERSION="${{ github.event.inputs.custom_version }}" + + if [ -n "$CUSTOM_VERSION" ]; then + echo "🎯 Using custom version: $CUSTOM_VERSION" + + # Validate version format (basic semver check) + if [[ ! "$CUSTOM_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "❌ Error: Custom version must be in format X.Y.Z (e.g., 2.5.0)" + exit 1 + fi + + # Update version in pyproject.toml + sed -i "s/^version = \".*\"/version = \"$CUSTOM_VERSION\"/" pyproject.toml + + # Update version in .bumpversion.cfg + sed -i "s/^current_version = .*/current_version = $CUSTOM_VERSION/" .bumpversion.cfg + + NEW_VERSION="$CUSTOM_VERSION" + echo "✅ Set custom version: $NEW_VERSION" + else + echo "🔄 Using automatic version bump: ${{ github.event.inputs.version_type }}" + uv run bump2version --allow-dirty ${{ github.event.inputs.version_type }} + NEW_VERSION=$(grep '^version =' pyproject.toml | cut -d'"' -f2) + echo "✅ Bumped version to: $NEW_VERSION" + fi + echo "new=$NEW_VERSION" >> $GITHUB_OUTPUT echo "New version: $NEW_VERSION" @@ -230,11 +258,21 @@ jobs: - name: Commit version bump run: | + CUSTOM_VERSION="${{ github.event.inputs.custom_version }}" + VERSION_METHOD="" + + if [ -n "$CUSTOM_VERSION" ]; then + VERSION_METHOD="Custom version specified: $CUSTOM_VERSION" + else + VERSION_METHOD="Auto-bumped (${{ github.event.inputs.version_type }})" + fi + git add . git commit -m "🔖 Release v${{ steps.bump_version.outputs.new }} - Updated version to ${{ steps.bump_version.outputs.new }} - - Auto-generated release from simplified workflow" + - $VERSION_METHOD + - Auto-generated release from workflow" git tag "v${{ steps.bump_version.outputs.new }}" - name: Build package diff --git a/RELEASE_NOTES/CHANGELOG.en.md b/RELEASE_NOTES/CHANGELOG.en.md index b4f417b..42f0f64 100644 --- a/RELEASE_NOTES/CHANGELOG.en.md +++ b/RELEASE_NOTES/CHANGELOG.en.md @@ -2,7 +2,7 @@ This document records all version updates for **MCP Feedback Enhanced**. -## [v2.4.0] - Web-Only Architecture Refactoring & Smart Feature Enhancement +## [v2.4.2] - Web-Only Architecture Refactoring & Smart Feature Enhancement ### 🌟 Version Highlights This version underwent major architectural refactoring, **completely removing PyQt6 GUI dependencies** and transitioning to a pure Web UI architecture, dramatically simplifying deployment and maintenance. Additionally, multiple smart features were added, including prompt management, auto-submit, session management, and more, comprehensively enhancing user experience and work efficiency. diff --git a/RELEASE_NOTES/CHANGELOG.zh-CN.md b/RELEASE_NOTES/CHANGELOG.zh-CN.md index b6cf2fd..6d00591 100644 --- a/RELEASE_NOTES/CHANGELOG.zh-CN.md +++ b/RELEASE_NOTES/CHANGELOG.zh-CN.md @@ -2,7 +2,7 @@ 本文件记录了 **MCP Feedback Enhanced** 的所有版本更新内容。 -## [v2.4.0] - Web-Only 架构重构与智能功能增强 +## [v2.4.2] - Web-Only 架构重构与智能功能增强 ### 🌟 版本亮点 本版本进行了重大架构重构,**完全移除 PyQt6 GUI 依赖**,转为纯 Web UI 架构,大幅简化部署和维护。同时新增多项智能功能,包括提示词管理、自动提交、会话管理等,全面提升用户体验和工作效率。 diff --git a/RELEASE_NOTES/CHANGELOG.zh-TW.md b/RELEASE_NOTES/CHANGELOG.zh-TW.md index 656744e..b3efc15 100644 --- a/RELEASE_NOTES/CHANGELOG.zh-TW.md +++ b/RELEASE_NOTES/CHANGELOG.zh-TW.md @@ -2,7 +2,7 @@ 本文件記錄了 **MCP Feedback Enhanced** 的所有版本更新內容。 -## [v2.4.0] - Web-Only 架構重構與智能功能增強 +## [v2.4.2] - Web-Only 架構重構與智能功能增強 ### 🌟 版本亮點 本版本進行了重大架構重構,**完全移除 PyQt6 GUI 依賴**,轉為純 Web UI 架構,大幅簡化部署和維護。同時新增多項智能功能,包括提示詞管理、自動提交、會話管理等,全面提升用戶體驗和工作效率。