forked from Snowflake-Labs/sfgrantreport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZipReleases.ps1
29 lines (24 loc) · 1020 Bytes
/
ZipReleases.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
# Get 7Zip path
if ($PSVersionTable.Platform -eq "Win32NT")
{
# Windows
$zip = "C:\Program Files\7-Zip\7z.exe"
}
elseif (($PSVersionTable.Platform -eq "Unix") -and ($PSVersionTable.OS.Contains("Darwin") -eq $true))
{
# Mac
$zip = "~/Downloads/7z2107-mac/7zz"
}
# Get version from the project file
$projXML = [xml](Get-Content -Path .\Snowflake.GrantReport.csproj)
$version = $projXML.SelectNodes("Project/PropertyGroup/Version")."#text"
$version
cd "bin\Publish\win"
& $zip a "..\..\..\..\Releases\$version\SFGrantReport.win.$version.zip" '@..\..\..\ReleaseIncludes\listfile.win.txt'
cd "..\osx"
& $zip a "..\..\..\..\Releases\$version\SFGrantReport.osx.$version.zip" '@..\..\..\ReleaseIncludes\listfile.osx.txt'
cd "../osx-arm"
& $zip a "../../../../Releases/$version/SFGrantReport.osx-arm.$version.zip" '@../../../ReleaseIncludes/listfile.osx.txt'
cd "..\linux"
& $zip a "..\..\..\..\Releases\$version\SFGrantReport.linux.$version.zip" '@..\..\..\ReleaseIncludes\listfile.linux.txt'
cd "..\..\.."