-
Notifications
You must be signed in to change notification settings - Fork 20
/
publish.ps1
36 lines (31 loc) · 1008 Bytes
/
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
param (
[ValidateSet('Debug','Release')]
[string]$Configuration = 'Release',
[ValidateSet('win-x64','win10-x64')]
[string]$Runtime = 'win-x64',
[Parameter(Mandatory)]
[string]$Version,
[ValidateSet('quiet','minimal','normal','detailed','diagnostic')]
[string]$Verbosity = "minimal",
[switch]$UseR2R
)
$PublishDir = "publish"
if (Test-Path $PublishDir) { Remove-Item $PublishDir -Recurse -Verbose }
dotnet restore
dotnet publish `
-o $PublishDir `
-r $Runtime `
-c $Configuration `
-v $Verbosity `
/p:DebugType=none `
/p:DebugSymbols=false `
/p:SelfContained=true `
/p:PublishSingleFile=true `
/P:PublishReadyToRun=$UseR2R `
/p:PublishReadyToRunShowWarnings=$UseR2R `
/p:Version=$Version
Get-Item "$PublishDir\fs2ff.exe" |
Select-Object Name,
@{ Name = 'Version'; Expression = { $_.VersionInfo.ProductVersion }},
@{ Name = 'Size'; Expression = { "{0:f0} MB`r`n" -f ($_.Length / 1MB) }} |
Format-List