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

Merged
merged 4 commits into from
Nov 7, 2024
Merged

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 7, 2024

Copy link
Contributor

@Ndiritu Ndiritu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description was helpful 👍🏾

@andrueastman andrueastman merged commit 1bd3e43 into main Nov 7, 2024
207 checks passed
@andrueastman andrueastman deleted the shims branch November 7, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✔️
Development

Successfully merging this pull request may close these issues.

Sign all Kiota .exe files
2 participants