Skip to content

Commit e084fca

Browse files
authored
Merge branch 'main' into ReadmeUpdate
2 parents 789730b + a93d541 commit e084fca

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

dist/setup/index.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -65340,16 +65340,13 @@ function resolveVersionInput() {
6534065340
function run() {
6534165341
var _a;
6534265342
return __awaiter(this, void 0, void 0, function* () {
65343-
// According to the README windows binaries do not require to be installed
65344-
// in the specific location, but Mac and Linux do
65345-
if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) {
65346-
if (utils_1.IS_LINUX)
65347-
process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
65348-
else
65349-
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
65343+
if (utils_1.IS_MAC) {
65344+
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
65345+
}
65346+
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
6535065347
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
6535165348
}
65352-
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`);
65349+
core.debug(`Python is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`);
6535365350
try {
6535465351
const version = resolveVersionInput();
6535565352
const checkLatest = core.getBooleanInput('check-latest');
@@ -65425,7 +65422,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6542565422
return (mod && mod.__esModule) ? mod : { "default": mod };
6542665423
};
6542765424
Object.defineProperty(exports, "__esModule", ({ value: true }));
65428-
exports.logWarning = exports.getLinuxOSReleaseInfo = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
65425+
exports.logWarning = exports.getLinuxOSReleaseInfo = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_MAC = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
6542965426
const cache = __importStar(__nccwpck_require__(7799));
6543065427
const core = __importStar(__nccwpck_require__(2186));
6543165428
const fs_1 = __importDefault(__nccwpck_require__(7147));
@@ -65434,6 +65431,7 @@ const semver = __importStar(__nccwpck_require__(1383));
6543465431
const exec = __importStar(__nccwpck_require__(1514));
6543565432
exports.IS_WINDOWS = process.platform === 'win32';
6543665433
exports.IS_LINUX = process.platform === 'linux';
65434+
exports.IS_MAC = process.platform === 'darwin';
6543765435
exports.WINDOWS_ARCHS = ['x86', 'x64'];
6543865436
exports.WINDOWS_PLATFORMS = ['win32', 'win64'];
6543965437
const PYPY_VERSION_FILE = 'PYPY_VERSION';

src/setup-python.ts

+8-12
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ import * as path from 'path';
55
import * as os from 'os';
66
import fs from 'fs';
77
import {getCacheDistributor} from './cache-distributions/cache-factory';
8-
import {
9-
isCacheFeatureAvailable,
10-
logWarning,
11-
IS_LINUX,
12-
IS_WINDOWS
13-
} from './utils';
8+
import {isCacheFeatureAvailable, logWarning, IS_MAC} from './utils';
149

1510
function isPyPyVersion(versionSpec: string) {
1611
return versionSpec.startsWith('pypy');
@@ -68,15 +63,16 @@ function resolveVersionInput(): string {
6863
}
6964

7065
async function run() {
71-
// According to the README windows binaries do not require to be installed
72-
// in the specific location, but Mac and Linux do
73-
if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) {
74-
if (IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache';
75-
else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
66+
if (IS_MAC) {
67+
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
68+
}
69+
70+
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
7671
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
7772
}
73+
7874
core.debug(
79-
`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`
75+
`Python is expected to be installed into ${process.env['RUNNER_TOOL_CACHE']}`
8076
);
8177
try {
8278
const version = resolveVersionInput();

src/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as exec from '@actions/exec';
77

88
export const IS_WINDOWS = process.platform === 'win32';
99
export const IS_LINUX = process.platform === 'linux';
10+
export const IS_MAC = process.platform === 'darwin';
1011
export const WINDOWS_ARCHS = ['x86', 'x64'];
1112
export const WINDOWS_PLATFORMS = ['win32', 'win64'];
1213
const PYPY_VERSION_FILE = 'PYPY_VERSION';

0 commit comments

Comments
 (0)