From 70a66b106d0dce4268c6fce6ea0f8a5a8e1d643e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 00:26:50 +0000 Subject: [PATCH] ci: split build and pack in release.yml, mirroring mass-release fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mass-release.yml landed PR #15 to separate `dotnet build` from `dotnet pack --no-build`, which fixed the api-dto NU5026 hang and made build errors visible. release.yml had the same compressed "pack-with-implicit-build" pattern and would have hit the same issue on the next tag-driven release that involves a shared-project consumer or other edge case. Apply the same shape to release.yml: - New "Build (target project)" step runs `dotnet build` with --verbosity normal so any compile error shows up explicitly. - "Pack" step now passes --no-build (since build was just done) and packages the existing output. -p:PackageVersion= override on the pack invocation only — never -p:Version= — keeps ProjectReference resolution intact for transitive deps in the .nuspec. No functional change for ef-v6.3.0 (already published successfully). Defense-in-depth for the next per-package tag. https://claude.ai/code/session_015jxScBEvdKkRwGvJTgK5Py --- .github/workflows/release.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e857db7..37faad5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,15 +108,25 @@ jobs: - name: Test (solution) run: dotnet test Codout.Framework.sln --configuration "$CONFIGURATION" --no-build --verbosity normal + - name: Build (target project) + run: | + # Build the target project explicitly with --verbosity normal. The + # solution build above does not cover out-of-solution packages + # (Cosmos, DocumentDB, etc.) and may leave the target unbuilt anyway, + # so we build it here and pack with --no-build below. Splitting + # build and pack also keeps build errors visible — relying on + # `dotnet pack`'s implicit build can silently swallow failures (see + # the api-dto NU5026 incident that motivated this pattern in + # mass-release.yml). + dotnet build "${{ steps.resolve.outputs.project }}" \ + --configuration "$CONFIGURATION" \ + --verbosity normal + - name: Pack run: | set -euo pipefail VERSION="${{ steps.resolve.outputs.version }}" PROJECT="${{ steps.resolve.outputs.project }}" - # Pack performs its own restore/build for the target. Some packages - # (Cosmos, DocumentDB, etc.) are not part of Codout.Framework.sln, so - # we deliberately do NOT pass --no-build here. - # # IMPORTANT: when overriding the package version via workflow_dispatch, # use ONLY -p:PackageVersion=. Passing -p:Version= cascades to every # project in the build graph (including ProjectReferences), which @@ -124,11 +134,11 @@ jobs: # produces broken packages. -p:PackageVersion only affects the # outgoing package and leaves ProjectReference resolution alone. if [ -n "$VERSION" ]; then - dotnet pack "$PROJECT" --configuration "$CONFIGURATION" \ + dotnet pack "$PROJECT" --configuration "$CONFIGURATION" --no-build \ -p:PackageVersion="$VERSION" \ --output ./artifacts else - dotnet pack "$PROJECT" --configuration "$CONFIGURATION" \ + dotnet pack "$PROJECT" --configuration "$CONFIGURATION" --no-build \ --output ./artifacts fi ls -la ./artifacts