mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Fix arch conversion
This commit is contained in:
parent
c5cf47b1d5
commit
93cf84c15c
3 changed files with 12 additions and 25 deletions
18
dist/setup/index.js
vendored
18
dist/setup/index.js
vendored
|
@ -63005,9 +63005,9 @@ function getInfoFromDist(versionSpec, arch) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function findMatch(versionSpec, arch = sys.getArch()) {
|
function findMatch(versionSpec, arch = os_1.default.arch()) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let archFilter = translateArchToDistUrl(arch);
|
let archFilter = sys.getArch(arch);
|
||||||
let platFilter = sys.getPlatform();
|
let platFilter = sys.getPlatform();
|
||||||
let result;
|
let result;
|
||||||
let match;
|
let match;
|
||||||
|
@ -63087,14 +63087,6 @@ function parseGoVersionFile(versionFilePath) {
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
}
|
}
|
||||||
exports.parseGoVersionFile = parseGoVersionFile;
|
exports.parseGoVersionFile = parseGoVersionFile;
|
||||||
function translateArchToDistUrl(arch) {
|
|
||||||
switch (arch) {
|
|
||||||
case 'arm':
|
|
||||||
return 'armv6l';
|
|
||||||
default:
|
|
||||||
return arch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -63293,9 +63285,8 @@ function getPlatform() {
|
||||||
return plat;
|
return plat;
|
||||||
}
|
}
|
||||||
exports.getPlatform = getPlatform;
|
exports.getPlatform = getPlatform;
|
||||||
function getArch() {
|
function getArch(arch) {
|
||||||
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
||||||
let arch = os.arch();
|
|
||||||
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
||||||
// currently not supported by runner but future proofed mapping
|
// currently not supported by runner but future proofed mapping
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
|
@ -63308,6 +63299,9 @@ function getArch() {
|
||||||
case 'x32':
|
case 'x32':
|
||||||
arch = '386';
|
arch = '386';
|
||||||
break;
|
break;
|
||||||
|
case 'arm':
|
||||||
|
arch = 'armv6l';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return arch;
|
return arch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,9 +223,9 @@ async function getInfoFromDist(
|
||||||
|
|
||||||
export async function findMatch(
|
export async function findMatch(
|
||||||
versionSpec: string,
|
versionSpec: string,
|
||||||
arch = sys.getArch()
|
arch = os.arch()
|
||||||
): Promise<IGoVersion | undefined> {
|
): Promise<IGoVersion | undefined> {
|
||||||
let archFilter = translateArchToDistUrl(arch);
|
let archFilter = sys.getArch(arch);
|
||||||
let platFilter = sys.getPlatform();
|
let platFilter = sys.getPlatform();
|
||||||
|
|
||||||
let result: IGoVersion | undefined;
|
let result: IGoVersion | undefined;
|
||||||
|
@ -323,12 +323,3 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
||||||
|
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function translateArchToDistUrl(arch: string): string {
|
|
||||||
switch (arch) {
|
|
||||||
case 'arm':
|
|
||||||
return 'armv6l';
|
|
||||||
default:
|
|
||||||
return arch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,9 +15,8 @@ export function getPlatform(): string {
|
||||||
return plat;
|
return plat;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getArch(): string {
|
export function getArch(arch: string): string {
|
||||||
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
||||||
let arch: string = os.arch();
|
|
||||||
|
|
||||||
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
||||||
// currently not supported by runner but future proofed mapping
|
// currently not supported by runner but future proofed mapping
|
||||||
|
@ -31,6 +30,9 @@ export function getArch(): string {
|
||||||
case 'x32':
|
case 'x32':
|
||||||
arch = '386';
|
arch = '386';
|
||||||
break;
|
break;
|
||||||
|
case 'arm':
|
||||||
|
arch = 'armv6l';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return arch;
|
return arch;
|
||||||
|
|
Loading…
Add table
Reference in a new issue