From 57f8a2eaf5eddc9b47ff5bc1f8c71a7844f6cbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Semer=C3=A1k?= Date: Wed, 6 Mar 2024 11:43:52 +0100 Subject: [PATCH] OPL-12294: Prevent continuing nuget pushing when any of the pushes fails (use bash). --- .github/workflows/ci-cd.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 066746f..3837a69 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -102,8 +102,10 @@ jobs: # Use --skip-duplicate to prevent errors if a package with the same version already exists. # If you retry a failed workflow, already published packages will be skipped without error. - name: Publish NuGet package + shell: bash run: | set -e - foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { - dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate - } \ No newline at end of file + for file in $(find "${{ env.NuGetDirectory }}" -name '*.nupkg') + do + dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate + done \ No newline at end of file