Skip to content

Commit 8123a50

Browse files
authored
Update NuGet push process with OIDC login
1 parent d19bea3 commit 8123a50

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/dotnetcore.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ jobs:
6464
- name: Pack MerQure.Tools
6565
run: dotnet pack src\MerQure.Tools\MerQure.Tools.csproj --configuration Release -o artifacts -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
6666

67-
- name: Nuget org push
68-
if: startsWith(github.ref, 'refs/tags/')
69-
run: dotnet nuget push "artifacts/**/*.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json -k ${{ secrets.GLOBAL_NUGET_PUBLISH }}
70-
env:
71-
NUGET_PUBLISH: ${{ secrets.NUGET_PUBLISH }}
67+
# https://learn.microsoft.com/fr-fr/nuget/nuget-org/trusted-publishing
68+
- name: NuGet login (OIDC → temp API key)
69+
uses: NuGet/login@v1
70+
id: login
71+
with:
72+
user: ${{ secrets.NUGET_USER }}
73+
74+
# Push the package
75+
- name: NuGet push
76+
run: dotnet nuget push "artifacts/**/*.nupkg" --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{steps.login.outputs.NUGET_API_KEY}}
7277

0 commit comments

Comments
 (0)