forked from SteamRE/DepotDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-github-archiver.ps1
More file actions
54 lines (45 loc) · 1.65 KB
/
build-github-archiver.ps1
File metadata and controls
54 lines (45 loc) · 1.65 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env pwsh
# Build script for GitHubArchiver.Daemon
# Produces self-contained single-file executables for Windows and Linux
param(
[string]$Configuration = "Release",
[string]$OutputDir = "publish/GitHubArchiver.Daemon"
)
$ErrorActionPreference = "Stop"
$ProjectPath = "GitHubArchiver.Daemon/GitHubArchiver.Daemon.csproj"
# Clean output directory
if (Test-Path $OutputDir) {
Remove-Item -Recurse -Force $OutputDir
}
Write-Host "Building GitHubArchiver.Daemon..." -ForegroundColor Cyan
# Common publish arguments for minimal output
$commonArgs = @(
"--configuration", $Configuration,
"-p:PublishSingleFile=true",
"-p:SelfContained=true",
"-p:IncludeNativeLibrariesForSelfExtract=true",
"-p:EnableCompressionInSingleFile=true",
"-p:DebugType=none",
"-p:DebugSymbols=false"
)
# Build for Linux x64
Write-Host "`nPublishing for Linux x64..." -ForegroundColor Yellow
dotnet publish $ProjectPath `
--runtime linux-x64 `
--output "$OutputDir/linux-x64" `
@commonArgs
# Build for Windows x64
Write-Host "`nPublishing for Windows x64..." -ForegroundColor Yellow
dotnet publish $ProjectPath `
--runtime win-x64 `
--output "$OutputDir/win-x64" `
@commonArgs
Write-Host "`nBuild complete!" -ForegroundColor Green
Write-Host "Output locations:"
Write-Host " Linux: $OutputDir/linux-x64/"
Write-Host " Windows: $OutputDir/win-x64/"
# Show file sizes
Write-Host "`nOutput files:" -ForegroundColor Cyan
Get-ChildItem -Path $OutputDir -Recurse -File |
Select-Object @{N='Path';E={$_.FullName.Replace((Get-Location).Path + '\', '')}}, @{N='Size (MB)';E={[math]::Round($_.Length/1MB, 2)}} |
Format-Table -AutoSize