Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unsigned kiota.exe file when installed as dotnet tool. #5730

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andrueastman
Copy link
Member

@andrueastman andrueastman commented Nov 5, 2024

Fixes #5650

According to the docs at https://github.com/dotnet/sdk/blob/main/documentation/general/signing-global-tool-packages.md,
a shim is created in target machine by dotnet in scenarios where the PackAsToolShimRuntimeIdentifiers tag is not defined in the csproj. This ends up showing as an unsigned binary as it is created at the time of installation.

This PR adds as script to dynamically add the attribute so that the shim is created during dotnet build in the release pipeline so that it signed together with the artifacts.

This has been validated by installing the tool locally as well as inspecting the artifacts in this pipeline run.

https://dev.azure.com/microsoftgraph/Graph%20Developer%20Experiences/_build/results?buildId=169565&view=results

image

Notes
We could have added this directly to the csproj. However, this causes build errors for the project when we attempt to build/publish the project as an executable with a runtime idenfier and not a dotnet tool. So this script is intended to run only for scenarios where we want to publish the dotnet tool.

@andrueastman andrueastman marked this pull request as ready for review November 5, 2024 14:29
@andrueastman andrueastman requested a review from a team as a code owner November 5, 2024 14:29
Copy link

sonarcloud bot commented Nov 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Sign all Kiota .exe files
1 participant