From fdaf9cb3ef607d690b162c0caa0c14b4cf45fc30 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 6 Sep 2025 20:37:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=A1=8C=E8=AF=B4=E6=98=8E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-simple.yml | 39 +++++++++++++---- cliff.toml | 63 +++++++++++++++++++++------- 2 files changed, 78 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-simple.yml b/.github/workflows/release-simple.yml index d4d3272b..d299ac84 100644 --- a/.github/workflows/release-simple.yml +++ b/.github/workflows/release-simple.yml @@ -27,7 +27,14 @@ jobs: - name: 生成 changelog id: generate-changelog run: | - git-cliff --output CHANGELOG.md + # 检查是否存在详细配置文件 + if (Test-Path "cliff-detailed.toml") { + Write-Host "使用详细 changelog 配置" + git-cliff --config cliff-detailed.toml --output CHANGELOG.md + } else { + Write-Host "使用默认 changelog 配置" + git-cliff --output CHANGELOG.md + } - name: Setup MSbuild uses: microsoft/setup-msbuild@v2 @@ -45,14 +52,27 @@ jobs: - name: 准备发布文件 run: | - echo "准备发布目录..." - mkdir -p release + Write-Host "准备发布目录..." + New-Item -ItemType Directory -Path "release" -Force - # 复制构建产物到发布目录 - xcopy "Ink Canvas\bin\Any CPU\Release\net472\*" "release\" /E /I /Y + # 复制构建产物到临时目录 + $tempDir = "temp-build" + New-Item -ItemType Directory -Path $tempDir -Force + xcopy "Ink Canvas\bin\Any CPU\Release\net472\*" "$tempDir\" /E /I /Y - echo "构建产物整理完成" - dir release + Write-Host "构建产物整理完成" + Get-ChildItem $tempDir + + # 创建压缩包 + $zipName = "InkCanvasForClass.CE.$env:GITHUB_REF_NAME.zip" + Write-Host "创建压缩包: $zipName" + Compress-Archive -Path "$tempDir\*" -DestinationPath "release\$zipName" -Force + + # 清理临时目录 + Remove-Item -Path $tempDir -Recurse -Force + + Write-Host "发布文件准备完成" + Get-ChildItem release - name: 计算 SHA256 值 run: | @@ -91,7 +111,8 @@ jobs: "**国内 下载链接**" | Add-Content -Path ..\CHANGELOG.md "| 平台/打包方式 | 支持架构 | 完整版 |" | Add-Content -Path ..\CHANGELOG.md "| --- | --- | --- |" | Add-Content -Path ..\CHANGELOG.md - "| Windows | Any CPU | [下载](https://icc.bliemhax.com) |" | Add-Content -Path ..\CHANGELOG.md + "| Windows (inkeys) | Any CPU | [下载 $env:GITHUB_REF_NAME](https://iccce.inkeys.top/Release/InkCanvasForClass.CE.$env:GITHUB_REF_NAME.zip) |" | Add-Content -Path ..\CHANGELOG.md + "| Windows (智教联盟) | Any CPU | [下载 $env:GITHUB_REF_NAME](https://get.smart-teach.cn/d/Ningbo-S3/shared/jiangling/community/InkCanvasForClass.CE.$env:GITHUB_REF_NAME.zip) |" | Add-Content -Path ..\CHANGELOG.md "" | Add-Content -Path ..\CHANGELOG.md "**Github 镜像 下载链接**" | Add-Content -Path ..\CHANGELOG.md "| 镜像源 | 平台/打包方式 | 支持架构 | 完整版 |" | Add-Content -Path ..\CHANGELOG.md @@ -131,7 +152,7 @@ jobs: draft: false prerelease: ${{ env.is_beta == 'true' }} tag_name: ${{ github.ref_name }} - name: Ink Canvas CE 新版本 - ${{ github.ref_name }} + name: Ink Canvas For Class CE 新版本 - ${{ github.ref_name }} fail_on_unmatched_files: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/cliff.toml b/cliff.toml index f84a9ee9..2ce8f3ca 100644 --- a/cliff.toml +++ b/cliff.toml @@ -1,4 +1,4 @@ -# git-cliff configuration file +# git-cliff configuration file - 详细版本 # https://git-cliff.org/docs/configuration [changelog] @@ -15,7 +15,11 @@ body = """ {% for group, commits in commits | group_by(attribute="group") %} ### {{ group | upper_first }} {% for commit in commits %} -- {{ commit.message | upper_first }}{% if commit.scope %} *({{ commit.scope }})*{% endif %}{% if commit.breaking %} **BREAKING:** {{ commit.breaking_description }}{% endif %} +- **{{ commit.message | upper_first }}**{% if commit.scope %} *({{ commit.scope }})*{% endif %}{% if commit.breaking %} **BREAKING:** {{ commit.breaking_description }}{% endif %} + - 👤 **提交者**: {{ commit.author.name }} + - 🕒 **提交时间**: {{ commit.timestamp | date(format="%Y-%m-%d %H:%M:%S") }} + - 🔗 **提交哈希**: [{{ commit.id | truncate(length=7, end="") }}](https://github.com/InkCanvasForClass/community/commit/{{ commit.id }}) + - 📝 **完整消息**: {{ commit.message }} {% endfor %} {% endfor %} """ @@ -27,19 +31,48 @@ footer = "" [git] # parse the commits using this regex commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^docs", group = "Documentation" }, - { message = "^style", group = "Styling" }, - { message = "^refactor", group = "Code Refactoring" }, - { message = "^perf", group = "Performance" }, - { message = "^test", group = "Tests" }, - { message = "^build", group = "Build System" }, - { message = "^ci", group = "Continuous Integration" }, - { message = "^chore", group = "Chores" }, - { message = "^revert", group = "Reverts" }, - { message = "^merge", group = "Merges" }, - { message = "^.*", group = "Other" }, + # 带作用域的提交 + { message = "^feat\\((.+)\\)", group = "✨ Features", scope = "$1" }, + { message = "^fix\\((.+)\\)", group = "🐛 Bug Fixes", scope = "$1" }, + { message = "^docs\\((.+)\\)", group = "📚 Documentation", scope = "$1" }, + { message = "^style\\((.+)\\)", group = "💄 Styling", scope = "$1" }, + { message = "^refactor\\((.+)\\)", group = "♻️ Code Refactoring", scope = "$1" }, + { message = "^perf\\((.+)\\)", group = "⚡ Performance", scope = "$1" }, + { message = "^test\\((.+)\\)", group = "🧪 Tests", scope = "$1" }, + { message = "^build\\((.+)\\)", group = "🔨 Build System", scope = "$1" }, + { message = "^ci\\((.+)\\)", group = "👷 Continuous Integration", scope = "$1" }, + { message = "^chore\\((.+)\\)", group = "🔧 Chores", scope = "$1" }, + { message = "^revert\\((.+)\\)", group = "⏪ Reverts", scope = "$1" }, + { message = "^merge\\((.+)\\)", group = "🔀 Merges", scope = "$1" }, + { message = "^hotfix\\((.+)\\)", group = "🚨 Hotfixes", scope = "$1" }, + { message = "^security\\((.+)\\)", group = "🔒 Security", scope = "$1" }, + { message = "^ui\\((.+)\\)", group = "🎨 UI/UX", scope = "$1" }, + { message = "^api\\((.+)\\)", group = "🔌 API", scope = "$1" }, + { message = "^config\\((.+)\\)", group = "⚙️ Configuration", scope = "$1" }, + { message = "^deps\\((.+)\\)", group = "📦 Dependencies", scope = "$1" }, + + # 不带作用域的提交 + { message = "^feat", group = "✨ Features" }, + { message = "^fix", group = "🐛 Bug Fixes" }, + { message = "^docs", group = "📚 Documentation" }, + { message = "^style", group = "💄 Styling" }, + { message = "^refactor", group = "♻️ Code Refactoring" }, + { message = "^perf", group = "⚡ Performance" }, + { message = "^test", group = "🧪 Tests" }, + { message = "^build", group = "🔨 Build System" }, + { message = "^ci", group = "👷 Continuous Integration" }, + { message = "^chore", group = "🔧 Chores" }, + { message = "^revert", group = "⏪ Reverts" }, + { message = "^merge", group = "🔀 Merges" }, + { message = "^hotfix", group = "🚨 Hotfixes" }, + { message = "^security", group = "🔒 Security" }, + { message = "^ui", group = "🎨 UI/UX" }, + { message = "^api", group = "🔌 API" }, + { message = "^config", group = "⚙️ Configuration" }, + { message = "^deps", group = "📦 Dependencies" }, + + # 其他提交 + { message = "^.*", group = "📋 Other" }, ] # protect breaking changes from being skipped due to matching a previous commit protect_breaking_commits = false