-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpublish-tools.ps1
39 lines (31 loc) · 1.13 KB
/
publish-tools.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$tools = @(
"dnzunzip",
"dnzgzip",
"dnzzip",
"dnzbzip2"
)
# Command to execute
$command = "dotnet --% publish Tools/{0}/{0}.csproj " +
" -c Release -r win-x64 -o ./dotnetzip-tools " +
" /p:PublishSingleFile=true " +
" /p:CopyOutputSymbolsToPublishDirectory=false" +
" /p:SkipCopyingSymbolsToOutputDirectory=true" +
" --self-contained false "
foreach ($tool in $tools) {
$commandToExecute = $command -f $tool
Write-Host "Publishing: $tool"
try {
Invoke-Expression -Command "$commandToExecute" | Out-Host
}
catch {
Write-Error "Error executing command '$commandToExecute': $_"
}
}
$version = (Select-XML -path Zip\Zip.csproj -xpath "/Project/PropertyGroup/Version/text()").node.Value
$outputFilename = "dotnetzip-tools-$version.zip"
write-host "zip: $outputFilename"
#Compress-Archive -Path "dotnetzip-tools" -DestinationPath $outputFilename
.\dotnetzip-tools\dnzzip.exe $outputFilename -D dotnetzip-tools -E "name = *.exe"
$sha256 = Get-FileHash -Algorithm SHA256 -Path $outputFilename
write-host "Hash: $($sha256.hash)" # Stupidest syntax ever
Write-Host "Finished processing."