From 93045ebf9f5ad7ff20c3c92508f39fa418bd19c1 Mon Sep 17 00:00:00 2001 From: sudacode Date: Mon, 23 Nov 2026 00:20:03 -0800 Subject: [PATCH] fix(build): extract Yomitan on Windows without the Archive module PowerShell 7's PSModulePath makes powershell.exe load the PS7 Archive module, whose ExtractToDirectory overload is missing on .NET Framework, so Expand-Archive silently extracted nothing on the windows-latest runner. --- scripts/build-yomitan.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/build-yomitan.mjs b/scripts/build-yomitan.mjs index d9184d43..52c567bd 100644 --- a/scripts/build-yomitan.mjs +++ b/scripts/build-yomitan.mjs @@ -108,6 +108,9 @@ function extractBuild() { const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'subminer-yomitan-')); try { if (process.platform === 'win32') { + // Call .NET directly instead of Expand-Archive: under a pwsh CI step, PSModulePath + // makes Windows PowerShell load PowerShell 7's Archive module, whose + // ExtractToDirectory overload does not exist on .NET Framework. run( 'powershell.exe', [ @@ -116,7 +119,7 @@ function extractBuild() { '-ExecutionPolicy', 'Bypass', '-Command', - `Expand-Archive -LiteralPath '${escapePowerShellString(zipPath)}' -DestinationPath '${escapePowerShellString(tempDir)}' -Force`, + `$ErrorActionPreference = 'Stop'; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapePowerShellString(zipPath)}', '${escapePowerShellString(tempDir)}')`, ], repoRoot, );