Skip to content

Commit

Permalink
Publish package to nuget.org when a version tag is created
Browse files Browse the repository at this point in the history
  • Loading branch information
josetr committed Feb 5, 2023
1 parent 4417dd9 commit 5715df5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
runs-on: windows-2019
needs: build
if: |
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.ref, 'nuget'))) ||
(github.event.pull_request.head.repo.full_name != github.repository && contains(github.event.pull_request.head.ref, 'nuget'))
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.ref, 'nuget') || startsWith(github.ref, 'refs/tags/v'))) ||
(github.event.pull_request.head.repo.full_name != github.repository && (contains(github.event.pull_request.head.ref, 'nuget') || startsWith(github.event.pull_request.head.ref, 'refs/tags/v')))
env:
DOTNET_NOLOGO: true
Expand Down Expand Up @@ -111,3 +111,9 @@ jobs:
run: |
cd artifacts
dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/mono/index.json" --skip-duplicate
- name: Publish package to nuget.org
if: startsWith(github.ref, 'refs/tags/v')
run: |
cd artifacts
dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate

0 comments on commit 5715df5

Please sign in to comment.