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.
This commit is contained in:
sudacode committed 2026-11-23 00:20:03 -08:00
1 parent 18490c9d4f
commit 93045ebf9f
1 file changed
+4 -1
+4 -1
View File
@@ -108,6 +108,9 @@ function extractBuild() {
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'subminer-yomitan-')); const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'subminer-yomitan-'));
try { try {
if (process.platform === 'win32') { 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( run(
'powershell.exe', 'powershell.exe',
[ [
@@ -116,7 +119,7 @@ function extractBuild() {
'-ExecutionPolicy', '-ExecutionPolicy',
'Bypass', 'Bypass',
'-Command', '-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, repoRoot,
); );