Add experimental win32 arm64 build support

This commit is contained in:
ayumi-signal 2024-10-29 15:29:30 -07:00 committed by GitHub
parent 6ca3719625
commit ef275e6ef6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 3 deletions

View file

@ -2829,6 +2829,8 @@ ipc.handle(
app.getVersion(),
os.version(),
userAgent,
process.arch,
app.runningUnderARM64Translation,
OS.getLinuxName()
);
}

View file

@ -75,6 +75,7 @@
"test:storybook:serve": "http-server storybook-static --port 6006 --silent",
"test:storybook:test": "wait-on http://127.0.0.1:6006/ --timeout 5000 && test-storybook",
"build": "run-s --print-label generate build:esbuild:prod build:release",
"build-win32-arm64": "run-s --print-label generate build:esbuild:prod build:release-win32-arm64",
"build-linux": "run-s generate build:esbuild:prod && npm run build:release -- --publish=never",
"build:acknowledgments": "node scripts/generate-acknowledgments.js",
"build:dns-fallback": "node ts/scripts/generate-dns-fallback.js",
@ -85,6 +86,7 @@
"build:esbuild:prod": "node scripts/esbuild.js --prod",
"build:electron": "electron-builder --config.extraMetadata.environment=$SIGNAL_ENV",
"build:release": "cross-env SIGNAL_ENV=production npm run build:electron -- --config.directories.output=release",
"build:release-win32-arm64": "npm run build:release -- --arm64",
"build:preload-cache": "node ts/scripts/generate-preload-cache.js",
"verify": "run-p --print-label verify:*",
"verify:ts": "tsc --noEmit",

View file

@ -43,6 +43,8 @@ const getHeader = (
appVersion: string,
osVersion: string,
userAgent: string,
arch: string,
runningUnderARM64Translation: boolean,
linuxVersion?: string
): string =>
[
@ -53,6 +55,7 @@ const getHeader = (
Environment: getEnvironment(),
'App version': appVersion,
'OS version': osVersion,
Arch: `${arch}${runningUnderARM64Translation ? ' (ARM64 Translation)' : ''}`,
...(linuxVersion && { 'Linux version': linuxVersion }),
}),
headerSection('User info', user),
@ -87,6 +90,8 @@ export function getLog(
appVersion: string,
osVersion: string,
userAgent: string,
arch: string,
runningUnderARM64Translation: boolean,
linuxVersion?: string
): string {
let header: string;
@ -99,6 +104,8 @@ export function getLog(
appVersion,
osVersion,
userAgent,
arch,
runningUnderARM64Translation,
linuxVersion
);
body = logEntries.map(formatLine).join('\n');

View file

@ -892,12 +892,18 @@ export function getUpdateFileName(
}
let path: string | undefined;
let fileFilter: (({ url }: { url: string }) => boolean) | undefined;
if (platform === 'darwin') {
fileFilter = ({ url }) => url.includes(arch) && url.endsWith('.zip');
} else if (platform === 'win32') {
fileFilter = ({ url }) => url.includes(arch) && url.endsWith('.exe');
}
if (fileFilter) {
const { files } = info;
const candidates = files.filter(
({ url }) => url.includes(arch) && url.endsWith('.zip')
);
const candidates = files.filter(fileFilter);
if (candidates.length === 1) {
path = candidates[0].url;