-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.ps1
31 lines (30 loc) · 1.1 KB
/
release.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
# usage: release.ps1 -Version=<version>
Param
(
[parameter(Position=0,Mandatory=$true)]
[String]
$Version
)
$operatingsystem = @{
Windows = "win-x64"
Linux = "linux-x64"
MacOS = "osx-x64"
}
# create output folder if it doesn't exist
$outputFolder = "release"
if(Test-Path -Path $outputFolder)
{
# remove folder if it exists already for new release
Remove-Item -Force -Recurse -Path .\$outputFolder\
}
New-Item -ItemType Directory -Force -Path .\$outputFolder\
$operatingsystem.GetEnumerator() | ForEach-Object{
$rid = $_.Value;
$name = $_.Key;
# CLI
dotnet publish .\CLI\CLI.csproj --runtime $rid --configuration Release --self-contained=true
Compress-Archive -Path .\CLI\bin\Release\net8.0\$rid\publish\* -DestinationPath .\$outputFolder\VelvetBeautifier.CLI.$Version.$name.zip
# GUI
dotnet publish .\GUI\GUI.csproj --runtime $rid --configuration Release --self-contained=true
Compress-Archive -Path .\GUI\bin\Release\net8.0\$rid\publish\* -DestinationPath .\$outputFolder\VelvetBeautifier.GUI.$Version.$name.zip
}