From b0b063cd674dfd2d8e2a52270af78eb1ee48f9f4 Mon Sep 17 00:00:00 2001 From: mgravell Date: Fri, 11 Sep 2026 15:21:33 +0100 Subject: [PATCH] Fix the release artifact: .nupkgs is hidden, so it uploaded nothing The first dry run of release.yml went green while quietly producing no artifact: ##[warning]No files were found with the provided path: .nupkgs/*.nupkg. No artifacts will be uploaded. The packages were built and collected correctly - the log shows Dapper.AOT.1.1.0.nupkg and Dapper.Advisor.1.1.0.nupkg - but actions/upload-artifact excludes hidden files by default, and `.nupkgs` is a dot-directory, so the upload matched nothing and only warned. That would have cost us the "packages survive a failed push" guarantee precisely when it mattered. Dropped the dot rather than setting include-hidden-files, so it does not depend on an action input that could change again, and left a note so nobody tidies it back. versionHeightOffset -3 -> -4, because this is another commit on main and the target is still 1.1.0; simulated the squash to confirm (height 4, build 0, 1.1.0). --- .github/workflows/release.yml | 13 ++++++++----- version.json | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f76b564..cb1ef078 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,18 +76,21 @@ jobs: - name: Build run: dotnet build Build.csproj --no-restore -c Release + # note: NOT ".nupkgs" - actions/upload-artifact excludes hidden files by default, so a + # dot-directory uploads as an empty artifact (with only a warning). Caught by the first + # dry run of this workflow - name: Collect packages run: | - New-Item -ItemType Directory -Force -Path .nupkgs | Out-Null - Copy-Item src/Dapper.*/bin/Release/Dapper.*.nupkg .nupkgs/ - Get-ChildItem .nupkgs/*.nupkg | ForEach-Object { Write-Output $_.Name } + New-Item -ItemType Directory -Force -Path nupkgs | Out-Null + Copy-Item src/Dapper.*/bin/Release/Dapper.*.nupkg nupkgs/ + Get-ChildItem nupkgs/*.nupkg | ForEach-Object { Write-Output $_.Name } # the packages survive as a run artifact even if the push fails - name: Upload packages uses: actions/upload-artifact@v4 with: name: packages - path: .nupkgs/*.nupkg + path: nupkgs/*.nupkg - name: NuGet login (OIDC to temp API key) if: github.event_name == 'release' @@ -98,4 +101,4 @@ jobs: - name: Push to nuget.org if: github.event_name == 'release' - run: dotnet nuget push .nupkgs/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/version.json b/version.json index d5f097f4..a89ee24f 100644 --- a/version.json +++ b/version.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", "version": "1.1", - "versionHeightOffset": -3, + "versionHeightOffset": -4, "assemblyVersion": "1.0.0.0", "publicReleaseRefSpec": [ "^refs/heads/main$",