feat(workflow): 为自动标签工作流添加.NET测试步骤

- 在auto-tag.yml中添加.NET环境设置步骤
- 添加NuGet包缓存配置以优化构建性能
- 添加依赖项恢复、构建和测试步骤
- 从publish.yml中移除重复的依赖项恢复和测试步骤
- 优化工作流配置以提高构建效率
This commit is contained in:
GwWuYou 2026-01-02 13:18:12 +08:00
parent 6b8a8660ef
commit f7542cbc98
2 changed files with 23 additions and 9 deletions

View File

@ -44,7 +44,23 @@ jobs:
echo "No skip keyword found, proceeding with tag creation"
fi
echo "Last commit message: $LAST_COMMIT_MSG"
# 运行测试
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:DebugType=portable
- name: Test
run: dotnet test --no-build -c Release --verbosity normal
# 步骤三:计算下一个版本号(若未被跳过)
# 自动解析当前最新标签并递增修订号生成新的语义化版本号
- name: Get next version

View File

@ -35,16 +35,14 @@ jobs:
- name: Install unzip (for reading .nuspec from .nupkg)
run: sudo apt-get update && sudo apt-get install -y unzip
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:DebugType=portable
- name: Test
run: dotnet test --no-build -c Release --verbosity normal
- name: Determine tag version
id: tag_version
run: |