-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathzip-packaging.ps1
More file actions
22 lines (17 loc) · 861 Bytes
/
zip-packaging.ps1
File metadata and controls
22 lines (17 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$solutiondir = $PSScriptRoot
$version_grep = Select-String -Path $solutiondir\common\generated\version.h -Pattern ' SEMVER \"(.+)\"$'
$version = $version_grep.Matches.Groups[1].Value
if($version -eq $null){
Write-Output "Unknown version. Please check version.h ."
return
}
$distname = "SimpleCom-$version"
$destdir = "$solutiondir\dist\$distname"
Remove-Item -Recurse -Force $destdir*
New-Item $destdir -itemType Directory
Copy-Item $solutiondir\x64\Release\SimpleCom.exe $destdir
Copy-Item $solutiondir\README.md $destdir
Copy-Item $solutiondir\SECURITY.md $destdir
Copy-Item $solutiondir\fragments.json $destdir
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
[System.IO.Compression.ZipFile]::CreateFromDirectory($destdir, "$solutiondir\dist\$distname.zip", [System.IO.Compression.CompressionLevel]::Optimal, $true)