From 9eb63debcd0d5f7f0cfe83b3d554bdda8fb05e61 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 23 Sep 2021 17:31:57 -0700 Subject: [PATCH] Add sha256 hashes to release (#16147) * Add sha256 hashes to release * Update tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml --- .../templates/release-CreateGitHubDraft.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml index 3b316e84cb..4e3e8e998a 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-CreateGitHubDraft.yml @@ -16,6 +16,17 @@ steps: git clone https://$(AzureDevOpsPat)@mscodehub.visualstudio.com/PowerShellCore/_git/Internal-PowerShellTeam-Tools '$(Pipeline.Workspace)/tools' displayName: Clone Internal-Tools repository +- pwsh: | + $Path = "$(System.ArtifactsDirectory)" + $OutputPath = Join-Path $Path ‘hashes.sha256’ + $null = New-Item $OutputPath -ItemType File -Force + foreach ($file in Get-ChildItem -Path $Path -File ){ + Get-FileHash -Algorithm SHA256 -Path $file | + ForEach-Object { "$($_.Hash) *$($file.Name)" } | + Out-File -Path $OutputPath -Append + } + displayName: Add sha256 hashes + - pwsh: | Import-module '$(Pipeline.Workspace)/tools/Scripts/GitHubRelease.psm1' Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description '<-- Update Me -->' -User PowerShell -Repository PowerShell -PackageFolder $(System.ArtifactsDirectory) -Token $(GitHubReleasePat)