From 553f4fd07b2a0336ceecd566fa4b49b717011021 Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Fri, 24 Jul 2026 17:06:55 +0100 Subject: [PATCH] enforce releases / ship-files are in sync --- .github/workflows/nuget-release.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml index 6311fdb1..867cdda9 100644 --- a/.github/workflows/nuget-release.yml +++ b/.github/workflows/nuget-release.yml @@ -20,6 +20,24 @@ jobs: - name: Check .NET runtimes run: dotnet --list-runtimes + - name: Verify public API is shipped + run: | + # A release must not carry unshipped public API: every + # PublicAPI.Unshipped.txt should be empty apart from '#' lines + # (e.g. '#nullable enable') and blank lines. Otherwise the + # shipped/unshipped state was not promoted before release. + status=0 + while IFS= read -r -d '' f; do + leftover=$(grep -vE '^[[:space:]]*(#.*)?$' "$f" || true) + if [ -n "$leftover" ]; then + echo "::error file=$f::Unshipped public API present; promote to PublicAPI.Shipped.txt before releasing" + echo "--- $f ---" + printf '%s\n' "$leftover" + status=1 + fi + done < <(find . -name PublicAPI.Unshipped.txt -print0) + exit $status + - name: get version from tag id: get_version run: |