@@ -97935,7 +97935,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9793597935 return (mod && mod.__esModule) ? mod : { "default": mod };
9793697936};
9793797937Object.defineProperty(exports, "__esModule", ({ value: true }));
97938- exports.cacheDependencies = void 0;
9793997938const core = __importStar(__nccwpck_require__(7484));
9794097939const finder = __importStar(__nccwpck_require__(6843));
9794197940const finderPyPy = __importStar(__nccwpck_require__(2625));
@@ -97954,50 +97953,10 @@ function isGraalPyVersion(versionSpec) {
9795497953function cacheDependencies(cache, pythonVersion) {
9795597954 return __awaiter(this, void 0, void 0, function* () {
9795697955 const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
97957- let resolvedDependencyPath = undefined;
97958- if (cacheDependencyPath) {
97959- const actionPath = process.env.GITHUB_ACTION_PATH || '';
97960- const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
97961- const sourcePath = path.resolve(actionPath, cacheDependencyPath);
97962- const relativePath = path.relative(actionPath, sourcePath);
97963- const targetPath = path.resolve(workspace, relativePath);
97964- try {
97965- const sourceExists = yield fs_1.default.promises
97966- .access(sourcePath, fs_1.default.constants.F_OK)
97967- .then(() => true)
97968- .catch(() => false);
97969- if (!sourceExists) {
97970- core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`);
97971- }
97972- else {
97973- if (sourcePath !== targetPath) {
97974- const targetDir = path.dirname(targetPath);
97975- // Create target directory if it doesn't exist
97976- yield fs_1.default.promises.mkdir(targetDir, { recursive: true });
97977- // Copy file asynchronously
97978- yield fs_1.default.promises.copyFile(sourcePath, targetPath);
97979- core.info(`Copied ${sourcePath} to ${targetPath}`);
97980- }
97981- else {
97982- core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
97983- }
97984- resolvedDependencyPath = path
97985- .relative(workspace, targetPath)
97986- .replace(/\\/g, '/');
97987- core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
97988- }
97989- }
97990- catch (error) {
97991- core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
97992- }
97993- }
97994- // Pass resolvedDependencyPath if available, else fallback to original input
97995- const dependencyPathForCache = resolvedDependencyPath !== null && resolvedDependencyPath !== void 0 ? resolvedDependencyPath : cacheDependencyPath;
97996- const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, dependencyPathForCache);
97956+ const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath);
9799797957 yield cacheDistributor.restoreCache();
9799897958 });
9799997959}
98000- exports.cacheDependencies = cacheDependencies;
9800197960function resolveVersionInputFromDefaultFile() {
9800297961 const couples = [
9800397962 ['.python-version', utils_1.getVersionsInputFromPlainFile]
0 commit comments