Skip to content

Commit 751f129

Browse files
authored
fix: use dotnet nuget to push packages (#1339)
This PR modernizes the NuGet package publishing process by replacing the legacy `nuget.exe` tool with the built-in `dotnet nuget` command. This change follows best practices recommended in [Meziantou's blog]((https://www.meziantou.net/publishing-a-nuget-package-following-best-practices-using-github.htm)) for more reliable and streamlined package publishing. ### Key changes: - Replaces `nuget/setup-nuget@v2` action with `actions/setup-dotnet@v5` - Updates push commands from `nuget push` to `dotnet nuget push` with updated parameter syntax
1 parent ed97855 commit 751f129

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ jobs:
149149
with:
150150
name: Packages
151151
path: Artifacts/Packages
152+
- name: Setup .NET SDKs
153+
uses: actions/setup-dotnet@v5
152154
- name: Publish
153155
run: |
154156
echo "Found the following packages to push:"
@@ -159,7 +161,7 @@ jobs:
159161
done
160162
for entry in Artifacts/Packages/*.nupkg
161163
do
162-
nuget push $entry -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} -SkipDuplicate
164+
dotnet nuget push $entry --source https://api.nuget.org/v3/index.json --api-key "${{secrets.NUGET_API_KEY}}" --skip-duplicate
163165
done
164166
- name: Check pre-release
165167
id: check-pre-release

0 commit comments

Comments
 (0)