diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 398814b..a33c9d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -97,7 +97,8 @@ jobs: $tmp = Join-Path $env:RUNNER_TEMP ("feynman-smoke-" + [guid]::NewGuid().ToString("N")) New-Item -ItemType Directory -Path $tmp | Out-Null Expand-Archive -LiteralPath "dist/release/feynman-$version-win32-x64.zip" -DestinationPath $tmp -Force - & "$tmp/feynman-$version-win32-x64/feynman.cmd" --help | Select-Object -First 20 + $bundleRoot = Join-Path $tmp "feynman-$version-win32-x64" + & (Join-Path $bundleRoot "feynman.cmd") --help | Select-Object -First 20 - uses: actions/upload-artifact@v4 with: name: native-${{ matrix.id }} diff --git a/scripts/build-native-bundle.mjs b/scripts/build-native-bundle.mjs index abd4275..2b94ed5 100644 --- a/scripts/build-native-bundle.mjs +++ b/scripts/build-native-bundle.mjs @@ -277,10 +277,12 @@ function packBundle(bundleRoot, target, outDir) { if (target.bundleExtension === "zip") { if (process.platform === "win32") { + const bundleDir = dirname(bundleRoot).replace(/'/g, "''"); + const bundleName = basename(bundleRoot).replace(/'/g, "''"); run("powershell", [ "-NoProfile", "-Command", - `Compress-Archive -Path '${bundleRoot.replace(/'/g, "''")}\\*' -DestinationPath '${archivePath.replace(/'/g, "''")}' -Force`, + `Push-Location '${bundleDir}'; Compress-Archive -Path '${bundleName}' -DestinationPath '${archivePath.replace(/'/g, "''")}' -Force; Pop-Location`, ]); } else { run("zip", ["-qr", archivePath, basename(bundleRoot)], { cwd: resolve(bundleRoot, "..") });