diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-release.yml
similarity index 65%
rename from .github/workflows/dotnet-desktop.yml
rename to .github/workflows/dotnet-release.yml
index 63d133a..e1b66cd 100644
--- a/.github/workflows/dotnet-desktop.yml
+++ b/.github/workflows/dotnet-release.yml
@@ -11,6 +11,10 @@ jobs:
build-release:
if: ${{ github.event.pull_request.merged == true }}
runs-on: windows-latest
+ outputs:
+ version: ${{ steps.extract_version.outputs.version }}
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+
env:
PROJECT_NAME: SpineViewer
PROJ_CLI_NAME: SpineViewerCLI
@@ -27,21 +31,15 @@ jobs:
dotnet-version: "8.0.x"
- name: Extract version from csproj
+ id: extract_version
shell: pwsh
run: |
[xml]$proj = Get-Content "$env:PROJECT_NAME\$env:PROJECT_NAME.csproj"
$VERSION_NUM = $proj.Project.PropertyGroup.Version
$VERSION_TAG = "v$VERSION_NUM".Trim()
- "VERSION=$VERSION_TAG" >> $env:GITHUB_ENV
-
- - name: Check Version Tag
- shell: pwsh
- run: |
- if (-not $env:VERSION) {
- Write-Error "Version tag not found in csproj file."
- exit 1
- }
- Write-Host "Version tag found: $env:VERSION"
+ echo "Version tag found: $VERSION_TAG"
+ echo "version=$VERSION_TAG" >> $env:GITHUB_OUTPUT
+ echo "VERSION=$VERSION_TAG" >> $env:GITHUB_ENV
- name: Tag merge commit
shell: pwsh
@@ -63,19 +61,11 @@ jobs:
dotnet publish "$env:PROJECT_NAME\$env:PROJECT_NAME.csproj" -c Release -r win-x64 --sc true -o "publish\$env:PROJECT_NAME-$env:VERSION-SelfContained"
dotnet publish "$env:PROJ_CLI_NAME\$env:PROJ_CLI_NAME.csproj" -c Release -r win-x64 --sc true -o "publish\$env:PROJECT_NAME-$env:VERSION-SelfContained"
- - name: Create release directory
+ - name: Compress Windows builds
shell: pwsh
run: |
New-Item -ItemType Directory -Path release -Force | Out-Null
-
- - name: Compress FrameworkDependent version
- shell: pwsh
- run: |
Compress-Archive -Path "publish\$env:PROJECT_NAME-$env:VERSION\*" -DestinationPath "release\$env:PROJECT_NAME-$env:VERSION.zip" -Force
-
- - name: Compress SelfContained version
- shell: pwsh
- run: |
Compress-Archive -Path "publish\$env:PROJECT_NAME-$env:VERSION-SelfContained\*" -DestinationPath "release\$env:PROJECT_NAME-$env:VERSION-SelfContained.zip" -Force
- name: Create GitHub Release
@@ -89,7 +79,7 @@ jobs:
draft: false
prerelease: false
- - name: Upload FrameworkDependent zip
+ - name: Upload Windows FrameworkDependent zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -99,7 +89,7 @@ jobs:
asset_name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}.zip
asset_content_type: application/zip
- - name: Upload SelfContained zip
+ - name: Upload Windows SelfContained zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -108,3 +98,42 @@ jobs:
asset_path: release/${{ env.PROJECT_NAME }}-${{ env.VERSION }}-SelfContained.zip
asset_name: ${{ env.PROJECT_NAME }}-${{ env.VERSION }}-SelfContained.zip
asset_content_type: application/zip
+
+
+ build-release-linux:
+ needs: build-release
+ if: ${{ github.event.pull_request.merged == true }}
+ runs-on: ubuntu-latest
+ env:
+ PROJ_CLI_NAME: SpineViewerCLI
+ VERSION: ${{ needs.build-release.outputs.version }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+ with:
+ fetch-tags: true
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: "8.0.x"
+
+ - name: Publish Linux SelfContained version
+ run: |
+ dotnet publish "$PROJ_CLI_NAME/$PROJ_CLI_NAME.csproj" -c Release -r linux-x64 --sc true -o "publish/${PROJ_CLI_NAME}-${VERSION}-Linux-SelfContained"
+
+ - name: Compress Linux build
+ run: |
+ mkdir -p release
+ zip -r "release/${PROJ_CLI_NAME}-${VERSION}-Linux-SelfContained.zip" "publish/${PROJ_CLI_NAME}-${VERSION}-Linux-SelfContained"
+
+ - name: Upload Linux zip to GitHub Release
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.build-release.outputs.upload_url }}
+ asset_path: release/${{ env.PROJ_CLI_NAME }}-${{ env.VERSION }}-Linux-SelfContained.zip
+ asset_name: ${{ env.PROJ_CLI_NAME }}-${{ env.VERSION }}-Linux-SelfContained.zip
+ asset_content_type: application/zip
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5980e05..b367269 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v0.16.10
+
+- 增加 Linux 平台 CLI 工具构建
+
## v0.16.9
- 重构 CLI 工具
diff --git a/NLog.Windows.Wpf/NLog.Windows.Wpf.csproj b/NLog.Windows.Wpf/NLog.Windows.Wpf.csproj
index 48e2058..ac8d5c7 100644
--- a/NLog.Windows.Wpf/NLog.Windows.Wpf.csproj
+++ b/NLog.Windows.Wpf/NLog.Windows.Wpf.csproj
@@ -4,6 +4,7 @@
enable
enable
x64
+ x64
net8.0-windows
$(SolutionDir)out
false
diff --git a/SFMLRenderer/SFMLRenderer.csproj b/SFMLRenderer/SFMLRenderer.csproj
index a6ea5e8..9d047ed 100644
--- a/SFMLRenderer/SFMLRenderer.csproj
+++ b/SFMLRenderer/SFMLRenderer.csproj
@@ -4,6 +4,7 @@
enable
enable
x64
+ x64
net8.0-windows
$(SolutionDir)out
false
diff --git a/Spine/Spine.csproj b/Spine/Spine.csproj
index 1e0cc28..d608a48 100644
--- a/Spine/Spine.csproj
+++ b/Spine/Spine.csproj
@@ -4,10 +4,11 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
- 0.16.9
+ 0.16.10
@@ -21,6 +22,10 @@
+
+
+
+
diff --git a/Spine/Utils/SFMLShader.cs b/Spine/Utils/SFMLShader.cs
index 31156cd..33631f4 100644
--- a/Spine/Utils/SFMLShader.cs
+++ b/Spine/Utils/SFMLShader.cs
@@ -14,7 +14,7 @@ namespace Spine.Utils
///
private const string FRAGMENT_VertexAlpha =
"uniform sampler2D t;" +
- "void main() { vec4 p = texture(t, gl_TexCoord[0].xy);" +
+ "void main() { vec4 p = texture2D(t, gl_TexCoord[0].xy);" +
"p.rgb *= p.a * gl_Color.a;" +
"gl_FragColor = gl_Color * p; }"
;
@@ -24,7 +24,7 @@ namespace Spine.Utils
///
private const string FRAGMENT_VertexAlphaPma =
"uniform sampler2D t;" +
- "void main() { vec4 p = texture(t, gl_TexCoord[0].xy);" +
+ "void main() { vec4 p = texture2D(t, gl_TexCoord[0].xy);" +
"p.rgb *= gl_Color.a;" +
"gl_FragColor = gl_Color * p; }"
;
@@ -34,8 +34,8 @@ namespace Spine.Utils
///
private const string FRAGMENT_InvPma =
"uniform sampler2D t;" +
- "void main() { vec4 p = texture(t, gl_TexCoord[0].xy);" +
- "if (p.a > 0) p.rgb /= max(max(max(p.r, p.g), p.b), p.a);" +
+ "void main() { vec4 p = texture2D(t, gl_TexCoord[0].xy);" +
+ "if (p.a > 0.0) p.rgb /= max(max(max(p.r, p.g), p.b), p.a);" +
"gl_FragColor = p; }"
;
diff --git a/SpineRuntimes/SpineRuntime21/SpineRuntime21.csproj b/SpineRuntimes/SpineRuntime21/SpineRuntime21.csproj
index 1f8f717..e1f26a1 100644
--- a/SpineRuntimes/SpineRuntime21/SpineRuntime21.csproj
+++ b/SpineRuntimes/SpineRuntime21/SpineRuntime21.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
2.1.25
diff --git a/SpineRuntimes/SpineRuntime34/SpineRuntime34.csproj b/SpineRuntimes/SpineRuntime34/SpineRuntime34.csproj
index 88d1692..ca2ccf0 100644
--- a/SpineRuntimes/SpineRuntime34/SpineRuntime34.csproj
+++ b/SpineRuntimes/SpineRuntime34/SpineRuntime34.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
3.4.2
diff --git a/SpineRuntimes/SpineRuntime35/SpineRuntime35.csproj b/SpineRuntimes/SpineRuntime35/SpineRuntime35.csproj
index 40032ce..94b02b1 100644
--- a/SpineRuntimes/SpineRuntime35/SpineRuntime35.csproj
+++ b/SpineRuntimes/SpineRuntime35/SpineRuntime35.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
3.5.51
diff --git a/SpineRuntimes/SpineRuntime36/SpineRuntime36.csproj b/SpineRuntimes/SpineRuntime36/SpineRuntime36.csproj
index 19947c1..d77eba6 100644
--- a/SpineRuntimes/SpineRuntime36/SpineRuntime36.csproj
+++ b/SpineRuntimes/SpineRuntime36/SpineRuntime36.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
3.6.53
diff --git a/SpineRuntimes/SpineRuntime37/SpineRuntime37.csproj b/SpineRuntimes/SpineRuntime37/SpineRuntime37.csproj
index 7ccda43..8c97bc6 100644
--- a/SpineRuntimes/SpineRuntime37/SpineRuntime37.csproj
+++ b/SpineRuntimes/SpineRuntime37/SpineRuntime37.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
3.7.94
diff --git a/SpineRuntimes/SpineRuntime38/SpineRuntime38.csproj b/SpineRuntimes/SpineRuntime38/SpineRuntime38.csproj
index 6f1d12f..8205045 100644
--- a/SpineRuntimes/SpineRuntime38/SpineRuntime38.csproj
+++ b/SpineRuntimes/SpineRuntime38/SpineRuntime38.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
3.8.99
diff --git a/SpineRuntimes/SpineRuntime40/SpineRuntime40.csproj b/SpineRuntimes/SpineRuntime40/SpineRuntime40.csproj
index 92d5672..91cb0e5 100644
--- a/SpineRuntimes/SpineRuntime40/SpineRuntime40.csproj
+++ b/SpineRuntimes/SpineRuntime40/SpineRuntime40.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
4.0.64
diff --git a/SpineRuntimes/SpineRuntime41/SpineRuntime41.csproj b/SpineRuntimes/SpineRuntime41/SpineRuntime41.csproj
index 581e2d6..514f838 100644
--- a/SpineRuntimes/SpineRuntime41/SpineRuntime41.csproj
+++ b/SpineRuntimes/SpineRuntime41/SpineRuntime41.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
4.1.54
diff --git a/SpineRuntimes/SpineRuntime42/SpineRuntime42.csproj b/SpineRuntimes/SpineRuntime42/SpineRuntime42.csproj
index 4f70bf4..9a4353b 100644
--- a/SpineRuntimes/SpineRuntime42/SpineRuntime42.csproj
+++ b/SpineRuntimes/SpineRuntime42/SpineRuntime42.csproj
@@ -4,7 +4,8 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
4.2.74
diff --git a/SpineViewer/SpineViewer.csproj b/SpineViewer/SpineViewer.csproj
index f61cea0..dbf1c3b 100644
--- a/SpineViewer/SpineViewer.csproj
+++ b/SpineViewer/SpineViewer.csproj
@@ -4,10 +4,11 @@
enable
enable
x64
+ x64
net8.0-windows
$(SolutionDir)out
false
- 0.16.9
+ 0.16.10
WinExe
true
diff --git a/SpineViewerCLI/SpineViewerCLI.csproj b/SpineViewerCLI/SpineViewerCLI.csproj
index 23f7aaa..981e168 100644
--- a/SpineViewerCLI/SpineViewerCLI.csproj
+++ b/SpineViewerCLI/SpineViewerCLI.csproj
@@ -4,10 +4,11 @@
enable
enable
x64
- net8.0-windows
+ x64
+ net8.0
$(SolutionDir)out
false
- 0.16.9
+ 0.16.10
Exe
@@ -22,7 +23,6 @@
-