Skip to content

ci(dotnet): publish to NuGet with trusted publishing - #1974

Merged
ChiragAgg5k merged 2 commits into
mainfrom
ci/dotnet-nuget-trusted-publishing
Oct 6, 2026
Merged

ChiragAgg5k merged 2 commits into
mainfrom
ci/dotnet-nuget-trusted-publishing

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

The .NET SDK template's publish workflow now uses NuGet trusted publishing instead of the NUGET_TOKEN secret, matching appwrite/sdk-for-dotnet#105. Without this, the next generated release would put the expired-key workflow back.

The rendered template is byte-identical to the workflow in that PR. NuGet/login is pinned to v1.2.0 (8d196754), like the other actions in the template.

The NuGet username is read from the NUGET_USER repository variable rather than a secret: it only names the nuget.org account the short-lived key is issued for.

Closes #1975

Mirrors appwrite/sdk-for-dotnet: NuGet/login exchanges the job's GitHub OIDC token for a short-lived API key instead of the NUGET_TOKEN secret, so regenerating the SDK keeps trusted publishing.
@hansi-codes

hansi-codes Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No defects found in the incremental change to the NuGet username source.

Updates the generated .NET release workflow to use NuGet trusted publishing instead of the long-lived NUGET_TOKEN secret. The publish job requests OIDC permissions, authenticates through a pinned NuGet/login action using the NUGET_USER repository variable, and pushes packages with the resulting short-lived API key.

Latest changes: The newest commit reads the NuGet username from vars.NUGET_USER instead of secrets.NUGET_USER.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 1
File Change
templates/dotnet/.github/workflows/publish.yml.twig Adds OIDC permissions and pinned NuGet login, reads the username from a repository variable, and uses the login output for publishing.

Reviewed the commits since adbc932 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

It only names the nuget.org account the short-lived key is issued for and grants nothing on its own.
@ChiragAgg5k ChiragAgg5k self-assigned this Oct 6, 2026
@ChiragAgg5k
ChiragAgg5k merged commit 0930e66 into main Oct 6, 2026
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish the .NET SDK to NuGet with trusted publishing

1 participant