feat(release): add cross-platform packaging

Add target-aware engine provisioning, platform package configs, and CI/release verification for macOS arm64, Windows x64, and Linux AppImage.
This commit is contained in:
NimBold
2026-06-23 21:26:51 +03:30
parent 0e3118ec2c
commit f603b74a99
41 changed files with 1889 additions and 382 deletions
+45
View File
@@ -0,0 +1,45 @@
import { useEffect, useState } from 'react';
import type { PlatformInfo } from '../bindings/PlatformInfo';
import { invokeCommand as invoke } from '../ipc';
const fallback: PlatformInfo = {
os: 'unknown',
arch: 'unknown',
targetTriple: 'unknown'
};
let cached: PlatformInfo | null = null;
let pending: Promise<PlatformInfo> | null = null;
export const getPlatformInfo = (): Promise<PlatformInfo> => {
if (cached) return Promise.resolve(cached);
if (!pending) {
pending = invoke('get_platform_info')
.then(info => {
cached = info;
return info;
})
.finally(() => {
pending = null;
});
}
return pending;
};
export const usePlatformInfo = () => {
const [platform, setPlatform] = useState<PlatformInfo>(cached ?? fallback);
useEffect(() => {
let active = true;
void getPlatformInfo()
.then(info => {
if (active) setPlatform(info);
})
.catch(() => undefined);
return () => {
active = false;
};
}, []);
return platform;
};