Skip to content

Commit 0e071bf

Browse files
authored
Fix the release artifact: .nupkgs is hidden, so it uploaded nothing (#223)
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).
1 parent b5194b4 commit 0e071bf

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,21 @@ jobs:
7676
- name: Build
7777
run: dotnet build Build.csproj --no-restore -c Release
7878

79+
# note: NOT ".nupkgs" - actions/upload-artifact excludes hidden files by default, so a
80+
# dot-directory uploads as an empty artifact (with only a warning). Caught by the first
81+
# dry run of this workflow
7982
- name: Collect packages
8083
run: |
81-
New-Item -ItemType Directory -Force -Path .nupkgs | Out-Null
82-
Copy-Item src/Dapper.*/bin/Release/Dapper.*.nupkg .nupkgs/
83-
Get-ChildItem .nupkgs/*.nupkg | ForEach-Object { Write-Output $_.Name }
84+
New-Item -ItemType Directory -Force -Path nupkgs | Out-Null
85+
Copy-Item src/Dapper.*/bin/Release/Dapper.*.nupkg nupkgs/
86+
Get-ChildItem nupkgs/*.nupkg | ForEach-Object { Write-Output $_.Name }
8487
8588
# the packages survive as a run artifact even if the push fails
8689
- name: Upload packages
8790
uses: actions/upload-artifact@v4
8891
with:
8992
name: packages
90-
path: .nupkgs/*.nupkg
93+
path: nupkgs/*.nupkg
9194

9295
- name: NuGet login (OIDC to temp API key)
9396
if: github.event_name == 'release'
@@ -98,4 +101,4 @@ jobs:
98101

99102
- name: Push to nuget.org
100103
if: github.event_name == 'release'
101-
run: dotnet nuget push .nupkgs/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
104+
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

‎version.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
33
"version": "1.1",
4-
"versionHeightOffset": -3,
4+
"versionHeightOffset": -4,
55
"assemblyVersion": "1.0.0.0",
66
"publicReleaseRefSpec": [
77
"^refs/heads/main$",

0 commit comments

Comments
 (0)