Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 9 additions & 46 deletions dist/cache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use strict";
/**
* @license
* SPDX-License-Identifier: MIT
Expand All @@ -7,47 +6,11 @@
*
* Cache management for GitHub Action.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.restoreCache = restoreCache;
exports.saveCache = saveCache;
const cache = __importStar(require("@actions/cache"));
const core = __importStar(require("@actions/core"));
const path = __importStar(require("path"));
const fs = __importStar(require("fs"));
const utils_1 = require("./utils");
import * as cache from '@actions/cache';
import * as core from '@actions/core';
import * as path from 'path';
import * as fs from 'fs';
import { getCacheDirectory } from './utils';
/**
* Get the cache key for a specific version
* @param version Task version
Expand All @@ -71,8 +34,8 @@ function getTaskExecutableName() {
* @param version Task version
* @returns Path to the restored Task or empty string if not found
*/
async function restoreCache(version) {
const cacheDir = (0, utils_1.getCacheDirectory)();
export async function restoreCache(version) {
const cacheDir = getCacheDirectory();
const cacheKey = getCacheKey(version);
const executableName = getTaskExecutableName();
try {
Expand Down Expand Up @@ -105,8 +68,8 @@ async function restoreCache(version) {
* @param taskPath Path to the Task executable
* @param version Task version
*/
async function saveCache(taskPath, version) {
const cacheDir = (0, utils_1.getCacheDirectory)();
export async function saveCache(taskPath, version) {
const cacheDir = getCacheDirectory();
const cacheKey = getCacheKey(version);
const executableName = getTaskExecutableName();
try {
Expand Down
15 changes: 6 additions & 9 deletions dist/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"use strict";
/**
* @license
* SPDX-License-Identifier: MIT
Expand All @@ -7,25 +6,23 @@
*
* Constants for the GitHub Action.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RELEASES_URL = exports.CACHE_DIR = exports.EXE_EXTENSION = exports.ARCH_MAPPING = exports.OS_MAPPING = exports.RELEASES_API_URL = void 0;
// API endpoint for fetching release information.
exports.RELEASES_API_URL = 'https://api.github.com/repos/go-task/task/releases';
export const RELEASES_API_URL = 'https://api.github.com/repos/go-task/task/releases';
// OS mapping for download paths.
exports.OS_MAPPING = {
export const OS_MAPPING = {
win32: 'windows',
darwin: 'darwin',
linux: 'linux'
};
// Architecture mapping for download paths.
exports.ARCH_MAPPING = {
export const ARCH_MAPPING = {
x64: 'amd64',
arm64: 'arm64',
arm: 'arm'
};
// Extension for executable based on platform.
exports.EXE_EXTENSION = process.platform === 'win32' ? '.exe' : '';
export const EXE_EXTENSION = process.platform === 'win32' ? '.exe' : '';
// Cache directory name.
exports.CACHE_DIR = 'task-runner';
export const CACHE_DIR = 'task-runner';
// Base URL for Task releases.
exports.RELEASES_URL = 'https://github.com/go-task/task/releases/download';
export const RELEASES_URL = 'https://github.com/go-task/task/releases/download';
Loading
Loading