forked from tpill90/battlenet-lancache-prefill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.ps1
47 lines (39 loc) · 1.77 KB
/
publish.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Set-Location $PSScriptRoot
$ErrorActionPreference = "Stop"
Remove-Item publish -Recurse -Force -ErrorAction SilentlyContinue
# Windows publish
foreach($runtime in @("win-x64"))
{
Write-Host "Publishing $runtime" -ForegroundColor Cyan
dotnet publish .\BattleNetPrefill\BattleNetPrefill.csproj `
-o publish/BattleNetPrefill-$runtime `
-c Release `
--runtime $runtime `
--self-contained true `
/p:PublishSingleFile=true `
/p:PublishReadyToRun=true `
/p:PublishTrimmed=true
Compress-Archive -path publish/BattleNetPrefill-$runtime publish/$runtime.zip
$folderSize = "{0:N2} MB" -f((Get-ChildItem publish/BattleNetPrefill-$runtime | Measure-Object -Property Length -sum).sum / 1Mb)
Write-Host "Published file size : " -NoNewline
Write-Host -ForegroundColor Cyan $folderSize
$zipSize = "{0:N2} MB" -f((Get-ChildItem publish/$runtime.zip | Measure-Object -Property Length -sum).sum / 1Mb)
Write-Host "Published zip size : " -NoNewline
Write-Host -ForegroundColor Cyan $zipSize
}
# Doing linux and osx separatly, they don't support ReadyToRun
foreach($runtime in @("linux-x64", "osx-x64"))
{
Write-Host "\n\nPublishing $runtime" -ForegroundColor Cyan
dotnet publish .\BattleNetPrefill\BattleNetPrefill.csproj `
-o publish/BattleNetPrefill-$runtime `
-c Release `
--runtime $runtime `
--self-contained true `
/p:PublishSingleFile=true `
/p:PublishTrimmed=true
$folderSize = "{0:N2} MB" -f((Get-ChildItem publish/BattleNetPrefill-$runtime | Measure-Object -Property Length -sum).sum / 1Mb)
Write-Host "Published file size : " -NoNewline
Write-Host -ForegroundColor Cyan $folderSize
Compress-Archive -path publish/BattleNetPrefill-$runtime publish/$runtime.zip
}