Fix Windows runtime packaging

This commit is contained in:
Mohamed Boudra
2026-03-10 17:44:16 +07:00
parent f3338ee824
commit 2a0b0b9109
2 changed files with 19 additions and 2 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## 0.1.22 - 2026-03-10
### Fixed
- Fixed the Windows desktop release runtime builder to package managed-runtime workspaces without relying on a fragile `npm pack` shell invocation in GitHub Actions.
## 0.1.21 - 2026-03-10
### Improved
- Improved desktop release reliability by fixing the Windows managed-runtime build path during GitHub Actions releases.
@@ -196,10 +196,13 @@ function runCommand(command, args, options = {}) {
encoding: "utf8",
...options,
});
if (result.status !== 0) {
if (result.status !== 0 || result.error) {
throw new Error(
[
`Command failed: ${command} ${args.join(" ")}`,
result.error ? String(result.error) : null,
result.signal ? `signal: ${result.signal}` : null,
result.status != null ? `exit code: ${result.status}` : null,
result.stdout?.trim(),
result.stderr?.trim(),
]
@@ -245,7 +248,17 @@ async function ensureWorkspaceBuilds() {
async function packWorkspace(packageRoot, tarballRoot) {
await ensureDir(tarballRoot);
const result = runCommand("npm", ["pack", "--json", "--pack-destination", tarballRoot], {
const npmExecPath = process.env.npm_execpath;
if (!npmExecPath) {
throw new Error("Missing npm_execpath while building managed runtime.");
}
const result = runCommand(process.execPath, [
npmExecPath,
"pack",
"--json",
"--pack-destination",
tarballRoot,
], {
cwd: packageRoot,
});
const [{ filename }] = JSON.parse(result.stdout.trim());