Skip to content

Commit 9c31aa1

Browse files
committed
Setup NuGet Trusted Publishing
1 parent ce21757 commit 9c31aa1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ jobs:
225225
permissions:
226226
packages: write
227227
contents: write
228+
id-token: write
228229
steps:
229230
- name: Tune GitHub-hosted runner network
230231
uses: smorimoto/tune-github-hosted-runner-network@v1
@@ -243,6 +244,12 @@ jobs:
243244
run: |
244245
dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
245246
dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.FEEDZ_IO_API_KEY }}' --source 'feedz-io' --skip-duplicate
247+
- name: NuGet login
248+
if: ${{ github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') }}
249+
uses: NuGet/login@v1
250+
id: login
251+
with:
252+
user: ${{ secrets.NUGET_USER }}
246253
- name: Publish to NuGet
247254
if: ${{ github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') }}
248-
run: dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ secrets.NUGET_ORG_API_KEY }}' --source 'nuget.org' --skip-duplicate
255+
run: dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --api-key '${{ steps.login.outputs.NUGET_API_KEY }}' --source 'nuget.org' --skip-duplicate

0 commit comments

Comments
 (0)