mirror of
https://github.com/actions/setup-go.git
synced 2025-09-05 18:06:03 -06:00

* Node 24 upgrade Doing an upgrade for node 24, node 24 is stricter with types so need to add a type for achitecture * format * package updates * fix for check failures * upgrade @types/node * update package.json version * check failure fix * package-lock.json update * update node24 * npm run format * npm run format * node update from the workflows * Upgrade `actions/checkout` to v5 and `actions/setup-go` to v6 in README.md --------- Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com> Co-authored-by: Priya Gupta <147705955+priyagupta108@users.noreply.github.com>
40 lines
945 B
TypeScript
40 lines
945 B
TypeScript
import os from 'os';
|
|
import {Architecture} from './types';
|
|
|
|
export function getPlatform(): string {
|
|
// darwin and linux match already
|
|
// freebsd not supported yet but future proofed.
|
|
|
|
// 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'
|
|
let plat: string = os.platform();
|
|
|
|
// wants 'darwin', 'freebsd', 'linux', 'windows'
|
|
if (plat === 'win32') {
|
|
plat = 'windows';
|
|
}
|
|
|
|
return plat;
|
|
}
|
|
|
|
export function getArch(arch: Architecture): string {
|
|
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
|
|
|
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
|
// currently not supported by runner but future proofed mapping
|
|
switch (arch) {
|
|
case 'x64':
|
|
arch = 'amd64';
|
|
break;
|
|
// case 'ppc':
|
|
// arch = 'ppc64';
|
|
// break;
|
|
case 'x32':
|
|
arch = '386';
|
|
break;
|
|
case 'arm':
|
|
arch = 'armv6l';
|
|
break;
|
|
}
|
|
|
|
return arch;
|
|
}
|