Sign on Linux instead of Windows - #151
Merged
Merged
Conversation
The signing job existed on windows-latest for one reason: `dotnet sign` supports Trusted Signing but cannot run anywhere else, because its backend ships a native signtool Dlib with MFC/MSVC dependencies. `dotnet nuget sign` runs anywhere but only with a local private key, which a key in Trusted Signing does not have. sign-universal closes that gap - it is NuGet's own signing pipeline with the private-key operation redirected to Trusted Signing over HTTPS - so the job moves to ubuntu-latest and drops the node install and the act path shim along with Windows. Nothing else in the pipeline changes. The job keeps its name, its inputs and its outputs, publish still consumes packages-signed, and the signatures produced are ordinary NuGet author signatures: a package signed either way is indistinguishable to consumers. Two notes on the new step. --trust-signing-root is required on Linux and its absence is not obvious: Trusted Signing issues from a root Linux trust stores do not carry, and NuGet refuses to sign against a chain it cannot build, so without the flag the step fails with only "Certificate chain validation failed". The tool version is pinned, because the thing signing a release should not change unless someone chooses to change it. Verified before proposing: the exact command in this job, run against Zomp.SyncMethodGenerator 2.0.38 on Linux with the real credentials, signs and timestamps it and `dotnet nuget verify --all` gives it a clean pass.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #151 +/- ##
=======================================
Coverage 93.82% 93.82%
=======================================
Files 9 9
Lines 1522 1522
Branches 352 352
=======================================
Hits 1428 1428
Misses 25 25
Partials 69 69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Moves the
signjob fromwindows-latesttoubuntu-latest.The Windows runner was there for one reason:
dotnet signsupports Trusted Signing butcannot run anywhere else - its backend,
Microsoft.Trusted.Signing.Client, ships a nativesigntool Dlib with MFC/MSVC dependencies.
dotnet nuget signruns anywhere but only with alocal private key, which a key in Trusted Signing does not have.
sign-universal closes that gap: NuGet's own
signing pipeline with the private-key operation redirected to Trusted Signing over HTTPS.
Nothing else changes. The job keeps its name, inputs and outputs,
publishstillconsumes
packages-signed, and the signatures are ordinary NuGet author signatures - apackage signed either way is indistinguishable to consumers. The node install and the
nektos/act path shim go away with Windows.
Verified before proposing
The exact command in this job, run against
Zomp.SyncMethodGenerator 2.0.38on Linux withthe real credentials:
Two things worth knowing
--trust-signing-rootis required on Linux and its absence is not obvious. TrustedSigning issues from Microsoft Identity Verification Root CA 2020, which Linux trust
stores do not carry, and NuGet validates the signing certificate's chain before it will
sign. Without the flag the step fails with only
Certificate chain validation failed. Theroot is installed for that user alone, taken from the chain the signing service itself
returned.
The tool version is pinned. The thing signing a release should not change unless
someone chooses to change it.
What this PR cannot prove
The
SignandVerify signaturesteps are gated ongithub.ref == 'refs/heads/master',so they do not run here - CI will only show that the job's structure is sound and the tool
installs. Signing itself first executes on the next push to master. It fails loudly rather
than silently if anything is wrong: the verify step gates the artifact while it can still
be thrown away.
Rolling back is reverting this commit.