forked from microsoft/msquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-quictrace.ps1
51 lines (34 loc) · 1.63 KB
/
publish-quictrace.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
48
49
50
51
<#
.SYNOPSIS
.EXAMPLE
public-quictrace.ps1
#>
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
$RIDs = @("win-x64", "linux-x64", "osx-x64")
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent
$ToolDir = Join-Path $RootDir "src/plugins/trace/exe"
$BinFolder = Join-Path $ToolDir "bin"
$RootOutputFolder = Join-Path $RootDir "artifacts/bin/quictrace/published"
foreach ($RID in $RIDs) {
# Clear out bin folder
if (Test-Path $BinFolder) { Remove-Item $BinFolder -Recurse -Force | Out-Null }
$ExeName = "QuicTrace"
if ($RID.Contains("win")) {
$ExeName = "QuicTrace.exe"
}
$FullOutputFile = Join-Path $BinFolder "Release/net6.0/$RID/publish/$ExeName"
# Publish Non Trimmed
dotnet publish $ToolDir -r $RID -c Release -p:PublishSingleFile=true --self-contained true -p:EnableCompressionInSingleFile=true
$ArtifactFolder = Join-Path $RootOutputFolder $RID
if (!(Test-Path $ArtifactFolder)) { New-Item -Path $ArtifactFolder -ItemType Directory -Force | Out-Null }
Copy-Item $FullOutputFile $ArtifactFolder
# Clear out bin folder
if (Test-Path $BinFolder) { Remove-Item $BinFolder -Recurse -Force | Out-Null }
# Publish Trimmed
dotnet publish $ToolDir -r $RID -c Release -p:PublishSingleFile=true --self-contained true -p:EnableCompressionInSingleFile=true -p:PublishTrimmed=true
$TrimmedArtifactFolder = Join-Path $ArtifactFolder "trimmed"
if (!(Test-Path $TrimmedArtifactFolder)) { New-Item -Path $TrimmedArtifactFolder -ItemType Directory -Force | Out-Null }
Copy-Item $FullOutputFile $TrimmedArtifactFolder
}