The global tool for Windows.x64 is created using dotnet pack so that shim can be generated during the build for signing.
The tool uses a new csproj with added properties for generating the shim, we added the build to fxdependent stage.
The way the build works is a bit tricky as when it is built, we cannot add the modules that come from gallery.
We have to use dotnet pack to build the nupkg and then expand it as a zip.
After expanding we restore the signed files for the modules from the gallery.
We also delete content and contentFiles folder which are not necessary.
After that, we repack using Compress-Archive and rename it back to a nupkg.
PR Context
dotnet-sdk images show that the exe is unsigned and fails compliance requirements.
If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
PR Summary
Fixes https://github.com/PowerShell/PowerShell/issues/20557
The global tool for Windows.x64 is created using dotnet pack so that shim can be generated during the build for signing. The tool uses a new csproj with added properties for generating the shim, we added the build to fxdependent stage.
More details about shim are documented here: https://github.com/dotnet/sdk/blob/main/documentation/general/signing-global-tool-packages.md
The way the build works is a bit tricky as when it is built, we cannot add the modules that come from gallery. We have to use
dotnet pack
to build the nupkg and then expand it as a zip. After expanding we restore the signed files for the modules from the gallery. We also deletecontent
andcontentFiles
folder which are not necessary. After that, we repack using Compress-Archive and rename it back to a nupkg.PR Context
dotnet-sdk images show that the exe is unsigned and fails compliance requirements.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.