From 6b2c1d688f9814b550a9e8a1c1614ecd6c55e4ea Mon Sep 17 00:00:00 2001 From: Afonso Dutra Nogueira Filho Date: Wed, 18 Feb 2026 18:59:10 -0300 Subject: [PATCH] fix: Resolve PowerShell wildcard issue in NuGet publish workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## CI/CD Fixes - **PowerShell Wildcard**: Fixed Get-ChildItem for proper file enumeration - **File Upload**: Replaced wildcard patterns with ForEach-Object loop - **Cross-Platform**: Ensured compatibility with Windows PowerShell ## Technical Details - Fixed "File does not exist (./packages/*.nupkg)" error - Used Get-ChildItem -Filter to enumerate .nupkg files - Applied ForEach-Object to process each package individually - Maintained same functionality for both GitHub Packages and NuGet.org publishing ## Impact - ✅ CI/CD pipeline now works correctly on Windows runners - ✅ Package publishing no longer fails with wildcard errors - ✅ Maintained backward compatibility with existing workflow --- .github/workflows/publish-all.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-all.yml b/.github/workflows/publish-all.yml index 8b94072..e4a6856 100644 --- a/.github/workflows/publish-all.yml +++ b/.github/workflows/publish-all.yml @@ -111,13 +111,17 @@ jobs: - name: 📦 Publish to GitHub Packages run: | echo "📦 Publishing to GitHub Packages..." - dotnet nuget push ./packages/*.nupkg --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + Get-ChildItem -Path "./packages" -Filter "*.nupkg" | ForEach-Object { + dotnet nuget push $_.FullName --source 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + } - name: 📦 Publish to NuGet.org if: ${{ github.event.inputs.publish_nuget != 'false' }} run: | echo "📦 Publishing to NuGet.org..." - dotnet nuget push ./packages/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate + Get-ChildItem -Path "./packages" -Filter "*.nupkg" | ForEach-Object { + dotnet nuget push $_.FullName --source 'https://api.nuget.org/v3/index.json' --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate + } - name: ✅ NuGet Summary run: |