Skip to content

Instantly share code, notes, and snippets.

@happyincent
Last active February 2, 2024 07:58
Show Gist options
  • Save happyincent/9ae5cb3e573f6e45d0637d52b0734301 to your computer and use it in GitHub Desktop.
Save happyincent/9ae5cb3e573f6e45d0637d52b0734301 to your computer and use it in GitHub Desktop.
<?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