Skip to content

Commit

Permalink
Versions bump. Node16 runtime upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Volkov committed Mar 9, 2022
1 parent 5c1747c commit 38ca618
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 63 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ branding:
color: blue
inputs:
skaffold-version:
default: 1.35.2
default: 1.36.1
description: Set Skaffold version
required: false
container-structure-test-version:
Expand Down Expand Up @@ -86,5 +86,5 @@ inputs:
required: false
description: The optional custom tag to use for images which overrides the current Tagger configuration
runs:
using: node12
using: node16
main: src/index.js
144 changes: 83 additions & 61 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3563,22 +3563,22 @@ var io_1 = __webpack_require__(1);
var exec_1 = __webpack_require__(986);
var core_1 = __webpack_require__(470);
function getBinDir(rootDir) {
return (0, path_1.join)(rootDir, 'bin');
return (0, path_1.join)(rootDir, "bin");
}
exports.getBinDir = getBinDir;
function getOsPlatform() {
return (0, os_1.platform)() === 'win32' ? 'windows' : (0, os_1.platform)().toLowerCase();
return (0, os_1.platform)() === "win32" ? "windows" : (0, os_1.platform)().toLowerCase();
}
exports.getOsPlatform = getOsPlatform;
function getWorkspaceDir() {
var _a;
return (_a = process.env.GITHUB_WORKSPACE) !== null && _a !== void 0 ? _a : (0, path_1.join)(__dirname, '..');
return (_a = process.env.GITHUB_WORKSPACE) !== null && _a !== void 0 ? _a : (0, path_1.join)(__dirname, "..");
}
exports.getWorkspaceDir = getWorkspaceDir;
function download(url, destination) {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var downloadPath, destinationDir;
return (0, tslib_1.__generator)(this, function (_a) {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, (0, tool_cache_1.downloadTool)(url)];
case 1:
Expand All @@ -3587,8 +3587,8 @@ function download(url, destination) {
return [4, (0, io_1.mkdirP)(destinationDir)];
case 2:
_a.sent();
if (!(url.endsWith('tar.gz') || url.endsWith('tar') || url.endsWith('tgz'))) return [3, 5];
return [4, (0, exec_1.exec)('tar', ['-xzf', downloadPath, "--strip=1"])];
if (!(url.endsWith("tar.gz") || url.endsWith("tar") || url.endsWith("tgz"))) return [3, 5];
return [4, (0, exec_1.exec)("tar", ["-xzf", downloadPath, "--strip=1"])];
case 3:
_a.sent();
return [4, (0, io_1.mv)((0, path_1.basename)(destination), destinationDir)];
Expand All @@ -3599,7 +3599,7 @@ function download(url, destination) {
case 6:
_a.sent();
_a.label = 7;
case 7: return [4, (0, exec_1.exec)('chmod', ['+x', destination])];
case 7: return [4, (0, exec_1.exec)("chmod", ["+x", destination])];
case 8:
_a.sent();
(0, core_1.addPath)(destinationDir);
Expand Down Expand Up @@ -3877,49 +3877,49 @@ var io_1 = __webpack_require__(1);
var index_1 = __webpack_require__(325);
var path_1 = __webpack_require__(622);
var paramsArgumentsMap = (_a = {},
_a['insecure-registries'] = 'insecure-registry',
_a['kube-context'] = 'kubeconfig',
_a['skip-tests'] = 'skip-tests',
_a["cache-file"] = 'cache-file',
_a.cache = 'cache-artifacts',
_a.concurrency = 'build-concurrency',
_a.filename = 'filename',
_a.image = 'build-image',
_a.interactive = 'interactive',
_a.kubeconfig = 'kubeconfig',
_a.namespace = 'namespace',
_a.profile = 'profile',
_a.push = 'push',
_a.repository = 'default-repo',
_a.tag = 'tag',
_a.verbosity = 'verbosity',
_a["insecure-registries"] = "insecure-registry",
_a["kube-context"] = "kubeconfig",
_a["skip-tests"] = "skip-tests",
_a["cache-file"] = "cache-file",
_a.cache = "cache-artifacts",
_a.concurrency = "build-concurrency",
_a.filename = "filename",
_a.image = "build-image",
_a.interactive = "interactive",
_a.kubeconfig = "kubeconfig",
_a.namespace = "namespace",
_a.profile = "profile",
_a.push = "push",
_a.repository = "default-repo",
_a.tag = "tag",
_a.verbosity = "verbosity",
_a);
var workspaceDir = (0, index_1.getWorkspaceDir)();
var binDir = (0, index_1.getBinDir)(workspaceDir);
var skaffoldHomeDir = (0, path_1.join)(workspaceDir, '.skaffold');
var skaffoldHomeDir = (0, path_1.join)(workspaceDir, ".skaffold");
function resolveArgsFromAction() {
return (0, core_1.getInput)('command') === ''
? ['version']
: (0, core_1.getInput)('command')
.split(' ')
return (0, core_1.getInput)("command") === ""
? ["version"]
: (0, core_1.getInput)("command")
.split(" ")
.concat(Object.entries(paramsArgumentsMap)
.map(function (_a) {
var actionParam = _a[0], skaffoldArg = _a[1];
return (0, core_1.getInput)(actionParam) !== '' ? "--".concat(skaffoldArg, "=").concat((0, core_1.getInput)(actionParam)) : '';
return (0, core_1.getInput)(actionParam) !== "" ? "--".concat(skaffoldArg, "=").concat((0, core_1.getInput)(actionParam)) : "";
})
.filter(function (it) { return it !== ''; }));
.filter(function (it) { return it !== ""; }));
}
function run() {
var _a;
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var platform, suffix, skaffoldVersion, containerStructureTestVersion, skaffoldTUrl, containerStructureTestUrl, error_1;
return (0, tslib_1.__generator)(this, function (_b) {
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
platform = (0, index_1.getOsPlatform)();
suffix = platform === 'windows' ? '.exe' : '';
skaffoldVersion = (0, core_1.getInput)('skaffold-version');
containerStructureTestVersion = (0, core_1.getInput)('container-structure-test-version');
suffix = platform === "windows" ? ".exe" : "";
skaffoldVersion = (0, core_1.getInput)("skaffold-version");
containerStructureTestVersion = (0, core_1.getInput)("container-structure-test-version");
skaffoldTUrl = "https://github.com/GoogleContainerTools/skaffold/releases/download/v".concat(skaffoldVersion, "/skaffold-").concat(platform, "-amd64").concat(suffix);
containerStructureTestUrl = "https://storage.googleapis.com/container-structure-test/v".concat(containerStructureTestVersion, "/container-structure-test-").concat(platform, "-amd64");
_b.label = 1;
Expand All @@ -3928,15 +3928,15 @@ function run() {
return [4, (0, io_1.mkdirP)(skaffoldHomeDir)];
case 2:
_b.sent();
return [4, (0, index_1.download)(skaffoldTUrl, (0, path_1.join)(binDir, 'skaffold'))];
return [4, (0, index_1.download)(skaffoldTUrl, (0, path_1.join)(binDir, "skaffold"))];
case 3:
_b.sent();
if (!!Boolean((0, core_1.getInput)('skip-tests'))) return [3, 5];
return [4, (0, index_1.download)(containerStructureTestUrl, (0, path_1.join)(binDir, 'container-structure-test'))];
if (!!Boolean((0, core_1.getInput)("skip-tests"))) return [3, 5];
return [4, (0, index_1.download)(containerStructureTestUrl, (0, path_1.join)(binDir, "container-structure-test"))];
case 4:
_b.sent();
_b.label = 5;
case 5: return [4, (0, exec_1.exec)('skaffold', resolveArgsFromAction(), { cwd: (_a = (0, core_1.getInput)('working-directory')) !== null && _a !== void 0 ? _a : workspaceDir })];
case 5: return [4, (0, exec_1.exec)("skaffold", resolveArgsFromAction(), { cwd: (_a = (0, core_1.getInput)("working-directory")) !== null && _a !== void 0 ? _a : workspaceDir })];
case 6:
_b.sent();
return [3, 8];
Expand Down Expand Up @@ -3971,7 +3971,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/* global global, define, System, Reflect, Promise */
var __extends;
var __assign;
Expand All @@ -3986,6 +3985,7 @@ var __values;
var __read;
var __spread;
var __spreadArrays;
var __spreadArray;
var __await;
var __asyncGenerator;
var __asyncDelegator;
Expand Down Expand Up @@ -4022,9 +4022,11 @@ var __createBinding;
(function (exporter) {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };

__extends = function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down Expand Up @@ -4103,14 +4105,17 @@ var __createBinding;
}
};

__createBinding = function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
__exportStar = function(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
};

__exportStar = function (m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
};
__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];
});

__values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
Expand Down Expand Up @@ -4141,12 +4146,14 @@ var __createBinding;
return ar;
};

/** @deprecated */
__spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
};

/** @deprecated */
__spreadArrays = function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
Expand All @@ -4155,6 +4162,16 @@ var __createBinding;
return r;
};

__spreadArray = function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

__await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
};
Expand Down Expand Up @@ -4190,31 +4207,35 @@ var __createBinding;
return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};

__importStar = function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};

__importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};

__classPrivateFieldGet = function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
__classPrivateFieldGet = function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};

__classPrivateFieldSet = function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};

exporter("__extends", __extends);
Expand All @@ -4231,6 +4252,7 @@ var __createBinding;
exporter("__read", __read);
exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray);
exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator);
Expand Down

0 comments on commit 38ca618

Please sign in to comment.