Files
aryx/tests/scripts/releaseTarget.test.ts
T
David KayaandCopilot 2f069f60b4 feat: add cross-platform release automation
Add a GitHub Actions workflow that validates the app on pushes and pull requests, and publishes Windows, macOS, and Linux release assets when a tag is pushed.

Also replace the Windows-only packaging flow with cross-platform Bun scripts for sidecar publishing and Electron packaging so the release job can package each runner natively.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 19:20:46 +01:00

66 lines
2.0 KiB
TypeScript

import { describe, expect, test } from 'bun:test';
import {
macBundleIdentifier,
productName,
resolveReleaseTarget,
} from '../../scripts/releaseTarget';
describe('resolveReleaseTarget', () => {
test('maps Windows x64 to the expected runtime and output names', () => {
expect(resolveReleaseTarget('win32', 'x64')).toEqual({
platform: 'win32',
arch: 'x64',
platformLabel: 'windows',
dotnetRuntime: 'win-x64',
outputDirectoryName: 'Eryx-windows-x64',
archiveBaseName: 'Eryx-windows-x64',
sidecarExecutableName: 'Eryx.AgentHost.exe',
packagedExecutableName: 'Eryx.exe',
});
});
test('maps macOS arm64 to the expected bundle metadata', () => {
expect(resolveReleaseTarget('darwin', 'arm64')).toEqual({
platform: 'darwin',
arch: 'arm64',
platformLabel: 'macos',
dotnetRuntime: 'osx-arm64',
outputDirectoryName: 'Eryx-macos-arm64',
archiveBaseName: 'Eryx-macos-arm64',
sidecarExecutableName: 'Eryx.AgentHost',
appBundleName: 'Eryx.app',
});
});
test('maps Linux x64 to the expected runtime and output names', () => {
expect(resolveReleaseTarget('linux', 'x64')).toEqual({
platform: 'linux',
arch: 'x64',
platformLabel: 'linux',
dotnetRuntime: 'linux-x64',
outputDirectoryName: 'Eryx-linux-x64',
archiveBaseName: 'Eryx-linux-x64',
sidecarExecutableName: 'Eryx.AgentHost',
packagedExecutableName: 'Eryx',
});
});
test('exports the expected product metadata constants', () => {
expect(productName).toBe('Eryx');
expect(macBundleIdentifier).toBe('com.davidkaya.eryx');
});
test('rejects unsupported platforms', () => {
expect(() => resolveReleaseTarget('freebsd', 'x64')).toThrow(
'Unsupported release platform: freebsd',
);
});
test('rejects unsupported architectures', () => {
expect(() => resolveReleaseTarget('linux', 'ia32')).toThrow(
'Unsupported architecture for linux: ia32',
);
});
});