Skip to content

Commit 8da71c3

Browse files
committed
fix: push nuget packages individually in workflow
1 parent 2b0ea4f commit 8da71c3

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/publish-nuget.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,25 @@ jobs:
5959

6060
- name: Push package with Trusted Publishing
6161
if: ${{ steps.publish-mode.outputs.mode == 'trusted' }}
62+
shell: pwsh
6263
run: |
63-
dotnet nuget push "artifacts/*.nupkg" --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
64-
dotnet nuget push "artifacts/*.snupkg" --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
64+
Get-ChildItem artifacts -Filter *.nupkg | ForEach-Object {
65+
dotnet nuget push $_.FullName --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
66+
}
67+
Get-ChildItem artifacts -Filter *.snupkg | ForEach-Object {
68+
dotnet nuget push $_.FullName --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
69+
}
6570
6671
- name: Push package with classic API key
6772
if: ${{ steps.publish-mode.outputs.mode == 'classic' }}
73+
shell: pwsh
6874
run: |
69-
dotnet nuget push "artifacts/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
70-
dotnet nuget push "artifacts/*.snupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
75+
Get-ChildItem artifacts -Filter *.nupkg | ForEach-Object {
76+
dotnet nuget push $_.FullName --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
77+
}
78+
Get-ChildItem artifacts -Filter *.snupkg | ForEach-Object {
79+
dotnet nuget push $_.FullName --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
80+
}
7181
7282
- name: Upload published artifacts
7383
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)