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
+3 -13
View File
@@ -12,19 +12,9 @@ clone:
lfs: false lfs: false
steps: steps:
- name: restore - name: build-and-test
image: mcr.microsoft.com/dotnet/sdk:10.0 image: mcr.microsoft.com/dotnet/sdk:10.0
commands: commands:
- dotnet restore - dotnet restore
- dotnet build -c Release
- name: build - dotnet test -c Release --logger "console;verbosity=detailed"
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]
+7 -15
View File
@@ -15,22 +15,12 @@ clone:
tags: true tags: true
steps: steps:
- name: restore - name: build-and-test
image: mcr.microsoft.com/dotnet/sdk:10.0 image: mcr.microsoft.com/dotnet/sdk:10.0
commands: commands:
- dotnet restore - dotnet restore
- dotnet build -c Release
- name: build - dotnet test -c Release --logger "console;verbosity=detailed"
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]
# Determine next version based on conventional commits # Determine next version based on conventional commits
- name: version - name: version
@@ -87,7 +77,7 @@ steps:
# Save version for other steps # Save version for other steps
echo "$NEW_VERSION" > .version echo "$NEW_VERSION" > .version
echo "v${NEW_VERSION}" > .tag echo "v${NEW_VERSION}" > .tag
depends_on: [test] depends_on: [build-and-test]
# Package NuGet # Package NuGet
- name: package - name: package
@@ -95,7 +85,9 @@ steps:
commands: commands:
- VERSION=$(cat .version) - VERSION=$(cat .version)
- echo "Packaging version $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/ - ls -la ./artifacts/
depends_on: [version] depends_on: [version]