Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Beacon.Plugin/Beacon.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Drives the built DLL, the generated manifest, and the folder Dalamud loads it from. -->
<AssemblyName>Beacon</AssemblyName>
<RootNamespace>Beacon</RootNamespace>
<Version>0.1.7.0</Version>
<Version>0.1.8.0</Version>
<!-- The Dalamud SDK does not turn these on, and every service file wants System.Threading.Tasks. -->
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion tools/publish-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ try {
Copy-Item -LiteralPath 'src/Beacon.Plugin/bin/Release/Beacon/latest.zip' -Destination $destination -Force

$hash = Get-FileHash -LiteralPath $destination -Algorithm SHA256
Set-Content -LiteralPath "$destination.sha256" -Value "$($hash.Hash.ToLowerInvariant()) $([IO.Path]::GetFileName($destination))" -Encoding utf8NoBOM
# -Encoding utf8NoBOM is PowerShell 7 only, and a BOM in a checksum file breaks sha256sum -c.
$checksumLine = "$($hash.Hash.ToLowerInvariant()) $([IO.Path]::GetFileName($destination))"
[IO.File]::WriteAllText("$destination.sha256", $checksumLine + "`n", [Text.UTF8Encoding]::new($false))

Write-Host "Release package: $destination"
Write-Host "SHA-256: $($hash.Hash.ToLowerInvariant())"
Expand Down
25 changes: 23 additions & 2 deletions tools/smoke-server.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ param()
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

# Windows PowerShell 5.1 does not load System.Net.Http by default, and the release gate has to be
# runnable on whatever shell the release machine actually has rather than only on PowerShell 7.
if (-not ('System.Net.Http.HttpClient' -as [type])) {
Add-Type -AssemblyName System.Net.Http
}

$repoRoot = Split-Path -Parent $PSScriptRoot
$scratch = Join-Path ([System.IO.Path]::GetTempPath()) ("beacon-smoke-" + [guid]::NewGuid().ToString('N'))
$published = Join-Path $scratch 'server'
Expand All @@ -25,7 +31,15 @@ function Get-FreeLoopbackPort {
function Start-BeaconServer([int]$Port) {
$start = [System.Diagnostics.ProcessStartInfo]::new()
$start.FileName = 'dotnet'
$start.ArgumentList.Add((Join-Path $published 'Beacon.Server.dll'))
# ArgumentList is .NET Core only. On Windows PowerShell 5.1 the only way through is the quoted
# Arguments string, and the published path can contain spaces.
$serverDll = Join-Path $published 'Beacon.Server.dll'
if ($null -ne $start.PSObject.Properties['ArgumentList']) {
$start.ArgumentList.Add($serverDll)
}
else {
$start.Arguments = '"' + $serverDll + '"'
}
$start.WorkingDirectory = $published
$start.UseShellExecute = $false
$start.CreateNoWindow = $true
Expand All @@ -46,7 +60,14 @@ function Stop-BeaconServer($ServerProcess) {
return
}

$ServerProcess.Kill($true)
# Kill(entireProcessTree) is .NET Core only; 5.1 has the parameterless overload.
try {
$ServerProcess.Kill($true)
}
catch [System.Management.Automation.MethodException] {
$ServerProcess.Kill()
}

$ServerProcess.WaitForExit()
$ServerProcess.Dispose()
}
Expand Down
Loading