Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybibikov committed Apr 16, 2024
2 parents fdd5841 + 8d31234 commit f6dbd76
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
${{ steps.process-trx.outputs.test-results-file-path }}
retention-days: 90

build-and-publish:
create_nuget:
needs: integration-tests
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && success()
Expand All @@ -110,6 +110,39 @@ jobs:
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

validate_nuget:
runs-on: ubuntu-latest
needs: [ create_nuget, integration-tests ]
steps:
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4

- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Install nuget validator
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global

deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
# You can update this logic if you want to manage releases differently
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ validate_nuget, integration-tests ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET Core
uses: actions/setup-dotnet@v4

- name: Publish NuGet package
run: |
for file in $(find ${NuGetDirectory} -name "*.nupkg")
Expand Down

0 comments on commit f6dbd76

Please sign in to comment.