diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 1a37613..ef73d08 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 203c277..e3319b5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: |