File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 3434
3535 - name : Publish to NuGet
3636 if : github.event_name == 'push'
37- run : dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
37+ run : |
38+ set -e
39+ for pkg in ./nupkgs/*.nupkg; do
40+ echo "Pushing $pkg"
41+ output=$(dotnet nuget push "$pkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json 2>&1) && status=0 || status=$?
42+ if [ $status -eq 0 ]; then
43+ echo "Successfully pushed $pkg"
44+ elif echo "$output" | grep -q "Response status code does not indicate success: 409"; then
45+ echo "Package $pkg already exists on NuGet. Skipping."
46+ else
47+ echo "$output"
48+ echo "Failed to push $pkg for an unexpected reason."
49+ exit 1
50+ fi
51+ done
You can’t perform that action at this time.
0 commit comments