Skip to content

Commit b73c964

Browse files
Updates NuGet publishing to use Trusted Publishing (dotnet#1662)
1 parent d0da2d7 commit b73c964

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/create-release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ jobs:
199199
runs-on: ubuntu-latest
200200
environment:
201201
name: gh_releases
202+
permissions:
203+
id-token: write
202204
steps:
203205
- name: Checkout code
204206
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -216,10 +218,15 @@ jobs:
216218
-p:PackageVersion=${{ steps.get_version.outputs.VERSION }}
217219
-p:Version=${{ steps.get_version.outputs.VERSION }}
218220
-o ./nupkg
221+
- name: NuGet login
222+
id: login
223+
uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0
224+
with:
225+
user: ${{ secrets.NUGET_USER }}
219226
- name: Push to NuGet
220227
run: >
221228
dotnet nuget push ./nupkg/DevProxy.Abstractions.${{ steps.get_version.outputs.VERSION }}.nupkg
222-
--api-key ${{ secrets.NUGET_API_KEY }}
229+
--api-key ${{ steps.login.outputs.NUGET_API_KEY }}
223230
--source https://api.nuget.org/v3/index.json
224231
--skip-duplicate
225232
create_release:

0 commit comments

Comments
 (0)