From d1617bd7399be3eccd782a2862a52de3a3cc9198 Mon Sep 17 00:00:00 2001 From: trueai-org <37255565+trueai-org@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:54:22 +0800 Subject: [PATCH] Update dotnet-desktop.yml --- .github/workflows/dotnet-desktop.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index b652b5c..ae0890e 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -19,20 +19,24 @@ jobs: with: dotnet-version: '8.0.x' # 确保使用的 .NET 版本与你的项目版本匹配 + - name: 列出目录内容 (调试步骤) + run: | + dir src/MDriveSync.Client.API/Properties/PublishProfiles + - name: 构建并发布 .NET 应用程序 run: | - dotnet publish src/MDriveSync.Client.API/Properties/PublishProfiles/Client.Publish.SelfContained.win.x64.pubxml -c Release -o publish + dotnet publish src/MDriveSync.Client.API --no-build -c Release /p:PublishProfile=Client.Publish.SelfContained.win.x64.pubxml - name: 删除 PDB 和 XML 文件 run: | # 删除目录中的 .pdb 和 .xml 文件(如果存在) - Remove-Item publish/*.pdb -Force -ErrorAction SilentlyContinue - Remove-Item publish/*.xml -Force -ErrorAction SilentlyContinue + Remove-Item src/MDriveSync.Client.API/bin/Release/net8.0/publish/*.pdb -Force -ErrorAction SilentlyContinue + Remove-Item src/MDriveSync.Client.API/bin/Release/net8.0/publish/*.xml -Force -ErrorAction SilentlyContinue - name: 压缩构建产物 run: | # 将发布目录中的文件压缩为 zip 文件 - Compress-Archive -Path publish/* -DestinationPath "MDrive-win-x64-v${{ github.sha }}.zip" + Compress-Archive -Path src/MDriveSync.Client.API/bin/Release/net8.0/publish/* -DestinationPath "MDrive-win-x64-v${{ github.sha }}.zip" - name: 创建 GitHub Release id: create_release @@ -46,7 +50,7 @@ jobs: prerelease: false - name: 上传 ZIP 文件到 release - uses: actions/upload-release-asset@v2 # 使用最新稳定版本 + uses: actions/upload-release-asset@v1 # 使用最新稳定版本 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: