From 0b4db3da91003c6956524a820b7f213cdc9721c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Tue, 12 Aug 2025 00:56:11 +0200 Subject: [PATCH] fix: use dotnet nuget to push packages 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@v4` - Updates push commands from `nuget push` to `dotnet nuget push` with updated parameter syntax --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a88b09c8e..f6634fd16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,6 +182,8 @@ jobs: with: name: Packages path: Artifacts/Packages + - name: Setup .NET SDKs + uses: actions/setup-dotnet@v4 - name: Publish run: | echo "Found the following packages to push:" @@ -192,7 +194,7 @@ jobs: done for entry in Artifacts/Packages/aweXpect/*.nupkg do - nuget push $entry -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} -SkipDuplicate + dotnet nuget push $entry --source https://api.nuget.org/v3/index.json --api-key "${{secrets.NUGET_API_KEY}}" --skip-duplicate done - name: Check pre-release id: check-pre-release @@ -222,6 +224,8 @@ jobs: with: name: Packages path: Artifacts/Packages + - name: Setup .NET SDKs + uses: actions/setup-dotnet@v4 - name: Publish run: | echo "Found the following packages to push:" @@ -232,7 +236,7 @@ jobs: done for entry in Artifacts/Packages/aweXpect.Core/*.nupkg do - nuget push $entry -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} -SkipDuplicate + dotnet nuget push $entry --source https://api.nuget.org/v3/index.json --api-key "${{secrets.NUGET_API_KEY}}" --skip-duplicate done finalize-release: