Repository navigation
ci: publish to NuGet with trusted publishing - #105
Merged
Merged
Conversation
The NUGET_TOKEN API key expired, so 8.1.0 failed to publish with 403. NuGet/login exchanges the job's GitHub OIDC token for a one-hour API key, so no long-lived key is stored.
It only names the nuget.org account the short-lived key is issued for and grants nothing on its own.
1 of 3 tasks
🟢 Tier S · Ready to merge
The release workflow switches NuGet authentication from a stored API key to trusted publishing. It grants the job OIDC access, adds a pinned NuGet login action using the repository’s NUGET_USER variable, and passes the resulting short-lived key to the existing publish command.
📂 Walkthrough · 1
Reviewed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches the NuGet publish to trusted publishing:
NuGet/login(pinned to v1.2.0) exchanges the job's GitHub OIDC token for a one-hour NuGet API key, so no long-livedNUGET_TOKENis stored. The old key expired, which is why the 8.1.0 publish failed with 403.permissions:contents: read,id-token: writeNuGet/loginstep,userfrom theNUGET_USERrepository variable (the nuget.org profile name, not an email; it only names the account the key is issued for, so it is not a secret)dotnet nuget pushusessteps.login.outputs.NUGET_API_KEYBefore the next release, on nuget.org (signed in as a member of the
Appwriteaccount that owns the package): Trusted Publishing → add a policy owned byAppwritewith Repository Ownerappwrite, Repositorysdk-for-dotnet, Workflow Filepublish.yml, no environment. Then set theNUGET_USERrepository variable. Both are done.Related: appwrite/sdk-generator#1975