Browse Source

Publish package to nuget.org when a version tag is created

pull/1718/head v1.0.45.22293
josetr 2 years ago
parent
commit
5715df5a72
  1. 10
      .github/workflows/main.yml

10
.github/workflows/main.yml

@ -73,8 +73,8 @@ jobs: @@ -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
@ -111,3 +111,9 @@ jobs: @@ -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

Loading…
Cancel
Save