Skip to content

Commit bece4e0

Browse files
committed
Update pipelines to include tags
1 parent 44a2d85 commit bece4e0

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
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

.github/workflows/release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
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" \

0 commit comments

Comments
 (0)