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(), app.getVersion(),
os.version(), os.version(),
userAgent, userAgent,
process.arch,
app.runningUnderARM64Translation,
OS.getLinuxName() OS.getLinuxName()
); );
} }

View file

@ -75,6 +75,7 @@
"test:storybook:serve": "http-server storybook-static --port 6006 --silent", "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", "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": "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-linux": "run-s generate build:esbuild:prod && npm run build:release -- --publish=never",
"build:acknowledgments": "node scripts/generate-acknowledgments.js", "build:acknowledgments": "node scripts/generate-acknowledgments.js",
"build:dns-fallback": "node ts/scripts/generate-dns-fallback.js", "build:dns-fallback": "node ts/scripts/generate-dns-fallback.js",
@ -85,6 +86,7 @@
"build:esbuild:prod": "node scripts/esbuild.js --prod", "build:esbuild:prod": "node scripts/esbuild.js --prod",
"build:electron": "electron-builder --config.extraMetadata.environment=$SIGNAL_ENV", "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": "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", "build:preload-cache": "node ts/scripts/generate-preload-cache.js",
"verify": "run-p --print-label verify:*", "verify": "run-p --print-label verify:*",
"verify:ts": "tsc --noEmit", "verify:ts": "tsc --noEmit",

View file

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

View file

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