You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/ci/Publish.ps1

45 lines
922 B

[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $Runtime,
[string] $OutputDir,
[string] $Configuration = "Release",
[string] $BuildPath = "src\Recyclarr.Cli",
[switch] $NoSingleFile
)
$ErrorActionPreference = "Stop"
if (-not $NoSingleFile) {
$selfContained = "true"
$singleFileArgs = @(
"-p:PublishSingleFile=true"
"-p:IncludeNativeLibrariesForSelfExtract=true"
"-p:PublishReadyToRunComposite=true"
"-p:PublishReadyToRunShowWarnings=true"
"-p:EnableCompressionInSingleFile=true"
)
}
else {
$selfContained = "false"
}
if (-not $OutputDir) {
$OutputDir = "publish\$Runtime"
}
dotnet publish $BuildPath `
--output $OutputDir `
--configuration $Configuration `
--runtime $Runtime `
--self-contained $selfContained `
$singleFileArgs
if ($LASTEXITCODE -ne 0) {
throw "dotnet publish failed"
}