From 49f6b28aef836b2427612915238b790ec39d7bf9 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:05:09 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=9E=9A=E4=B8=BE=E9=87=8F=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E5=A4=A7=E5=B0=8F=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SkeletonConverter/SkeletonConverter38.cs | 13 ++++++++++++- .../SkeletonConverter/SkeletonConverter41.cs | 4 ++-- .../SkeletonConverter/SkeletonConverter42.cs | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs index 7db42cb..01c018e 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter38.cs @@ -51,6 +51,17 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter [RotateMode.ChainScale] = "chainScale", }; + private static readonly Dictionary AttachmentTypeJsonValue = new() + { + [AttachmentType.Region] = "region", + [AttachmentType.Boundingbox] = "bounding", + [AttachmentType.Mesh] = "mesh", + [AttachmentType.Linkedmesh] = "linkedmesh", + [AttachmentType.Path] = "path", + [AttachmentType.Point] = "point", + [AttachmentType.Clipping] = "clipping", + }; + private BinaryReader reader = null; private JsonObject root = null; private bool nonessential = false; @@ -298,7 +309,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter var name = reader.ReadStringRef() ?? keyName; var type = (AttachmentType)reader.ReadByte(); attachment["name"] = name; - attachment["type"] = type.ToString(); + attachment["type"] = AttachmentTypeJsonValue[type]; switch (type) { case AttachmentType.Region: diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs index bf25958..c08316a 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter41.cs @@ -52,9 +52,9 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter private static readonly Dictionary AttachmentTypeJsonValue = new() { [AttachmentType.Region] = "region", - [AttachmentType.Boundingbox] = "boundingBox", + [AttachmentType.Boundingbox] = "boundingbox", [AttachmentType.Mesh] = "mesh", - [AttachmentType.Linkedmesh] = "linkedMesh", + [AttachmentType.Linkedmesh] = "linkedmesh", [AttachmentType.Path] = "path", [AttachmentType.Point] = "point", [AttachmentType.Clipping] = "clipping", diff --git a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs index 47aa5d0..891bf31 100644 --- a/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs +++ b/SpineViewer/Spine/Implementations/SkeletonConverter/SkeletonConverter42.cs @@ -52,7 +52,7 @@ namespace SpineViewer.Spine.Implementations.SkeletonConverter [AttachmentType.Region] = "region", [AttachmentType.Boundingbox] = "bounding", [AttachmentType.Mesh] = "mesh", - [AttachmentType.Linkedmesh] = "linkedMesh", + [AttachmentType.Linkedmesh] = "linkedmesh", [AttachmentType.Path] = "path", [AttachmentType.Point] = "point", [AttachmentType.Clipping] = "clipping", From 3e480abd4425d01b319bd2ab4d70466806c30c80 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:05:42 +0800 Subject: [PATCH 2/5] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d420a..68c6a37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v0.12.15 + +- 修复附件类型枚举量字符串大小写问题 + ## v0.12.14 - 修复 v38 文件读取的小 bug From 3ad49838beaa1eed4d9b69391ef2ec8221ab530e Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:05:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=B3v0.12.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/SpineViewer.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpineViewer/SpineViewer.csproj b/SpineViewer/SpineViewer.csproj index 60e6550..8664749 100644 --- a/SpineViewer/SpineViewer.csproj +++ b/SpineViewer/SpineViewer.csproj @@ -7,7 +7,7 @@ net8.0-windows $(SolutionDir)out false - 0.12.14 + 0.12.15 WinExe true appicon.ico From 30177e8d7faa513f6f074847edf4f8b39adc6b46 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:28:12 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=8F=96=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet-desktop.yml | 35 +++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 9507c61..4a9d9f0 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -1,16 +1,19 @@ name: Build & Release on: - push: - tags: - - 'v*.*.*' + pull_request: + branches: + - release/wf + types: + - closed jobs: build-release: + if: ${{ github.event.pull_request.merged == true }} runs-on: windows-latest env: PROJECT_NAME: SpineViewer - VERSION: ${{ github.ref_name }} + steps: - name: Checkout code uses: actions/checkout@v3 @@ -20,13 +23,33 @@ jobs: with: dotnet-version: '8.0.x' + - name: Extract version from csproj + id: extract_version + run: | + # 从 csproj 读取 x.y.z + VERSION_NUM=$(grep -oP '(?<=)[^<]+' "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj") + # 带上 v 前缀 + VERSION_TAG="v${VERSION_NUM}" + echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT + echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_OUTPUT + + - name: Export VERSION env (with v prefix) + run: echo "VERSION=${{ steps.extract_version.outputs.VERSION_TAG }}" >> $GITHUB_ENV + + - name: Tag merge commit + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${VERSION}" -m "Release ${VERSION}" + git push origin "${VERSION}" + - name: Publish FrameworkDependent version run: | - dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc false -p:PublishSingleFile=true -o publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }} + dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc false -o publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }} - name: Publish SelfContained version run: | - dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc true -p:PublishSingleFile=true -o publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }}-SelfContained + dotnet publish ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj -c Release -r win-x64 --sc true -o publish/${{ env.PROJECT_NAME }}-${{ env.VERSION }}-SelfContained - name: Create release directory run: mkdir release From 0cb325820b788ae8e71cb1dfe1211b72fd6f0ddb Mon Sep 17 00:00:00 2001 From: ww-rm Date: Wed, 28 May 2025 16:38:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=89=88=E6=9C=AC=E6=8F=90=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet-desktop.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 4a9d9f0..93f7ad0 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -24,14 +24,14 @@ jobs: dotnet-version: '8.0.x' - name: Extract version from csproj + shell: pwsh id: extract_version run: | - # 从 csproj 读取 x.y.z - VERSION_NUM=$(grep -oP '(?<=)[^<]+' "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj") - # 带上 v 前缀 - VERSION_TAG="v${VERSION_NUM}" - echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT - echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_OUTPUT + [xml]$proj = Get-Content "${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj" + $VERSION_NUM=$proj.Project.PropertyGroup.Version + $VERSION_TAG="v$VERSION_NUM" + echo "VERSION_NUM=$VERSION_NUM" >> $GITHUB_OUTPUT + echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_OUTPUT - name: Export VERSION env (with v prefix) run: echo "VERSION=${{ steps.extract_version.outputs.VERSION_TAG }}" >> $GITHUB_ENV