File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 uses : actions/checkout@v4
2020 with :
2121 fetch-depth : 0
22+ fetch-tags : true
2223
2324 - name : Setup .NET
2425 uses : actions/setup-dotnet@v4
Original file line number Diff line number Diff line change 1717 uses : actions/checkout@v4
1818 with :
1919 fetch-depth : 0
20+ fetch-tags : true
2021
2122 - name : Setup .NET
2223 uses : actions/setup-dotnet@v4
@@ -145,15 +146,26 @@ jobs:
145146
146147 - name : Push package to NuGet
147148 if : steps.release_channel.outputs.channel != 'none'
149+ id : push_package
148150 shell : bash
149151 run : |
152+ set -o pipefail
153+
154+ push_output_file="$(mktemp)"
155+
150156 dotnet nuget push "/tmp/artifacts/blazor-hashrouting/package/release/Blazor.HashRouting.${VERSION}.nupkg" \
151157 --api-key "${{ secrets.NUGET_API_KEY }}" \
152158 --source "https://api.nuget.org/v3/index.json" \
153- --skip-duplicate
159+ --skip-duplicate 2>&1 | tee "${push_output_file}"
160+
161+ if grep -qi "already exists" "${push_output_file}"; then
162+ echo "pushed=false" >> $GITHUB_OUTPUT
163+ else
164+ echo "pushed=true" >> $GITHUB_OUTPUT
165+ fi
154166
155167 - name : Push symbols to NuGet
156- if : steps.release_channel.outputs.channel != 'none'
168+ if : steps.release_channel.outputs.channel != 'none' && steps.push_package.outputs.pushed == 'true'
157169 shell : bash
158170 run : |
159171 dotnet nuget push "/tmp/artifacts/blazor-hashrouting/package/release/Blazor.HashRouting.${VERSION}.snupkg" \
You can’t perform that action at this time.
0 commit comments