-
-
Notifications
You must be signed in to change notification settings - Fork 803
Use trusted publishing for NuGet #9090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ on: | |
| - "16.*" | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
|
|
@@ -15,6 +14,7 @@ jobs: | |
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: 📦 Checkout | ||
|
|
@@ -49,11 +49,17 @@ jobs: | |
| NitroApiClientId: ${{ secrets.NITRO_API_CLIENT_ID }} | ||
| NitroApiKey: ${{ secrets.NITRO_API_KEY }} | ||
|
|
||
| - name: NuGet login | ||
| uses: NuGet/login@v1 | ||
| id: login | ||
| with: | ||
| user: ${{ secrets.NUGET_USERNAME }} | ||
|
tobias-tengler marked this conversation as resolved.
|
||
|
|
||
| - name: 🚀 Push Packages to NuGet | ||
| run: | | ||
| ./build.cmd publish --skip | ||
| env: | ||
| NuGetApiKey: ${{ secrets.NUGETAPIKEY }} | ||
| NuGetApiKey: ${{ steps.login.outputs.NUGET_API_KEY }} | ||
|
||
|
|
||
| - name: 📤 Attach .nupkg assets to GitHub release | ||
| run: | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GitHub Action
NuGet/login@v1does not exist in the GitHub Actions marketplace. As of January 2025, there is no official NuGet login action provided by NuGet or GitHub.For trusted publishing with NuGet, you typically need to:
id-token: writepermission) directly with the NuGet APIdotnet nuget pushwith the--api-keyparameter set to the OIDC tokenThe correct approach would be to either: