Skip to content

ci: publish through nuget.org trusted publishing - #115

Merged
omarghatasheh merged 1 commit into
mainfrom
muhannad/nuget-trusted-publishing
Nov 10, 2026
Merged

omarghatasheh merged 1 commit into
mainfrom
muhannad/nuget-trusted-publishing

Conversation

@mmalkhatib

Copy link
Copy Markdown
Contributor

Why

The org's SWNUGETKEY nuget.org API key has expired, so every publish from this repo now fails with 403 (The specified API key has expired). SW-EfCoreExtensions hit it first: simplify9/SW-EfCoreExtensions#76.

What

nuget-publish.yml now logs in with NuGet/login@v1 (the job's OIDC token traded for a one-hour key, with user: ${{ 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.yml lives in simplify9/.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:

  • Policy owner: simplify9
  • Repository owner: simplify9
  • Repository: SW-CloudFiles (the current name; renamed repos must use the new one)
  • Workflow: nuget-publish.yml

The repository variable NUGET_USER is set.

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.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 26b9d881-9da2-4d5c-992a-0eafe4dea78f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@omarghatasheh
omarghatasheh merged commit 537e011 into main Nov 10, 2026
5 checks passed
@omarghatasheh
omarghatasheh deleted the muhannad/nuget-trusted-publishing branch November 10, 2026 15:40
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.

2 participants