Skip to content

Commit

Permalink
adding support for linux-ppc64le
Browse files Browse the repository at this point in the history
  • Loading branch information
adilhusain-s committed Oct 13, 2023
1 parent 2a017f3 commit 35387fe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
11 changes: 11 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71988,6 +71988,9 @@ class BaseDistribution {
case 'win32':
dataFileName = `win-${osArch}-exe`;
break;
case 'aix':
dataFileName = `aix-${osArch}`;
break;
default:
throw new Error(`Unexpected OS '${this.osPlat}'`);
}
Expand All @@ -72005,9 +72008,17 @@ class BaseDistribution {
return versions.sort(semver_1.default.rcompare);
}
translateArchToDistUrl(arch) {
const endianness = os_1.default.endianness().toLowerCase();
switch (arch) {
case 'arm':
return 'armv7l';
case 'ppc64':
switch (endianness) {
case 'le':
return 'ppc64le';
default:
return 'ppc64';
}
default:
return arch;
}
Expand Down
19 changes: 15 additions & 4 deletions src/distributions/base-distribution.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {v4 as uuidv4} from 'uuid';
import { v4 as uuidv4 } from 'uuid';
import * as tc from '@actions/tool-cache';
import * as hc from '@actions/http-client';
import * as core from '@actions/core';
Expand All @@ -11,7 +11,7 @@ import * as path from 'path';
import os from 'os';
import fs from 'fs';

import {NodeInputs, INodeVersion, INodeVersionInfo} from './base-models';
import { NodeInputs, INodeVersion, INodeVersionInfo } from './base-models';

export default abstract class BaseDistribution {
protected httpClient: hc.HttpClient;
Expand Down Expand Up @@ -67,7 +67,7 @@ export default abstract class BaseDistribution {
protected evaluateVersions(versions: string[]): string {
let version = '';

const {range, options} = this.validRange(this.nodeInfo.versionSpec);
const { range, options } = this.validRange(this.nodeInfo.versionSpec);

core.debug(`evaluating ${versions.length} versions`);

Expand Down Expand Up @@ -157,7 +157,7 @@ export default abstract class BaseDistribution {
const c = semver.clean(versionSpec) || '';
const valid = semver.valid(c) ?? versionSpec;

return {range: valid, options};
return { range: valid, options };
}

protected async acquireWindowsNodeFromFallbackLocation(
Expand Down Expand Up @@ -262,6 +262,9 @@ export default abstract class BaseDistribution {
case 'win32':
dataFileName = `win-${osArch}-exe`;
break;
case 'aix':
dataFileName = `aix-${osArch}`;
break;
default:
throw new Error(`Unexpected OS '${this.osPlat}'`);
}
Expand All @@ -285,9 +288,17 @@ export default abstract class BaseDistribution {
}

protected translateArchToDistUrl(arch: string): string {
const endianness = os.endianness().toLowerCase()
switch (arch) {
case 'arm':
return 'armv7l';
case 'ppc64':
switch (endianness) {
case 'le':
return 'ppc64le';
default:
return 'ppc64';
}
default:
return arch;
}
Expand Down

0 comments on commit 35387fe

Please sign in to comment.