Repository navigation
ci: publish through nuget.org trusted publishing - #115
Merged
Merged
Conversation
The org's SWNUGETKEY API key has expired, so every push to nuget.org now fails with 403. Trusted publishing trades the job's OIDC token for a one-hour key, so nothing stored can expire. nuget.org requires the token's job_workflow_ref to be in this repository, which the shared reusable workflow's isn't, so its jobs (version, dependabot gate, build, pack and push, tag) are written out here with the same shared actions, and the push logs in with NuGet/login using the NUGET_USER variable.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Why
The org's
SWNUGETKEYnuget.org API key has expired, so every publish from this repo now fails with403 (The specified API key has expired). SW-EfCoreExtensions hit it first: simplify9/SW-EfCoreExtensions#76.What
nuget-publish.ymlnow logs in withNuGet/login@v1(the job's OIDC token traded for a one-hour key, withuser: ${{ vars.NUGET_USER }}) and pushes with that key. Nothing stored can expire.Why the shared workflow can't stay: nuget.org takes the workflow file from the token's
job_workflow_ref, and requires it to be in the same repository as the trusted-publishing policy (NuGet/login#24).reusable-nuget-publish.ymllives insimplify9/.github. So its jobs are written out here using the same shared actions: version (determine-semver), Dependabot gate, build (and tests where they ran before), pack and push, then tag after a successful push. The version scheme, projects and push order are unchanged.Before merging
A nuget.org trusted-publishing policy for this repo:
The repository variable
NUGET_USERis set.