From f9fb807d1d776427a415d723626eb5527daad8d2 Mon Sep 17 00:00:00 2001 From: Rickard Nord Date: Fri, 3 Jul 2026 10:55:54 +0200 Subject: [PATCH 1/2] fix: base release version on max of git tag and published NuGet version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tags v1.11.0/v1.11.1 were deleted after being published to NuGet, but NuGet has no unpublish — those versions stayed live there permanently. Since release.yml computed the next version from git tags alone, it kept bumping from v1.10.x, producing v1.10.3 while NuGet's "latest" resolves to the already-published v1.11.1 (higher SemVer wins), so newer releases were effectively invisible to consumers. --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c05a43..d0550f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,12 @@ jobs: tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") echo "tag=$tag" >> "$GITHUB_OUTPUT" + - name: Get highest published NuGet version + id: nuget_version + run: | + highest=$(curl -sf "https://api.nuget.org/v3-flatcontainer/niceentry/index.json" 2>/dev/null | jq -r '.versions[]' 2>/dev/null | sort -V | tail -1) || true + echo "version=${highest:-0.0.0}" >> "$GITHUB_OUTPUT" + - name: Determine bump type from PR labels id: bump run: | @@ -45,8 +51,10 @@ jobs: - name: Calculate new version id: version run: | - current="${{ steps.latest_tag.outputs.tag }}" - current="${current#v}" + tag_version="${{ steps.latest_tag.outputs.tag }}" + tag_version="${tag_version#v}" + nuget_version="${{ steps.nuget_version.outputs.version }}" + current=$(printf '%s\n%s\n' "$tag_version" "$nuget_version" | sort -V | tail -1) IFS='.' read -r major minor patch <<< "$current" case "${{ steps.bump.outputs.type }}" in From 91903d37f8cf255ca327525b42bed5f1a58d1bbc Mon Sep 17 00:00:00 2001 From: Rickard Nord Date: Fri, 3 Jul 2026 11:05:41 +0200 Subject: [PATCH 2/2] fix: fail loudly on unexpected NuGet API errors instead of falling back to 0.0.0 The previous curl -sf ... || true swallowed timeouts, DNS failures, and 5xx errors the same as a genuine 404, silently reverting to git-tag-only versioning on transient failures - the exact bug this workflow now guards against. --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0550f9..dca40a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,16 @@ jobs: - name: Get highest published NuGet version id: nuget_version run: | - highest=$(curl -sf "https://api.nuget.org/v3-flatcontainer/niceentry/index.json" 2>/dev/null | jq -r '.versions[]' 2>/dev/null | sort -V | tail -1) || true - echo "version=${highest:-0.0.0}" >> "$GITHUB_OUTPUT" + http_code=$(curl -s --max-time 15 -o /tmp/nuget-versions.json -w '%{http_code}' "https://api.nuget.org/v3-flatcontainer/niceentry/index.json") + if [ "$http_code" = "404" ]; then + highest="0.0.0" + elif [ "$http_code" != "200" ]; then + echo "::error::NuGet version lookup failed (HTTP $http_code) - refusing to fall back silently to git tags only" >&2 + exit 1 + else + highest=$(jq -r '.versions[]' /tmp/nuget-versions.json | sort -V | tail -1) + fi + echo "version=$highest" >> "$GITHUB_OUTPUT" - name: Determine bump type from PR labels id: bump