Last active
February 7, 2025 07:15
-
-
Save happyincent/9ae5cb3e573f6e45d0637d52b0734301 to your computer and use it in GitHub Desktop.
Add a SHA256 SFV checksum file after dotnet publish
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project> | |
<Target Name="PublishHash" AfterTargets="AfterPublish"> | |
<ItemGroup> | |
<FilesToHash Include="$(PublishDir)**" Exclude="$(PublishDir)*.sha256;" /> | |
</ItemGroup> | |
<GetFileHash Files="@(FilesToHash)" Algorithm="SHA256"> | |
<Output TaskParameter="Items" ItemName="Hashes" /> | |
</GetFileHash> | |
<WriteLinesToFile File="$(PublishDir)$(AssemblyName).sha256" Lines="@(Hashes->'%(FileHash) %(Identity)'->Replace($(PublishDir), ''))" Overwrite="true"/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment