Add support for aarch64 builds (#9).

This commit is contained in:
Fabio Niephaus
2022-03-08 10:47:41 +01:00
parent a02f4df8f7
commit b76e2627a2
5 changed files with 43 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ export const IS_WINDOWS = process.platform === 'win32'
export const VERSION_DEV = 'dev'
export const VERSION_LATEST = 'latest'
export const GRAALVM_ARCH = determineGraalVMArchitecture()
export const GRAALVM_FILE_EXTENSION = IS_WINDOWS ? '.zip' : '.tar.gz'
export const GRAALVM_GH_USER = 'graalvm'
export const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform
@@ -16,3 +17,17 @@ export const MANDREL_NAMESPACE = 'mandrel-'
export type LatestReleaseResponse =
otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']
function determineGraalVMArchitecture(): string {
switch (process.arch) {
case 'x64': {
return 'amd64'
}
case 'arm64': {
return 'aarch64'
}
default: {
throw new Error(`Unsupported architecture: ${process.arch}`)
}
}
}