diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ead1f1..c7d2c3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,10 +44,29 @@ jobs: name: nupkg path: artifacts/* + publish: + if: startsWith(github.ref, 'refs/tags/v') + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Download package artifacts + uses: actions/download-artifact@v8 + with: + name: nupkg + path: artifacts + + - name: NuGet login + uses: NuGet/login@v1 + id: login + with: + user: ericstj + - name: Publish to NuGet.org - if: startsWith(github.ref, 'refs/tags/v') run: > dotnet nuget push "artifacts/*.nupkg" - --api-key "${{ secrets.NUGET_API_KEY }}" + --api-key "${{ steps.login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate