Files
cneicy 78ccae3e07
Publish UPM package / publish (push) Failing after 1s
chore: initialize standalone UPM package
2026-08-26 02:50:31 +08:00

33 lines
912 B
Plaintext

param(
[string]$Configuration = "Release",
[string]$ModsDir = ""
)
$ErrorActionPreference = "Stop"
$projectPath = Join-Path $PSScriptRoot "__PROJECT_NAME__.csproj"
dotnet build $projectPath -c $Configuration /nr:false
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
$artifactDir = Join-Path $PSScriptRoot ("artifacts\" + $Configuration)
$dllPath = Join-Path $artifactDir "__PROJECT_NAME__.dll"
Write-Host "Build completed: $dllPath"
if ([string]::IsNullOrWhiteSpace($ModsDir)) {
return
}
New-Item -ItemType Directory -Force -Path $ModsDir | Out-Null
Copy-Item -LiteralPath $dllPath -Destination (Join-Path $ModsDir "__PROJECT_NAME__.dll") -Force
$pdbPath = Join-Path $artifactDir "__PROJECT_NAME__.pdb"
if (Test-Path -LiteralPath $pdbPath) {
Copy-Item -LiteralPath $pdbPath -Destination (Join-Path $ModsDir "__PROJECT_NAME__.pdb") -Force
}
Write-Host "Copied artifacts to: $ModsDir"