Merge pull request #71 from fluree/fix/respect-arch-when-installing-babashka

Install arm64 babashka in arm64 runners
This commit is contained in:
Kirill Chernyshov 2022-08-29 10:29:11 +02:00 committed by GitHub
commit 18d583aeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,13 +27,21 @@ export async function getLatestBabashka(githubAuth?: string): Promise<string> {
export function getArtifactName(version: string): string { export function getArtifactName(version: string): string {
const platform = os.platform() const platform = os.platform()
let arch
switch (os.arch()) {
case 'x64':
arch = 'amd64'
case 'arm64':
arch = 'aarch64'
}
switch (platform) { switch (platform) {
case 'win32': case 'win32':
return `babashka-${version}-windows-amd64.zip` return `babashka-${version}-windows-${arch}.zip`
case 'darwin': case 'darwin':
return `babashka-${version}-macos-amd64.tar.gz` return `babashka-${version}-macos-${arch}.tar.gz`
default: default:
return `babashka-${version}-linux-amd64-static.tar.gz` return `babashka-${version}-linux-${arch}-static.tar.gz`
} }
} }