Skip to content

Commit 8bf794d

Browse files
committed
update to new recommended nuget publishing flow
1 parent 74dcf64 commit 8bf794d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/CI.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070
run: npm test
7171

7272
build-and-publish-nuget:
73+
permissions:
74+
id-token: write
7375
needs: [ XUnit, PHPUnit, Jest ]
7476
runs-on: ubuntu-latest
7577
timeout-minutes: 15
@@ -98,8 +100,12 @@ jobs:
98100

99101
- name: Pack
100102
run: dotnet pack include/c#/10 --configuration Release --no-build --output .
103+
104+
- name: Login
105+
uses: NuGet/login@v1
106+
id: login
107+
with:
108+
user: ${{ secrets.NUGET_USER_NAME }}
101109

102110
- name: Push
103-
run: dotnet nuget push "*.${VERSION}.nupkg" -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json
104-
env:
105-
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
111+
run: dotnet nuget push "*.${VERSION}.nupkg" -k ${{ steps.login.outputs.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)