fix: consolidate build steps to share NuGet cache

Each step runs in a fresh container, so NuGet packages restored in one
step aren't available in the next. Consolidating restore/build/test
into single steps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Barry Walker
2026-01-13 15:47:19 -05:00
parent b77e5baf08
commit 85aecd5b13
2 changed files with 10 additions and 28 deletions
+7 -15
View File
@@ -15,22 +15,12 @@ clone:
tags: true
steps:
- name: restore
- name: build-and-test
image: mcr.microsoft.com/dotnet/sdk:10.0
commands:
- dotnet restore
- name: build
image: mcr.microsoft.com/dotnet/sdk:10.0
commands:
- dotnet build --no-restore -c Release
depends_on: [restore]
- name: test
image: mcr.microsoft.com/dotnet/sdk:10.0
commands:
- dotnet test --no-build -c Release --logger "console;verbosity=detailed"
depends_on: [build]
- dotnet build -c Release
- dotnet test -c Release --logger "console;verbosity=detailed"
# Determine next version based on conventional commits
- name: version
@@ -87,7 +77,7 @@ steps:
# Save version for other steps
echo "$NEW_VERSION" > .version
echo "v${NEW_VERSION}" > .tag
depends_on: [test]
depends_on: [build-and-test]
# Package NuGet
- name: package
@@ -95,7 +85,9 @@ steps:
commands:
- VERSION=$(cat .version)
- echo "Packaging version $VERSION"
- dotnet pack PaperlessMCP/PaperlessMCP.csproj --no-build -c Release -o ./artifacts /p:Version=$VERSION /p:PackageVersion=$VERSION
- dotnet restore
- dotnet build -c Release
- dotnet pack PaperlessMCP/PaperlessMCP.csproj -c Release -o ./artifacts /p:Version=$VERSION /p:PackageVersion=$VERSION
- ls -la ./artifacts/
depends_on: [version]