Files
aryx/scripts/releaseTarget.ts
T
David KayaandCopilot f838d2ac15 feat: add native platform installers for Windows, macOS, and Linux
Replace zip/tar archive distribution with platform-native installers:

- Windows: NSIS installer (.exe) with per-user install to
  %LOCALAPPDATA%\Programs\Aryx, Start Menu and Desktop shortcuts,
  Add/Remove Programs registration, and silent install support
- macOS: DMG disk image (.dmg) with drag-to-Applications experience
  via create-dmg
- Linux: Debian package (.deb) with /opt/aryx installation,
  /usr/bin/aryx symlink, desktop entry, hicolor icons, and
  libsecret-1-0 dependency declaration

Add scripts/create-installer.ts as the platform-dispatching entry
point. Update CI workflow to produce native installers instead of
archives. Add installerAssetName to ReleaseTarget interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-26 13:06:50 +01:00

88 lines
2.7 KiB
TypeScript

export const productName = 'Aryx';
export const macBundleIdentifier = 'com.davidkaya.aryx';
type SupportedPlatform = 'win32' | 'darwin' | 'linux';
type SupportedArch = 'x64' | 'arm64';
export interface ReleaseTarget {
readonly platform: SupportedPlatform;
readonly arch: SupportedArch;
readonly platformLabel: 'windows' | 'macos' | 'linux';
readonly dotnetRuntime: `${string}-${SupportedArch}`;
readonly outputDirectoryName: string;
readonly archiveBaseName: string;
readonly installerAssetName: string;
readonly sidecarExecutableName: string;
readonly packagedExecutableName?: string;
readonly appBundleName?: string;
}
function resolveSupportedArch(
platform: SupportedPlatform,
arch: NodeJS.Architecture,
): SupportedArch {
if (arch === 'x64' || arch === 'arm64') {
return arch;
}
throw new Error(`Unsupported architecture for ${platform}: ${arch}`);
}
export function resolveReleaseTarget(
platform: NodeJS.Platform,
arch: NodeJS.Architecture,
): ReleaseTarget {
switch (platform) {
case 'win32': {
const supportedArch = resolveSupportedArch(platform, arch);
const archiveBaseName = `${productName}-windows-${supportedArch}`;
return {
platform,
arch: supportedArch,
platformLabel: 'windows',
dotnetRuntime: `win-${supportedArch}`,
outputDirectoryName: archiveBaseName,
archiveBaseName,
installerAssetName: `${archiveBaseName}-setup.exe`,
sidecarExecutableName: 'Aryx.AgentHost.exe',
packagedExecutableName: `${productName}.exe`,
};
}
case 'darwin': {
const supportedArch = resolveSupportedArch(platform, arch);
const archiveBaseName = `${productName}-macos-${supportedArch}`;
return {
platform,
arch: supportedArch,
platformLabel: 'macos',
dotnetRuntime: `osx-${supportedArch}`,
outputDirectoryName: archiveBaseName,
archiveBaseName,
installerAssetName: `${archiveBaseName}.dmg`,
sidecarExecutableName: 'Aryx.AgentHost',
appBundleName: `${productName}.app`,
};
}
case 'linux': {
const supportedArch = resolveSupportedArch(platform, arch);
const archiveBaseName = `${productName}-linux-${supportedArch}`;
return {
platform,
arch: supportedArch,
platformLabel: 'linux',
dotnetRuntime: `linux-${supportedArch}`,
outputDirectoryName: archiveBaseName,
archiveBaseName,
installerAssetName: `aryx-linux-${supportedArch}.deb`,
sidecarExecutableName: 'Aryx.AgentHost',
packagedExecutableName: productName,
};
}
default:
throw new Error(`Unsupported release platform: ${platform}`);
}
}