-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-all.ps1
More file actions
40 lines (30 loc) Β· 1.09 KB
/
publish-all.ps1
File metadata and controls
40 lines (30 loc) Β· 1.09 KB
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
40
# publish-all.ps1
# Runtimes
$runtimes = @("win-x64", "linux-x64", "osx-x64")
# Configurations
$configuration = "Release"
$selfContained = "true"
$projectPath = "AutoDoc.csproj"
$desktopPath = [Environment]::GetFolderPath("Desktop")
$outputBase = Join-Path $desktopPath "AutoDocBuilds"
# Create folder at Desktop
if (-Not (Test-Path $outputBase)) {
New-Item -ItemType Directory -Path $outputBase | Out-Null
}
foreach ($rid in $runtimes) {
Write-Host "π¨ Publishing for $rid..."
# Create Folders
$publishDir = Join-Path $outputBase "publish-$rid"
$zipFile = Join-Path $outputBase "AutoDoc-$rid.zip"
# Remove last Folders if exists
if (Test-Path $publishDir) {
Remove-Item $publishDir
Remove-Item $zipFile
}
# Publish
dotnet publish $projectPath -c $configuration -r $rid --self-contained $selfContained -o $publishDir
# Compress only publish folder
Compress-Archive -Path (Join-Path $publishDir "*") -DestinationPath $zipFile
Write-Host "β
Generated: $zipFile"
}
Write-Host "π All builds were done. Look at: $outputBase"