diff --git a/action.yml b/action.yml index 21dc2ae..ef43eb8 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,12 @@ inputs: cache-map: required: true description: "The map of actions source to container destination paths for the cache paths" + cache-source: + deprecationMessage: "Use `cache-map` instead" + description: "Where the cache is stored in the calling workspace. Default: `cache`" + cache-target: + deprecationMessage: "Use `cache-map` instead" + description: "Where the cache is stored in the docker container. Default: `/root/.cache/go-build`" scratch-dir: default: scratch description: "Where the action is stores some temporary files for its processing. Default: `scratch`" diff --git a/dist/index.js b/dist/index.js index e6d7e1a..12e1a19 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ -import {stat as $evV72$stat, statSync as $evV72$statSync, openSync as $evV72$openSync, readSync as $evV72$readSync, closeSync as $evV72$closeSync} from "fs"; -import {appendFile as $evV72$appendFile, rm as $evV72$rm, mkdir as $evV72$mkdir, writeFile as $evV72$writeFile, rename as $evV72$rename} from "fs/promises"; -import {EOL as $evV72$EOL} from "os"; -import {join as $evV72$join, normalize as $evV72$normalize, delimiter as $evV72$delimiter, resolve as $evV72$resolve} from "path"; +import * as $evV72$fs from "fs"; +import $evV72$fspromises from "fs/promises"; +import $evV72$os, * as $evV72$os1 from "os"; +import $evV72$path, * as $evV72$path1 from "path"; import {spawn as $evV72$spawn, spawnSync as $evV72$spawnSync} from "child_process"; @@ -194,17 +194,506 @@ function $ec42a3295e12ea98$export$2e2bcd8739ae039(args, opts) { } +var $bbb9dac42384d004$exports = {}; +"use strict"; +var $bbb9dac42384d004$var$__createBinding = $bbb9dac42384d004$exports && $bbb9dac42384d004$exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function() { + return m[k]; + } + }); +} : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var $bbb9dac42384d004$var$__setModuleDefault = $bbb9dac42384d004$exports && $bbb9dac42384d004$exports.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function(o, v) { + o["default"] = v; +}); +var $bbb9dac42384d004$var$__importStar = $bbb9dac42384d004$exports && $bbb9dac42384d004$exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for(var k in mod)if (k !== "default" && Object.hasOwnProperty.call(mod, k)) $bbb9dac42384d004$var$__createBinding(result, mod, k); + } + $bbb9dac42384d004$var$__setModuleDefault(result, mod); + return result; +}; +var $bbb9dac42384d004$var$__awaiter = $bbb9dac42384d004$exports && $bbb9dac42384d004$exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty($bbb9dac42384d004$exports, "__esModule", { + value: true +}); +$bbb9dac42384d004$exports.getState = $bbb9dac42384d004$exports.saveState = $bbb9dac42384d004$exports.group = $bbb9dac42384d004$exports.endGroup = $bbb9dac42384d004$exports.startGroup = $bbb9dac42384d004$exports.info = $bbb9dac42384d004$exports.notice = $bbb9dac42384d004$exports.warning = $bbb9dac42384d004$exports.error = $bbb9dac42384d004$exports.debug = $bbb9dac42384d004$exports.isDebug = $bbb9dac42384d004$exports.setFailed = $bbb9dac42384d004$exports.setCommandEcho = $bbb9dac42384d004$exports.setOutput = $bbb9dac42384d004$exports.getBooleanInput = $bbb9dac42384d004$exports.getMultilineInput = $bbb9dac42384d004$exports.getInput = $bbb9dac42384d004$exports.addPath = $bbb9dac42384d004$exports.setSecret = $bbb9dac42384d004$exports.exportVariable = $bbb9dac42384d004$exports.ExitCode = void 0; +var $6aa988ea1669fe85$exports = {}; +"use strict"; +var $6aa988ea1669fe85$var$__createBinding = $6aa988ea1669fe85$exports && $6aa988ea1669fe85$exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function() { + return m[k]; + } + }); +} : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var $6aa988ea1669fe85$var$__setModuleDefault = $6aa988ea1669fe85$exports && $6aa988ea1669fe85$exports.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function(o, v) { + o["default"] = v; +}); +var $6aa988ea1669fe85$var$__importStar = $6aa988ea1669fe85$exports && $6aa988ea1669fe85$exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for(var k in mod)if (k !== "default" && Object.hasOwnProperty.call(mod, k)) $6aa988ea1669fe85$var$__createBinding(result, mod, k); + } + $6aa988ea1669fe85$var$__setModuleDefault(result, mod); + return result; +}; +Object.defineProperty($6aa988ea1669fe85$exports, "__esModule", { + value: true +}); +$6aa988ea1669fe85$exports.issue = $6aa988ea1669fe85$exports.issueCommand = void 0; + +const $6aa988ea1669fe85$var$os = $6aa988ea1669fe85$var$__importStar($evV72$os1); +var $1f87556d0f647bcd$exports = {}; +"use strict"; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty($1f87556d0f647bcd$exports, "__esModule", { + value: true +}); +$1f87556d0f647bcd$exports.toCommandProperties = $1f87556d0f647bcd$exports.toCommandValue = void 0; +/** + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string + */ function $1f87556d0f647bcd$var$toCommandValue(input) { + if (input === null || input === undefined) return ""; + else if (typeof input === "string" || input instanceof String) return input; + return JSON.stringify(input); +} +$1f87556d0f647bcd$exports.toCommandValue = $1f87556d0f647bcd$var$toCommandValue; +/** + * + * @param annotationProperties + * @returns The command properties to send with the actual annotation command + * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 + */ function $1f87556d0f647bcd$var$toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) return {}; + return { + title: annotationProperties.title, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; +} +$1f87556d0f647bcd$exports.toCommandProperties = $1f87556d0f647bcd$var$toCommandProperties; + + +/** + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value + */ function $6aa988ea1669fe85$var$issueCommand(command, properties, message) { + const cmd = new $6aa988ea1669fe85$var$Command(command, properties, message); + process.stdout.write(cmd.toString() + $6aa988ea1669fe85$var$os.EOL); +} +$6aa988ea1669fe85$exports.issueCommand = $6aa988ea1669fe85$var$issueCommand; +function $6aa988ea1669fe85$var$issue(name, message = "") { + $6aa988ea1669fe85$var$issueCommand(name, {}, message); +} +$6aa988ea1669fe85$exports.issue = $6aa988ea1669fe85$var$issue; +const $6aa988ea1669fe85$var$CMD_STRING = "::"; +class $6aa988ea1669fe85$var$Command { + constructor(command, properties, message){ + if (!command) command = "missing.command"; + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = $6aa988ea1669fe85$var$CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += " "; + let first = true; + for(const key in this.properties)if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) first = false; + else cmdStr += ","; + cmdStr += `${key}=${$6aa988ea1669fe85$var$escapeProperty(val)}`; + } + } + } + cmdStr += `${$6aa988ea1669fe85$var$CMD_STRING}${$6aa988ea1669fe85$var$escapeData(this.message)}`; + return cmdStr; + } +} +function $6aa988ea1669fe85$var$escapeData(s) { + return $1f87556d0f647bcd$exports.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); +} +function $6aa988ea1669fe85$var$escapeProperty(s) { + return $1f87556d0f647bcd$exports.toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); +} + + +var $71d1c579b85cee7b$exports = {}; +"use strict"; +// For internal use, subject to change. +var $71d1c579b85cee7b$var$__createBinding = $71d1c579b85cee7b$exports && $71d1c579b85cee7b$exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function() { + return m[k]; + } + }); +} : function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var $71d1c579b85cee7b$var$__setModuleDefault = $71d1c579b85cee7b$exports && $71d1c579b85cee7b$exports.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function(o, v) { + o["default"] = v; +}); +var $71d1c579b85cee7b$var$__importStar = $71d1c579b85cee7b$exports && $71d1c579b85cee7b$exports.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for(var k in mod)if (k !== "default" && Object.hasOwnProperty.call(mod, k)) $71d1c579b85cee7b$var$__createBinding(result, mod, k); + } + $71d1c579b85cee7b$var$__setModuleDefault(result, mod); + return result; +}; +Object.defineProperty($71d1c579b85cee7b$exports, "__esModule", { + value: true +}); +$71d1c579b85cee7b$exports.issueCommand = void 0; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ const $71d1c579b85cee7b$var$fs = $71d1c579b85cee7b$var$__importStar($evV72$fs); + +const $71d1c579b85cee7b$var$os = $71d1c579b85cee7b$var$__importStar($evV72$os1); + +function $71d1c579b85cee7b$var$issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) throw new Error(`Unable to find environment variable for file command ${command}`); + if (!$71d1c579b85cee7b$var$fs.existsSync(filePath)) throw new Error(`Missing file at path: ${filePath}`); + $71d1c579b85cee7b$var$fs.appendFileSync(filePath, `${$1f87556d0f647bcd$exports.toCommandValue(message)}${$71d1c579b85cee7b$var$os.EOL}`, { + encoding: "utf8" + }); +} +$71d1c579b85cee7b$exports.issueCommand = $71d1c579b85cee7b$var$issueCommand; + + + + +const $bbb9dac42384d004$var$os = $bbb9dac42384d004$var$__importStar($evV72$os1); + +const $bbb9dac42384d004$var$path = $bbb9dac42384d004$var$__importStar($evV72$path1); +/** + * The code to exit an action + */ var $bbb9dac42384d004$var$ExitCode; +(function(ExitCode) { + /** + * A code indicating that the action was successful + */ ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})($bbb9dac42384d004$var$ExitCode = $bbb9dac42384d004$exports.ExitCode || ($bbb9dac42384d004$exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any +function $bbb9dac42384d004$var$exportVariable(name, val) { + const convertedVal = $1f87556d0f647bcd$exports.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + const delimiter = "_GitHubActionsFileCommandDelimeter_"; + const commandValue = `${name}<<${delimiter}${$bbb9dac42384d004$var$os.EOL}${convertedVal}${$bbb9dac42384d004$var$os.EOL}${delimiter}`; + $71d1c579b85cee7b$exports.issueCommand("ENV", commandValue); + } else $6aa988ea1669fe85$exports.issueCommand("set-env", { + name: name + }, convertedVal); +} +$bbb9dac42384d004$exports.exportVariable = $bbb9dac42384d004$var$exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ function $bbb9dac42384d004$var$setSecret(secret) { + $6aa988ea1669fe85$exports.issueCommand("add-mask", {}, secret); +} +$bbb9dac42384d004$exports.setSecret = $bbb9dac42384d004$var$setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ function $bbb9dac42384d004$var$addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) $71d1c579b85cee7b$exports.issueCommand("PATH", inputPath); + else $6aa988ea1669fe85$exports.issueCommand("add-path", {}, inputPath); + process.env["PATH"] = `${inputPath}${$bbb9dac42384d004$var$path.delimiter}${process.env["PATH"]}`; +} +$bbb9dac42384d004$exports.addPath = $bbb9dac42384d004$var$addPath; +/** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ function $bbb9dac42384d004$var$getInput(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) throw new Error(`Input required and not supplied: ${name}`); + if (options && options.trimWhitespace === false) return val; + return val.trim(); +} +$bbb9dac42384d004$exports.getInput = $bbb9dac42384d004$var$getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ function $bbb9dac42384d004$var$getMultilineInput(name, options) { + const inputs = $bbb9dac42384d004$var$getInput(name, options).split("\n").filter((x)=>x !== ""); + return inputs; +} +$bbb9dac42384d004$exports.getMultilineInput = $bbb9dac42384d004$var$getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ function $bbb9dac42384d004$var$getBooleanInput(name, options) { + const trueValue = [ + "true", + "True", + "TRUE" + ]; + const falseValue = [ + "false", + "False", + "FALSE" + ]; + const val = $bbb9dac42384d004$var$getInput(name, options); + if (trueValue.includes(val)) return true; + if (falseValue.includes(val)) return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +$bbb9dac42384d004$exports.getBooleanInput = $bbb9dac42384d004$var$getBooleanInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any +function $bbb9dac42384d004$var$setOutput(name, value) { + process.stdout.write($bbb9dac42384d004$var$os.EOL); + $6aa988ea1669fe85$exports.issueCommand("set-output", { + name: name + }, value); +} +$bbb9dac42384d004$exports.setOutput = $bbb9dac42384d004$var$setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ function $bbb9dac42384d004$var$setCommandEcho(enabled) { + $6aa988ea1669fe85$exports.issue("echo", enabled ? "on" : "off"); +} +$bbb9dac42384d004$exports.setCommandEcho = $bbb9dac42384d004$var$setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ function $bbb9dac42384d004$var$setFailed(message) { + process.exitCode = $bbb9dac42384d004$var$ExitCode.Failure; + $bbb9dac42384d004$var$error(message); +} +$bbb9dac42384d004$exports.setFailed = $bbb9dac42384d004$var$setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ function $bbb9dac42384d004$var$isDebug() { + return process.env["RUNNER_DEBUG"] === "1"; +} +$bbb9dac42384d004$exports.isDebug = $bbb9dac42384d004$var$isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ function $bbb9dac42384d004$var$debug(message) { + $6aa988ea1669fe85$exports.issueCommand("debug", {}, message); +} +$bbb9dac42384d004$exports.debug = $bbb9dac42384d004$var$debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ function $bbb9dac42384d004$var$error(message, properties = {}) { + $6aa988ea1669fe85$exports.issueCommand("error", $1f87556d0f647bcd$exports.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +$bbb9dac42384d004$exports.error = $bbb9dac42384d004$var$error; +/** + * Adds a warning issue + * @param message warning issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ function $bbb9dac42384d004$var$warning(message, properties = {}) { + $6aa988ea1669fe85$exports.issueCommand("warning", $1f87556d0f647bcd$exports.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +$bbb9dac42384d004$exports.warning = $bbb9dac42384d004$var$warning; +/** + * Adds a notice issue + * @param message notice issue message. Errors will be converted to string via toString() + * @param properties optional properties to add to the annotation. + */ function $bbb9dac42384d004$var$notice(message, properties = {}) { + $6aa988ea1669fe85$exports.issueCommand("notice", $1f87556d0f647bcd$exports.toCommandProperties(properties), message instanceof Error ? message.toString() : message); +} +$bbb9dac42384d004$exports.notice = $bbb9dac42384d004$var$notice; +/** + * Writes info to log with console.log. + * @param message info message + */ function $bbb9dac42384d004$var$info(message) { + process.stdout.write(message + $bbb9dac42384d004$var$os.EOL); +} +$bbb9dac42384d004$exports.info = $bbb9dac42384d004$var$info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ function $bbb9dac42384d004$var$startGroup(name) { + $6aa988ea1669fe85$exports.issue("group", name); +} +$bbb9dac42384d004$exports.startGroup = $bbb9dac42384d004$var$startGroup; +/** + * End an output group. + */ function $bbb9dac42384d004$var$endGroup() { + $6aa988ea1669fe85$exports.issue("endgroup"); +} +$bbb9dac42384d004$exports.endGroup = $bbb9dac42384d004$var$endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ function $bbb9dac42384d004$var$group(name, fn) { + return $bbb9dac42384d004$var$__awaiter(this, void 0, void 0, function*() { + $bbb9dac42384d004$var$startGroup(name); + let result; + try { + result = yield fn(); + } finally{ + $bbb9dac42384d004$var$endGroup(); + } + return result; + }); +} +$bbb9dac42384d004$exports.group = $bbb9dac42384d004$var$group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ // eslint-disable-next-line @typescript-eslint/no-explicit-any +function $bbb9dac42384d004$var$saveState(name, value) { + $6aa988ea1669fe85$exports.issueCommand("save-state", { + name: name + }, value); +} +$bbb9dac42384d004$exports.saveState = $bbb9dac42384d004$var$saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ function $bbb9dac42384d004$var$getState(name) { + return process.env[`STATE_${name}`] || ""; +} +$bbb9dac42384d004$exports.getState = $bbb9dac42384d004$var$getState; + + function $76d06fcdc9bff1f5$export$77714ac6976d0316(args) { - return (0, $ec42a3295e12ea98$export$2e2bcd8739ae039)(args, { + const opts = (0, $ec42a3295e12ea98$export$2e2bcd8739ae039)(args, { default: { - "cache-map": $76d06fcdc9bff1f5$var$getInput("cache-map"), - "scratch-dir": $76d06fcdc9bff1f5$var$getInput("scratch-dir"), - "skip-extraction": $76d06fcdc9bff1f5$var$getInput("skip-extraction") === "true", + "cache-map": (0, $bbb9dac42384d004$exports.getInput)("cache-map"), + "scratch-dir": (0, $bbb9dac42384d004$exports.getInput)("scratch-dir"), + "skip-extraction": (0, $bbb9dac42384d004$exports.getInput)("skip-extraction") === "true", "extract": process.env[`STATE_POST`] !== undefined }, string: [ "cache-map", - "scratch-dir" + "scratch-dir", + "cache-source", + "cache-target" ], boolean: [ "skip-extraction", @@ -217,6 +706,13 @@ function $76d06fcdc9bff1f5$export$77714ac6976d0316(args) { ] } }); + if (opts["cache-source"] && opts["cache-target"]) { + (0, $bbb9dac42384d004$exports.warning)("The `cache-source` and `cache-target` options are deprecated. Use `cache-map` instead."); + opts["cache-map"] = JSON.stringify({ + [opts["cache-source"]]: opts["cache-target"] + }); + } + return opts; } function $76d06fcdc9bff1f5$export$34512e3b2db52a4e() { console.log(`build-cache-dance [options] @@ -230,12 +726,6 @@ Options: --help Show this help `); } -/** - * Get the action input value from the environment (INPUT_NAME) - */ function $76d06fcdc9bff1f5$var$getInput(name) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - return val.trim(); -} function $76d06fcdc9bff1f5$export$8550a4d7282a21d0(opts) { try { return JSON.parse(opts["cache-map"]); @@ -698,22 +1188,22 @@ function $4c028fad90f63861$export$889ea624f2cb2c57(command, args) { async function $bd1d73aff0732146$var$injectCache(cacheSource, cacheTarget, scratchDir) { // Clean Scratch Directory - await $evV72$rm(scratchDir, { + await (0, $evV72$fspromises).rm(scratchDir, { recursive: true, force: true }); - await $evV72$mkdir(scratchDir, { + await (0, $evV72$fspromises).mkdir(scratchDir, { recursive: true }); // Prepare Cache Source Directory - await $evV72$mkdir(cacheSource, { + await (0, $evV72$fspromises).mkdir(cacheSource, { recursive: true }); // Prepare Timestamp for Layer Cache Busting const { stdout: date } = await (0, $4c028fad90f63861$export$889ea624f2cb2c57)("date", [ "--iso=ns" ]); - await $evV72$writeFile($evV72$join(cacheSource, "buildstamp"), date); + await (0, $evV72$fspromises).writeFile((0, $evV72$path).join(cacheSource, "buildstamp"), date); // Prepare Dancefile to Access Caches const dancefileContent = ` FROM busybox:1 @@ -722,20 +1212,20 @@ RUN --mount=type=cache,target=${cacheTarget} \ --mount=type=bind,source=.,target=/var/dance-cache \ cp -p -R /var/dance-cache/. ${cacheTarget} || true `; - await $evV72$writeFile($evV72$join(scratchDir, "Dancefile.inject"), dancefileContent); + await (0, $evV72$fspromises).writeFile((0, $evV72$path).join(scratchDir, "Dancefile.inject"), dancefileContent); console.log(dancefileContent); // Inject Data into Docker Cache await (0, $4c028fad90f63861$export$889ea624f2cb2c57)("docker", [ "buildx", "build", "-f", - $evV72$join(scratchDir, "Dancefile.inject"), + (0, $evV72$path).join(scratchDir, "Dancefile.inject"), "--tag", "dance:inject", cacheSource ]); // Clean Directories - await $evV72$rm(cacheSource, { + await (0, $evV72$fspromises).rm(cacheSource, { recursive: true, force: true }); @@ -757,7 +1247,7 @@ async function $8d40300f3635b768$var$extractCache(cacheSource, cacheTarget, scra const { stdout: date } = await (0, $4c028fad90f63861$export$889ea624f2cb2c57)("date", [ "--iso=ns" ]); - await $evV72$writeFile($evV72$join(scratchDir, "buildstamp"), date); + await (0, $evV72$fspromises).writeFile((0, $evV72$path).join(scratchDir, "buildstamp"), date); // Prepare Dancefile to Access Caches const dancefileContent = ` FROM busybox:1 @@ -766,14 +1256,14 @@ RUN --mount=type=cache,target=${cacheTarget} \ mkdir -p /var/dance-cache/ \ && cp -p -R ${cacheTarget}/. /var/dance-cache/ || true `; - await $evV72$writeFile($evV72$join(scratchDir, "Dancefile.extract"), dancefileContent); + await (0, $evV72$fspromises).writeFile((0, $evV72$path).join(scratchDir, "Dancefile.extract"), dancefileContent); console.log(dancefileContent); // Extract Data into Docker Image await (0, $4c028fad90f63861$export$889ea624f2cb2c57)("docker", [ "buildx", "build", "-f", - $evV72$join(scratchDir, "Dancefile.extract"), + (0, $evV72$path).join(scratchDir, "Dancefile.extract"), "--tag", "dance:extract", "--load", @@ -803,7 +1293,7 @@ RUN --mount=type=cache,target=${cacheTarget} \ "cache-container:/var/dance-cache", "-" ]); - await $evV72$writeFile($evV72$join(scratchDir, "dance-cache.tar"), tarOutput); + await (0, $evV72$fspromises).writeFile((0, $evV72$path).join(scratchDir, "dance-cache.tar"), tarOutput); await (0, $4c028fad90f63861$export$889ea624f2cb2c57)("tar", [ "-H", "posix", @@ -811,14 +1301,14 @@ RUN --mount=type=cache,target=${cacheTarget} \ "-C", scratchDir, "-f", - $evV72$join(scratchDir, "dance-cache.tar") + (0, $evV72$path).join(scratchDir, "dance-cache.tar") ]); // Move Cache into Its Place - await $evV72$rm(cacheSource, { + await (0, $evV72$fspromises).rm(cacheSource, { recursive: true, force: true }); - await $evV72$rename($evV72$join(scratchDir, "dance-cache"), cacheSource); + await (0, $evV72$fspromises).rename((0, $evV72$path).join(scratchDir, "dance-cache"), cacheSource); } async function $8d40300f3635b768$export$bd3cfa0c41fc7012(opts) { if (opts["skip-extraction"]) { @@ -837,10 +1327,10 @@ async function $bec5d2ddaaf4a876$var$main(args) { const opts = (0, $76d06fcdc9bff1f5$export$77714ac6976d0316)(args); if (opts.help) return (0, $76d06fcdc9bff1f5$export$34512e3b2db52a4e)(); if (opts.extract) // Run the post step - (0, $8d40300f3635b768$export$bd3cfa0c41fc7012)(opts); + await (0, $8d40300f3635b768$export$bd3cfa0c41fc7012)(opts); else { // Otherwise, this is the main step - if (process.env.GITHUB_STATE !== undefined) await (0, $evV72$appendFile)(process.env.GITHUB_STATE, `POST=true${(0, $evV72$EOL)}`); + if (process.env.GITHUB_STATE !== undefined) await (0, $evV72$fspromises).appendFile(process.env.GITHUB_STATE, `POST=true${(0, $evV72$os).EOL}`); await (0, $bd1d73aff0732146$export$38c65e9f06d3d433)(opts); } } diff --git a/dist/index.js.map b/dist/index.js.map index 37fd076..d927f47 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,4BAAM,IAAI,GAAG;;AAIb,SAAS,mCAAc,IAAI,EAAE,OAAO;IAClC,IAAI,UAAU,QAAQ,OAAO,KAAK,YAChC,QAAQ,OAAO,GAAG,QAAQ,GAAG,CAAC,OAAO;IAEvC,IAAI,CAAC,SACH,OAAO;IAGT,UAAU,QAAQ,KAAK,CAAC;IACxB,IAAI,QAAQ,OAAO,CAAC,QAAQ,IAC1B,OAAO;IAET,IAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,MAAM,EAAE,IAAK;QACvC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,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,CAAA,GAAA,yCAAG;IAGZ,IAAI,KAAK,OAAO,EACd,oBAAoB;IACpB,CAAA,GAAA,yCAAY,EAAE;SACT;QACL,mCAAmC;QACnC,IAAI,QAAQ,GAAG,CAAC,YAAY,KAAK,WAC/B,MAAM,CAAA,GAAA,iBAAS,EAAE,QAAQ,GAAG,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAA,GAAA,UAAE,EAAE,CAAC;QAE9D,MAAM,CAAA,GAAA,yCAAW,EAAE;IACrB;AACF;AAEA,MAAM,2BAAK,QAAQ,IAAI","sources":["node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","src/index.ts","src/inject-cache.ts","src/opts.ts","node_modules/.pnpm/mri@1.2.0/node_modules/mri/lib/index.mjs","src/run.ts","node_modules/.pnpm/spawn-please@3.0.0/node_modules/spawn-please/src/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js","node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js","node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js","node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js","src/extract-cache.ts"],"sourcesContent":["module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","import { appendFile } from \"fs/promises\";\nimport { EOL } from \"os\";\nimport { injectCaches } from \"./inject-cache.js\";\nimport { extractCaches } from \"./extract-cache.js\";\nimport { help, parseOpts } from \"./opts.js\";\n\nasync function main(args: string[]) {\n const opts = parseOpts(args);\n\n if (opts.help) {\n return help();\n }\n\n if (opts.extract) {\n // Run the post step\n extractCaches(opts);\n } else {\n // Otherwise, this is the main step\n if (process.env.GITHUB_STATE !== undefined) {\n await appendFile(process.env.GITHUB_STATE, `POST=true${EOL}`);\n }\n await injectCaches(opts);\n }\n}\n\nawait main(process.argv);\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { Opts, getCacheMap } from './opts.js';\nimport { run } from './run.js';\n\nasync function injectCache(cacheSource: string, cacheTarget: string, scratchDir: string) {\n // Clean Scratch Directory\n await fs.rm(scratchDir, { recursive: true, force: true });\n await fs.mkdir(scratchDir, { recursive: true });\n\n // Prepare Cache Source Directory\n await fs.mkdir(cacheSource, { recursive: true });\n\n // Prepare Timestamp for Layer Cache Busting\n const { stdout: date } = await run('date', ['--iso=ns']);\n await fs.writeFile(path.join(cacheSource, 'buildstamp'), date);\n\n // Prepare Dancefile to Access Caches\n const dancefileContent = `\nFROM busybox:1\nCOPY buildstamp buildstamp\nRUN --mount=type=cache,target=${cacheTarget} \\\n --mount=type=bind,source=.,target=/var/dance-cache \\\n cp -p -R /var/dance-cache/. ${cacheTarget} || true\n`;\n await fs.writeFile(path.join(scratchDir, 'Dancefile.inject'), dancefileContent);\n console.log(dancefileContent);\n\n // Inject Data into Docker Cache\n await run('docker', ['buildx', 'build', '-f', path.join(scratchDir, 'Dancefile.inject'), '--tag', 'dance:inject', cacheSource]);\n\n // Clean Directories\n await fs.rm(cacheSource, { recursive: true, force: true });\n}\n\n\nexport async function injectCaches(opts: Opts) {\n const cacheMap = getCacheMap(opts);\n const scratchDir = opts['scratch-dir'];\n\n // Inject Caches for each source-target pair\n for (const [cacheSource, cacheTarget] of Object.entries(cacheMap)) {\n await injectCache(cacheSource, cacheTarget, scratchDir);\n }\n}\n","import mri from 'mri';\n\nexport type Opts = {\n \"extract\": boolean\n \"cache-map\": string\n \"scratch-dir\": string\n \"skip-extraction\": boolean\n help: boolean\n}\n\nexport function parseOpts(args: string[]): mri.Argv {\n return mri(args, {\n default: {\n \"cache-map\": getInput(\"cache-map\"),\n \"scratch-dir\": getInput(\"scratch-dir\"),\n \"skip-extraction\": getInput(\"skip-extraction\") === \"true\",\n \"extract\": process.env[`STATE_POST`] !== undefined,\n },\n string: [\"cache-map\", \"scratch-dir\"],\n boolean: [\"skip-extraction\", \"help\", \"extract\"],\n alias: {\n \"help\": [\"h\"],\n },\n })\n}\n\nexport function help() {\n console.log(`build-cache-dance [options]\nSave 'RUN --mount=type=cache' caches on GitHub Actions or other CI platforms\n\nOptions:\n --extract Extract the cache from the docker container (extract step). Otherwise, inject the cache (main step)\n --cache-map The map of actions source to container destination paths for the cache paths\n --scratch-dir Where the action is stores some temporary files for its processing. Default: 'scratch'\n --skip-extraction Skip the extraction of the cache from the docker container\n --help Show this help\n`);\n}\n\n/**\n * Get the action input value from the environment (INPUT_NAME)\n */\nfunction getInput(name: string) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n return val.trim();\n}\n\nexport function getCacheMap(opts: Opts): Record {\n try {\n return JSON.parse(opts[\"cache-map\"]) as Record;\n } catch (e) {\n throw new Error(`Failed to parse cache map. Expected JSON, got:\\n${opts[\"cache-map\"]}\\n${e}`);\n }\n}\n","function toArr(any) {\n\treturn any == null ? [] : Array.isArray(any) ? any : [any];\n}\n\nfunction toVal(out, key, val, opts) {\n\tvar x, old=out[key], nxt=(\n\t\t!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))\n\t\t: typeof val === 'boolean' ? val\n\t\t: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))\n\t\t: (x = +val,x * 0 === 0) ? x : val\n\t);\n\tout[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);\n}\n\nexport default function (args, opts) {\n\targs = args || [];\n\topts = opts || {};\n\n\tvar k, arr, arg, name, val, out={ _:[] };\n\tvar i=0, j=0, idx=0, len=args.length;\n\n\tconst alibi = opts.alias !== void 0;\n\tconst strict = opts.unknown !== void 0;\n\tconst defaults = opts.default !== void 0;\n\n\topts.alias = opts.alias || {};\n\topts.string = toArr(opts.string);\n\topts.boolean = toArr(opts.boolean);\n\n\tif (alibi) {\n\t\tfor (k in opts.alias) {\n\t\t\tarr = opts.alias[k] = toArr(opts.alias[k]);\n\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i=opts.boolean.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.boolean[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);\n\t}\n\n\tfor (i=opts.string.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.string[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.string.push(arr[j]);\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tname = typeof opts.default[k];\n\t\t\tarr = opts.alias[k] = opts.alias[k] || [];\n\t\t\tif (opts[name] !== void 0) {\n\t\t\t\topts[name].push(k);\n\t\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t\topts[name].push(arr[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst keys = strict ? Object.keys(opts.alias) : [];\n\n\tfor (i=0; i < len; i++) {\n\t\targ = args[i];\n\n\t\tif (arg === '--') {\n\t\t\tout._ = out._.concat(args.slice(++i));\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (j=0; j < arg.length; j++) {\n\t\t\tif (arg.charCodeAt(j) !== 45) break; // \"-\"\n\t\t}\n\n\t\tif (j === 0) {\n\t\t\tout._.push(arg);\n\t\t} else if (arg.substring(j, j + 3) === 'no-') {\n\t\t\tname = arg.substring(j + 3);\n\t\t\tif (strict && !~keys.indexOf(name)) {\n\t\t\t\treturn opts.unknown(arg);\n\t\t\t}\n\t\t\tout[name] = false;\n\t\t} else {\n\t\t\tfor (idx=j+1; idx < arg.length; idx++) {\n\t\t\t\tif (arg.charCodeAt(idx) === 61) break; // \"=\"\n\t\t\t}\n\n\t\t\tname = arg.substring(j, idx);\n\t\t\tval = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);\n\t\t\tarr = (j === 2 ? [name] : name);\n\n\t\t\tfor (idx=0; idx < arr.length; idx++) {\n\t\t\t\tname = arr[idx];\n\t\t\t\tif (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);\n\t\t\t\ttoVal(out, name, (idx + 1 < arr.length) || val, opts);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tif (out[k] === void 0) {\n\t\t\t\tout[k] = opts.default[k];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alibi) {\n\t\tfor (k in out) {\n\t\t\tarr = opts.alias[k] || [];\n\t\t\twhile (arr.length > 0) {\n\t\t\t\tout[arr.shift()] = out[k];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn out;\n}\n","import spawn from 'spawn-please'\n\nexport function run(command: string, args: string[]) {\n return spawn(command, args, {}, { stdout: 'inherit' });\n}\n","const spawn = require('cross-spawn')\n\n/** Spawns a child process, as long as you ask nicely.\n * \n * @param {string} command - The shell command to execute.\n * @param {string[]} [args] - An array of arguments that are given after the command.\n * @param {{ rejectOnError?: boolean, stdin?: string, stderr?: (data: string) => void, stdout?: (data: string) => void }} [options] - Options.\n * @param {any} [spawnOptions] - Options that are passed directly to child_process.spawn. Also supports stdin: string.\n * @returns {Promise<{ stdout: string, stderr: string }>}\n */\nconst spawnPlease = (command, args, options={}, spawnOptions={}) => {\n // defaults\n if (options.rejectOnError === undefined) {\n options.rejectOnError = true\n }\n\n let stdout = ''\n let stderr = ''\n const child = spawn(command, args, spawnOptions)\n\n return new Promise((resolve, reject) => {\n if (options.stdin !== undefined && options.stdin != null) {\n child.stdin.write(options.stdin)\n }\n child.stdin.end()\n\n child.stdout.on('data', data => {\n stdout += data\n if (options.stdout) options.stdout(data)\n })\n\n child.stderr.on('data', data => {\n stderr += data\n if (options.stderr) options.stderr(data)\n })\n\n if (options.rejectOnError) {\n child.addListener('error', reject)\n }\n\n child.on('close', code => {\n if (code !== 0 && options.rejectOnError) {\n reject(stderr)\n } else {\n resolve({ stdout, stderr })\n }\n })\n })\n}\n\nmodule.exports = spawnPlease\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(\\\\*)$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed, 'spawn');\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","import * as fs from 'fs/promises';\nimport * as path from 'path';\nimport { Opts, getCacheMap } from './opts.js';\nimport { run } from './run.js';\n\nasync function extractCache(cacheSource: string, cacheTarget: string, scratchDir: string) {\n // Prepare Timestamp for Layer Cache Busting\n const { stdout: date } = await run('date', ['--iso=ns']);\n await fs.writeFile(path.join(scratchDir, 'buildstamp'), date);\n\n // Prepare Dancefile to Access Caches\n const dancefileContent = `\nFROM busybox:1\nCOPY buildstamp buildstamp\nRUN --mount=type=cache,target=${cacheTarget} \\\n mkdir -p /var/dance-cache/ \\\n && cp -p -R ${cacheTarget}/. /var/dance-cache/ || true\n`;\n await fs.writeFile(path.join(scratchDir, 'Dancefile.extract'), dancefileContent);\n console.log(dancefileContent);\n\n // Extract Data into Docker Image\n await run('docker', ['buildx', 'build', '-f', path.join(scratchDir, 'Dancefile.extract'), '--tag', 'dance:extract', '--load', scratchDir]);\n\n // Create Extraction Image\n try {\n await run('docker', ['rm', '-f', 'cache-container']);\n } catch (error) {\n // Ignore error if container does not exist\n }\n await run('docker', ['create', '-ti', '--name', 'cache-container', 'dance:extract']);\n\n // Unpack Docker Image into Scratch\n const { stdout: tarOutput } = await run('docker', ['cp', '-L', 'cache-container:/var/dance-cache', '-']);\n await fs.writeFile(path.join(scratchDir, 'dance-cache.tar'), tarOutput);\n await run('tar', ['-H', 'posix', '-x', '-C', scratchDir, '-f', path.join(scratchDir, 'dance-cache.tar')]);\n\n // Move Cache into Its Place\n await fs.rm(cacheSource, { recursive: true, force: true });\n await fs.rename(path.join(scratchDir, 'dance-cache'), cacheSource);\n}\n\nexport async function extractCaches(opts: Opts) {\n if (opts[\"skip-extraction\"]) {\n console.log(\"skip-extraction is set. Skipping extraction step...\");\n return;\n }\n\n const cacheMap = getCacheMap(opts);\n const scratchDir = opts['scratch-dir'];\n\n // Extract Caches for each source-target pair\n for (const [cacheSource, cacheTarget] of Object.entries(cacheMap)) {\n await extractCache(cacheSource, cacheTarget, scratchDir);\n }\n}\n"],"names":[],"version":3,"file":"index.js.map","sourceRoot":"../"} \ No newline at end of file +{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAiB;AACjB,4BAAM,IAAI,GAAG;;AAIb,SAAS,mCAAc,IAAI,EAAE,OAAO;IAClC,IAAI,UAAU,QAAQ,OAAO,KAAK,YAChC,QAAQ,OAAO,GAAG,QAAQ,GAAG,CAAC,OAAO;IAEvC,IAAI,CAAC,SACH,OAAO;IAGT,UAAU,QAAQ,KAAK,CAAC;IACxB,IAAI,QAAQ,OAAO,CAAC,QAAQ,IAC1B,OAAO;IAET,IAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,MAAM,EAAE,IAAK;QACvC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,WAAW;QAC9B,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,OAAO,GAChD,OAAO;IAEX;IACA,OAAO;AACT;AAEA,SAAS,gCAAW,IAAI,EAAE,IAAI,EAAE,OAAO;IACrC,IAAI,CAAC,KAAK,cAAc,MAAM,CAAC,KAAK,MAAM,IACxC,OAAO;IAET,OAAO,mCAAa,MAAM;AAC5B;AAEA,SAAS,4BAAO,IAAI,EAAE,OAAO,EAAE,EAAE;IAC/B,YAAQ,MAAM,SAAU,EAAE,EAAE,IAAI;QAC9B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AAC;QACZ;IACJ;IAEA,MAAM,WAAW,CAAA,GAAA,yCAAU,EAAE;IAC7B,MAAM,aAAa,IAAI,CAAC,cAAc;IAEtC,6CAA6C;IAC7C,KAAK,MAAM,CAAC,aAAa,YAAY,IAAI,OAAO,OAAO,CAAC,UACpD,MAAM,mCAAa,aAAa,aAAa;AAErD;;;;AzBjDA,eAAe,2BAAK,IAAc;IAChC,MAAM,OAAO,CAAA,GAAA,yCAAQ,EAAE;IAEvB,IAAI,KAAK,IAAI,EACX,OAAO,CAAA,GAAA,yCAAG;IAGZ,IAAI,KAAK,OAAO,EACd,oBAAoB;IACpB,MAAM,CAAA,GAAA,yCAAY,EAAE;SACf;QACL,mCAAmC;QACnC,IAAI,QAAQ,GAAG,CAAC,YAAY,KAAK,WAC/B,MAAM,CAAA,GAAA,iBAAC,EAAE,UAAU,CAAC,QAAQ,GAAG,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAA,GAAA,SAAC,EAAE,GAAG,CAAC,CAAC;QAEpE,MAAM,CAAA,GAAA,yCAAW,EAAE;IACrB;AACF;AAEA,MAAM,2BAAK,QAAQ,IAAI","sources":["node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js","node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js","src/index.ts","src/inject-cache.ts","src/opts.ts","node_modules/.pnpm/mri@1.2.0/node_modules/mri/lib/index.mjs","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/lib/core.js","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/src/core.ts","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/lib/command.js","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/src/command.ts","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/lib/utils.js","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/src/utils.ts","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/lib/file-command.js","node_modules/.pnpm/@actions+core@1.5.0/node_modules/@actions/core/src/file-command.ts","src/run.ts","node_modules/.pnpm/spawn-please@3.0.0/node_modules/spawn-please/src/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/parse.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/resolveCommand.js","node_modules/.pnpm/which@2.0.2/node_modules/which/which.js","node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js","node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/escape.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/util/readShebang.js","node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js","node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js","node_modules/.pnpm/cross-spawn@7.0.3/node_modules/cross-spawn/lib/enoent.js","src/extract-cache.ts"],"sourcesContent":["module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","import fs from \"fs/promises\";\nimport os from \"os\";\nimport { injectCaches } from \"./inject-cache.js\";\nimport { extractCaches } from \"./extract-cache.js\";\nimport { help, parseOpts } from \"./opts.js\";\n\nasync function main(args: string[]) {\n const opts = parseOpts(args);\n\n if (opts.help) {\n return help();\n }\n\n if (opts.extract) {\n // Run the post step\n await extractCaches(opts);\n } else {\n // Otherwise, this is the main step\n if (process.env.GITHUB_STATE !== undefined) {\n await fs.appendFile(process.env.GITHUB_STATE, `POST=true${os.EOL}`);\n }\n await injectCaches(opts);\n }\n}\n\nawait main(process.argv);\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { Opts, getCacheMap } from './opts.js';\nimport { run } from './run.js';\n\nasync function injectCache(cacheSource: string, cacheTarget: string, scratchDir: string) {\n // Clean Scratch Directory\n await fs.rm(scratchDir, { recursive: true, force: true });\n await fs.mkdir(scratchDir, { recursive: true });\n\n // Prepare Cache Source Directory\n await fs.mkdir(cacheSource, { recursive: true });\n\n // Prepare Timestamp for Layer Cache Busting\n const { stdout: date } = await run('date', ['--iso=ns']);\n await fs.writeFile(path.join(cacheSource, 'buildstamp'), date);\n\n // Prepare Dancefile to Access Caches\n const dancefileContent = `\nFROM busybox:1\nCOPY buildstamp buildstamp\nRUN --mount=type=cache,target=${cacheTarget} \\\n --mount=type=bind,source=.,target=/var/dance-cache \\\n cp -p -R /var/dance-cache/. ${cacheTarget} || true\n`;\n await fs.writeFile(path.join(scratchDir, 'Dancefile.inject'), dancefileContent);\n console.log(dancefileContent);\n\n // Inject Data into Docker Cache\n await run('docker', ['buildx', 'build', '-f', path.join(scratchDir, 'Dancefile.inject'), '--tag', 'dance:inject', cacheSource]);\n\n // Clean Directories\n await fs.rm(cacheSource, { recursive: true, force: true });\n}\n\n\nexport async function injectCaches(opts: Opts) {\n const cacheMap = getCacheMap(opts);\n const scratchDir = opts['scratch-dir'];\n\n // Inject Caches for each source-target pair\n for (const [cacheSource, cacheTarget] of Object.entries(cacheMap)) {\n await injectCache(cacheSource, cacheTarget, scratchDir);\n }\n}\n","import mri from 'mri';\nimport { getInput, warning } from '@actions/core';\n\nexport type Opts = {\n \"extract\": boolean\n \"cache-map\": string\n \"scratch-dir\": string\n \"skip-extraction\": boolean\n help: boolean\n /** @deprecated Use `cache-map` instead */\n \"cache-source\"?: string\n /** @deprecated Use `cache-map` instead */\n \"cache-target\"?: string\n}\n\nexport function parseOpts(args: string[]): mri.Argv {\n const opts = mri(args, {\n default: {\n \"cache-map\": getInput(\"cache-map\"),\n \"scratch-dir\": getInput(\"scratch-dir\"),\n \"skip-extraction\": getInput(\"skip-extraction\") === \"true\",\n \"extract\": process.env[`STATE_POST`] !== undefined,\n },\n string: [\"cache-map\", \"scratch-dir\", \"cache-source\", \"cache-target\"],\n boolean: [\"skip-extraction\", \"help\", \"extract\"],\n alias: {\n \"help\": [\"h\"],\n },\n })\n\n if (opts[\"cache-source\"] && opts[\"cache-target\"]) {\n warning(\"The `cache-source` and `cache-target` options are deprecated. Use `cache-map` instead.\")\n\n opts[\"cache-map\"] = JSON.stringify({\n [opts[\"cache-source\"]]: opts[\"cache-target\"],\n });\n }\n\n return opts;\n}\n\nexport function help() {\n console.log(`build-cache-dance [options]\nSave 'RUN --mount=type=cache' caches on GitHub Actions or other CI platforms\n\nOptions:\n --extract Extract the cache from the docker container (extract step). Otherwise, inject the cache (main step)\n --cache-map The map of actions source to container destination paths for the cache paths\n --scratch-dir Where the action is stores some temporary files for its processing. Default: 'scratch'\n --skip-extraction Skip the extraction of the cache from the docker container\n --help Show this help\n`);\n}\n\nexport function getCacheMap(opts: Opts): Record {\n try {\n return JSON.parse(opts[\"cache-map\"]) as Record;\n } catch (e) {\n throw new Error(`Failed to parse cache map. Expected JSON, got:\\n${opts[\"cache-map\"]}\\n${e}`);\n }\n}\n","function toArr(any) {\n\treturn any == null ? [] : Array.isArray(any) ? any : [any];\n}\n\nfunction toVal(out, key, val, opts) {\n\tvar x, old=out[key], nxt=(\n\t\t!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))\n\t\t: typeof val === 'boolean' ? val\n\t\t: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))\n\t\t: (x = +val,x * 0 === 0) ? x : val\n\t);\n\tout[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);\n}\n\nexport default function (args, opts) {\n\targs = args || [];\n\topts = opts || {};\n\n\tvar k, arr, arg, name, val, out={ _:[] };\n\tvar i=0, j=0, idx=0, len=args.length;\n\n\tconst alibi = opts.alias !== void 0;\n\tconst strict = opts.unknown !== void 0;\n\tconst defaults = opts.default !== void 0;\n\n\topts.alias = opts.alias || {};\n\topts.string = toArr(opts.string);\n\topts.boolean = toArr(opts.boolean);\n\n\tif (alibi) {\n\t\tfor (k in opts.alias) {\n\t\t\tarr = opts.alias[k] = toArr(opts.alias[k]);\n\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i=opts.boolean.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.boolean[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);\n\t}\n\n\tfor (i=opts.string.length; i-- > 0;) {\n\t\tarr = opts.alias[opts.string[i]] || [];\n\t\tfor (j=arr.length; j-- > 0;) opts.string.push(arr[j]);\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tname = typeof opts.default[k];\n\t\t\tarr = opts.alias[k] = opts.alias[k] || [];\n\t\t\tif (opts[name] !== void 0) {\n\t\t\t\topts[name].push(k);\n\t\t\t\tfor (i=0; i < arr.length; i++) {\n\t\t\t\t\topts[name].push(arr[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst keys = strict ? Object.keys(opts.alias) : [];\n\n\tfor (i=0; i < len; i++) {\n\t\targ = args[i];\n\n\t\tif (arg === '--') {\n\t\t\tout._ = out._.concat(args.slice(++i));\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (j=0; j < arg.length; j++) {\n\t\t\tif (arg.charCodeAt(j) !== 45) break; // \"-\"\n\t\t}\n\n\t\tif (j === 0) {\n\t\t\tout._.push(arg);\n\t\t} else if (arg.substring(j, j + 3) === 'no-') {\n\t\t\tname = arg.substring(j + 3);\n\t\t\tif (strict && !~keys.indexOf(name)) {\n\t\t\t\treturn opts.unknown(arg);\n\t\t\t}\n\t\t\tout[name] = false;\n\t\t} else {\n\t\t\tfor (idx=j+1; idx < arg.length; idx++) {\n\t\t\t\tif (arg.charCodeAt(idx) === 61) break; // \"=\"\n\t\t\t}\n\n\t\t\tname = arg.substring(j, idx);\n\t\t\tval = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);\n\t\t\tarr = (j === 2 ? [name] : name);\n\n\t\t\tfor (idx=0; idx < arr.length; idx++) {\n\t\t\t\tname = arr[idx];\n\t\t\t\tif (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);\n\t\t\t\ttoVal(out, name, (idx + 1 < arr.length) || val, opts);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (defaults) {\n\t\tfor (k in opts.default) {\n\t\t\tif (out[k] === void 0) {\n\t\t\t\tout[k] = opts.default[k];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alibi) {\n\t\tfor (k in out) {\n\t\t\tarr = opts.alias[k] || [];\n\t\t\twhile (arr.length > 0) {\n\t\t\t\tout[arr.shift()] = out[k];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn out;\n}\n",null,null,null,null,null,null,null,null,"import spawn from 'spawn-please'\n\nexport function run(command: string, args: string[]) {\n return spawn(command, args, {}, { stdout: 'inherit' });\n}\n","const spawn = require('cross-spawn')\n\n/** Spawns a child process, as long as you ask nicely.\n * \n * @param {string} command - The shell command to execute.\n * @param {string[]} [args] - An array of arguments that are given after the command.\n * @param {{ rejectOnError?: boolean, stdin?: string, stderr?: (data: string) => void, stdout?: (data: string) => void }} [options] - Options.\n * @param {any} [spawnOptions] - Options that are passed directly to child_process.spawn. Also supports stdin: string.\n * @returns {Promise<{ stdout: string, stderr: string }>}\n */\nconst spawnPlease = (command, args, options={}, spawnOptions={}) => {\n // defaults\n if (options.rejectOnError === undefined) {\n options.rejectOnError = true\n }\n\n let stdout = ''\n let stderr = ''\n const child = spawn(command, args, spawnOptions)\n\n return new Promise((resolve, reject) => {\n if (options.stdin !== undefined && options.stdin != null) {\n child.stdin.write(options.stdin)\n }\n child.stdin.end()\n\n child.stdout.on('data', data => {\n stdout += data\n if (options.stdout) options.stdout(data)\n })\n\n child.stderr.on('data', data => {\n stderr += data\n if (options.stderr) options.stderr(data)\n })\n\n if (options.rejectOnError) {\n child.addListener('error', reject)\n }\n\n child.on('close', code => {\n if (code !== 0 && options.rejectOnError) {\n reject(stderr)\n } else {\n resolve({ stdout, stderr })\n }\n })\n })\n}\n\nmodule.exports = spawnPlease\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(\\\\*)$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed, 'spawn');\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { Opts, getCacheMap } from './opts.js';\nimport { run } from './run.js';\n\nasync function extractCache(cacheSource: string, cacheTarget: string, scratchDir: string) {\n // Prepare Timestamp for Layer Cache Busting\n const { stdout: date } = await run('date', ['--iso=ns']);\n await fs.writeFile(path.join(scratchDir, 'buildstamp'), date);\n\n // Prepare Dancefile to Access Caches\n const dancefileContent = `\nFROM busybox:1\nCOPY buildstamp buildstamp\nRUN --mount=type=cache,target=${cacheTarget} \\\n mkdir -p /var/dance-cache/ \\\n && cp -p -R ${cacheTarget}/. /var/dance-cache/ || true\n`;\n await fs.writeFile(path.join(scratchDir, 'Dancefile.extract'), dancefileContent);\n console.log(dancefileContent);\n\n // Extract Data into Docker Image\n await run('docker', ['buildx', 'build', '-f', path.join(scratchDir, 'Dancefile.extract'), '--tag', 'dance:extract', '--load', scratchDir]);\n\n // Create Extraction Image\n try {\n await run('docker', ['rm', '-f', 'cache-container']);\n } catch (error) {\n // Ignore error if container does not exist\n }\n await run('docker', ['create', '-ti', '--name', 'cache-container', 'dance:extract']);\n\n // Unpack Docker Image into Scratch\n const { stdout: tarOutput } = await run('docker', ['cp', '-L', 'cache-container:/var/dance-cache', '-']);\n await fs.writeFile(path.join(scratchDir, 'dance-cache.tar'), tarOutput);\n await run('tar', ['-H', 'posix', '-x', '-C', scratchDir, '-f', path.join(scratchDir, 'dance-cache.tar')]);\n\n // Move Cache into Its Place\n await fs.rm(cacheSource, { recursive: true, force: true });\n await fs.rename(path.join(scratchDir, 'dance-cache'), cacheSource);\n}\n\nexport async function extractCaches(opts: Opts) {\n if (opts[\"skip-extraction\"]) {\n console.log(\"skip-extraction is set. Skipping extraction step...\");\n return;\n }\n\n const cacheMap = getCacheMap(opts);\n const scratchDir = opts['scratch-dir'];\n\n // Extract Caches for each source-target pair\n for (const [cacheSource, cacheTarget] of Object.entries(cacheMap)) {\n await extractCache(cacheSource, cacheTarget, scratchDir);\n }\n}\n"],"names":[],"version":3,"file":"index.js.map","sourceRoot":"../"} \ No newline at end of file diff --git a/package.json b/package.json index 92d7be2..f6ac45f 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,14 @@ "typescript": "^5.4.3" }, "dependencies": { + "@actions/core": "~1.5.0", "mri": "^1.2.0", "spawn-please": "^3.0.0" }, "targets": { "main": { - "includeNodeModules": true + "includeNodeModules": true, + "optimize": false } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 97a5794..c01fdac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@actions/core': + specifier: ~1.5.0 + version: 1.5.0 mri: specifier: ^1.2.0 version: 1.2.0 @@ -25,6 +28,10 @@ devDependencies: packages: + /@actions/core@1.5.0: + resolution: {integrity: sha512-eDOLH1Nq9zh+PJlYLqEMkS/jLQxhksPNmUGNBHfa4G+tQmnIhzpctxmchETtVGyBOvXgOVVpYuE40+eS4cUnwQ==} + dev: false + /@babel/code-frame@7.24.2: resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} diff --git a/src/extract-cache.ts b/src/extract-cache.ts index ec9eaad..74b078d 100644 --- a/src/extract-cache.ts +++ b/src/extract-cache.ts @@ -1,5 +1,5 @@ -import * as fs from 'fs/promises'; -import * as path from 'path'; +import fs from 'fs/promises'; +import path from 'path'; import { Opts, getCacheMap } from './opts.js'; import { run } from './run.js'; diff --git a/src/index.ts b/src/index.ts index f30ea7f..5cfee50 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -import { appendFile } from "fs/promises"; -import { EOL } from "os"; +import fs from "fs/promises"; +import os from "os"; import { injectCaches } from "./inject-cache.js"; import { extractCaches } from "./extract-cache.js"; import { help, parseOpts } from "./opts.js"; @@ -13,11 +13,11 @@ async function main(args: string[]) { if (opts.extract) { // Run the post step - extractCaches(opts); + await extractCaches(opts); } else { // Otherwise, this is the main step if (process.env.GITHUB_STATE !== undefined) { - await appendFile(process.env.GITHUB_STATE, `POST=true${EOL}`); + await fs.appendFile(process.env.GITHUB_STATE, `POST=true${os.EOL}`); } await injectCaches(opts); } diff --git a/src/inject-cache.ts b/src/inject-cache.ts index b764e48..33502e8 100644 --- a/src/inject-cache.ts +++ b/src/inject-cache.ts @@ -1,5 +1,5 @@ -import * as fs from 'fs/promises'; -import * as path from 'path'; +import fs from 'fs/promises'; +import path from 'path'; import { Opts, getCacheMap } from './opts.js'; import { run } from './run.js'; diff --git a/src/opts.ts b/src/opts.ts index 6d02f39..8f96f1d 100644 --- a/src/opts.ts +++ b/src/opts.ts @@ -1,4 +1,5 @@ import mri from 'mri'; +import { getInput, warning } from '@actions/core'; export type Opts = { "extract": boolean @@ -6,22 +7,36 @@ export type Opts = { "scratch-dir": string "skip-extraction": boolean help: boolean + /** @deprecated Use `cache-map` instead */ + "cache-source"?: string + /** @deprecated Use `cache-map` instead */ + "cache-target"?: string } export function parseOpts(args: string[]): mri.Argv { - return mri(args, { + const opts = mri(args, { default: { "cache-map": getInput("cache-map"), "scratch-dir": getInput("scratch-dir"), "skip-extraction": getInput("skip-extraction") === "true", "extract": process.env[`STATE_POST`] !== undefined, }, - string: ["cache-map", "scratch-dir"], + string: ["cache-map", "scratch-dir", "cache-source", "cache-target"], boolean: ["skip-extraction", "help", "extract"], alias: { "help": ["h"], }, }) + + if (opts["cache-source"] && opts["cache-target"]) { + warning("The `cache-source` and `cache-target` options are deprecated. Use `cache-map` instead.") + + opts["cache-map"] = JSON.stringify({ + [opts["cache-source"]]: opts["cache-target"], + }); + } + + return opts; } export function help() { @@ -37,14 +52,6 @@ Options: `); } -/** - * Get the action input value from the environment (INPUT_NAME) - */ -function getInput(name: string) { - const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; - return val.trim(); -} - export function getCacheMap(opts: Opts): Record { try { return JSON.parse(opts["cache-map"]) as Record;