fix: support arch variant to download GoReleaser (#309)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-10-03 23:03:55 +02:00
committed by GitHub
parent cb1d514d21
commit 13b378d620
2 changed files with 199 additions and 3 deletions
+20 -1
View File
@@ -46,8 +46,27 @@ export async function getGoReleaser(distribution: string, version: string): Prom
}
const getFilename = (distribution: string): string => {
let arch: string;
switch (osArch) {
case 'x64': {
arch = 'x86_64';
break;
}
case 'x32': {
arch = 'i386';
break;
}
case 'arm': {
const arm_version = (process.config.variables as any).arm_version;
arch = arm_version ? 'armv' + arm_version : 'arm';
break;
}
default: {
arch = osArch;
break;
}
}
const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux';
const arch: string = osArch == 'x64' ? 'x86_64' : osArch == 'x32' ? 'i386' : osArch;
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz';
const suffix: string = pro.suffix(distribution);
return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);