Conversation
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>
Co-authored-by: chsword <274085+chsword@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive PowerShell-based release automation system for the Excel2Object project, enabling one-command releases that automatically update version numbers, commit changes, and create tags.
- Adds a PowerShell script
release.ps1that automates the entire release workflow - Provides comprehensive bilingual documentation for the release automation system
- Updates README files to include quick release instructions for improved developer experience
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| release.ps1 | Main PowerShell automation script with cross-platform support and comprehensive error handling |
| RELEASE_SCRIPT_GUIDE.md | Bilingual usage guide with examples, parameters, and troubleshooting |
| RELEASE_AUTOMATION.md | Updated automation documentation with script integration details |
| README_EN.md | Added quick release section referencing the automation script |
| README.md | Added quick release section referencing the automation script |
| if (-not (Test-Path $csprojPath)) { | ||
| throw "找不到项目文件: $csprojPath" |
There was a problem hiding this comment.
The hardcoded path Chsword.Excel2Object/Chsword.Excel2Object.csproj should be made configurable or detected dynamically. Consider adding a parameter to specify the project file path or automatically discovering .csproj files in the repository.
| $content = Get-Content $csprojPath -Raw | ||
| $newContent = $content -replace '<Version>[^<]+</Version>', "<Version>$NewVersion</Version>" | ||
|
|
||
| Set-Content -Path $csprojPath -Value $newContent -NoNewline |
There was a problem hiding this comment.
Using -NoNewline might cause issues if the original file had a trailing newline. This could lead to formatting inconsistencies or merge conflicts. Consider preserving the original file's newline behavior.
| Set-Content -Path $csprojPath -Value $newContent -NoNewline | |
| Set-Content -Path $csprojPath -Value $newContent |
| try { | ||
| git rev-parse --git-dir 2>&1 | Out-Null | ||
| return $LASTEXITCODE -eq 0 | ||
| } | ||
| catch { | ||
| return $false | ||
| } |
There was a problem hiding this comment.
The error redirection 2>&1 | Out-Null followed by checking $LASTEXITCODE is unnecessary since the try-catch block already handles errors. Consider simplifying to just git rev-parse --git-dir | Out-Null; return $true in the try block.
|
所在位置 C:\Github\Excel2Object\release.ps1:120 字符: 20
表达式或语句中包含意外的标记“Chsword.Excel2Object/Chsword.Excel2Object.csproj" 所在位置 C:\Github\Excel2Object\release.ps1:182 字符: 39
语句块或类型定义中缺少右“}”。
表达式或语句中包含意外的标记“)”。
表达式或语句中包含意外的标记“鎿嶄綔宸插彇娑堛€?”。
表达式或语句中包含意外的标记“}”。
表达式或语句中包含意外的标记“}”。
表达式或语句中包含意外的标记“}”。
语句块或类型定义中缺少右“}”。
语句块或类型定义中缺少右“}”。
语句块或类型定义中缺少右“}”。 |
概述 / Overview
创建了一个 PowerShell 自动化脚本
release.ps1,实现"一气呵成"的发布流程:自动修改 csproj 版本号、提交代码并创建 Tag。Added a PowerShell automation script
release.ps1that provides a seamless one-command release workflow: automatically updates csproj version, commits changes, and creates tags.📦 新增内容 / What's New
1.
release.ps1- 发布自动化脚本一个功能完整的 PowerShell 脚本(299 行),支持跨平台使用(Windows/Linux/macOS)。
核心功能 / Core Features:
Chsword.Excel2Object.csproj中的版本号chore: bump version to X.Y.ZvX.Y.Z安全检查 / Safety Checks:
使用示例 / Usage Examples:
2.
RELEASE_SCRIPT_GUIDE.md- 详细使用指南双语(中英文)使用文档,包含:
Bilingual (EN/CN) comprehensive guide with prerequisites, quick start, parameter descriptions, and troubleshooting.
3. 更新现有文档 / Updated Documentation
🎯 解决的问题 / Problem Solved
Issue 要求 / Issue Requirement:
解决方案 / Solution:
脚本将原本需要多个手动步骤的发布流程:
简化为一条命令:
🔍 技术亮点 / Technical Highlights
🧪 测试验证 / Testing
-SkipPush -Force标志)📝 相关文档 / Related Documentation
💡 使用建议 / Recommendations
发布新版本时,推荐使用此脚本替代手动操作:
此脚本显著提升了发布效率,减少了人为错误,使版本发布过程更加标准化和可靠。
This script significantly improves release efficiency, reduces human error, and makes the version release process more standardized and reliable.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.