diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9d3662e..1423dad 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -35,8 +35,12 @@ jobs: with: name: melanzana-${{ steps.nbgv.outputs.SemVer2 }} path: nuget/ - - name: Publish NuGet packages to NuGet feed + - name: Publish NuGet packages to GitHub NuGet feed + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} run: | dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - dotnet nuget push "nuget/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" + dotnet nuget push "nuget/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" + - name: Publish NuGet packages to NuGet.org feed if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + run: | + dotnet nuget push "nuget/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json