Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support arch variant to download GoReleaser #309

Merged
merged 1 commit into from Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
181 changes: 179 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion src/installer.ts
Expand Up @@ -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);
Expand Down