Update toolkit we consume (#11)

This commit is contained in:
Danny McCormick 2019-06-24 15:09:39 -04:00 committed by GitHub
parent 7c614ea4aa
commit e4990368a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 537 additions and 320 deletions

View file

@ -1,33 +1,29 @@
{
"_from": "file:toolkit\\actions-core-0.1.0.tgz",
"_id": "@actions/core@0.1.0",
"_from": "file:toolkit\\actions-core-0.0.0.tgz",
"_id": "@actions/core@0.0.0",
"_inBundle": false,
"_integrity": "sha512-1I2vFY5r80QcbM1R8Ika5Ke9uWGrF8nl33oQuP3bXVG47wMIw1DdAVK0A17CHJe5ObHU4gpwTuQakUdZaOlg0w==",
"_integrity": "sha512-58ituSV1rzBMmmsWoFDnrnsT+Wm4kD/u9NgAGbPvZ7rQHWluYtD5bDbIsjDC6rKFuhqytkxDJPsF/TWBdgc/nA==",
"_location": "/@actions/core",
"_phantomChildren": {},
"_requested": {
"type": "file",
"where": "C:\\Users\\damccorm\\Documents\\setup-node",
"raw": "@actions/core@file:toolkit/actions-core-0.1.0.tgz",
"raw": "@actions/core@file:toolkit/actions-core-0.0.0.tgz",
"name": "@actions/core",
"escapedName": "@actions%2fcore",
"scope": "@actions",
"rawSpec": "file:toolkit/actions-core-0.1.0.tgz",
"saveSpec": "file:toolkit\\actions-core-0.1.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-core-0.1.0.tgz"
"rawSpec": "file:toolkit/actions-core-0.0.0.tgz",
"saveSpec": "file:toolkit\\actions-core-0.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-core-0.0.0.tgz"
},
"_requiredBy": [
"/",
"/@actions/tool-cache"
],
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-core-0.1.0.tgz",
"_shasum": "a2d7cc689a05e28a677af34e2d69826d2029232c",
"_spec": "@actions/core@file:toolkit/actions-core-0.1.0.tgz",
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-core-0.0.0.tgz",
"_shasum": "346d90a534fa6c5021bc2e1b732574fd2c66fc35",
"_spec": "@actions/core@file:toolkit/actions-core-0.0.0.tgz",
"_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"author": {
"name": "Bryan MacFarlane",
"email": "bryanmac@microsoft.com"
},
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
@ -66,5 +62,5 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "0.1.0"
"version": "0.0.0"
}

View file

@ -1,33 +1,29 @@
{
"_from": "file:toolkit\\actions-exec-1.0.0.tgz",
"_id": "@actions/exec@1.0.0",
"_from": "file:toolkit\\actions-exec-0.0.0.tgz",
"_id": "@actions/exec@0.0.0",
"_inBundle": false,
"_integrity": "sha512-AxtupsjQceVIf6nEECts5a1pDpWO4r3yq5lpTA73g1FXA0awDdTW3r9NFn8NGF6UaydkIN0BEOasQlS5qS30zg==",
"_integrity": "sha512-HHObusC4p1RElxIlrrN0sY/cweBYl+jKm3J/XWHPQZMipgJXB/dkVhUfl4KqH3Vim7oM2KjCGSfn+vTYrqVH3A==",
"_location": "/@actions/exec",
"_phantomChildren": {},
"_requested": {
"type": "file",
"where": "C:\\Users\\damccorm\\Documents\\setup-node",
"raw": "@actions/exec@file:toolkit/actions-exec-1.0.0.tgz",
"raw": "@actions/exec@file:toolkit/actions-exec-0.0.0.tgz",
"name": "@actions/exec",
"escapedName": "@actions%2fexec",
"scope": "@actions",
"rawSpec": "file:toolkit/actions-exec-1.0.0.tgz",
"saveSpec": "file:toolkit\\actions-exec-1.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-exec-1.0.0.tgz"
"rawSpec": "file:toolkit/actions-exec-0.0.0.tgz",
"saveSpec": "file:toolkit\\actions-exec-0.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-exec-0.0.0.tgz"
},
"_requiredBy": [
"/",
"/@actions/tool-cache"
],
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-exec-1.0.0.tgz",
"_shasum": "6845691df4b14de24cf3b0a45c847070db8f9b6d",
"_spec": "@actions/exec@file:toolkit/actions-exec-1.0.0.tgz",
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-exec-0.0.0.tgz",
"_shasum": "341d868fe6c4123ded20db9c2106b7b8c16e1d73",
"_spec": "@actions/exec@file:toolkit/actions-exec-0.0.0.tgz",
"_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"author": {
"name": "Bryan MacFarlane",
"email": "bryanmac@microsoft.com"
},
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
@ -35,7 +31,7 @@
"deprecated": false,
"description": "Actions exec lib",
"devDependencies": {
"@actions/io": "^1.0.0"
"@actions/io": "^0.0.0"
},
"directories": {
"lib": "lib",
@ -63,5 +59,5 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.0.0"
"version": "0.0.0"
}

View file

@ -1,33 +1,29 @@
{
"_from": "file:toolkit\\actions-io-1.0.0.tgz",
"_id": "@actions/io@1.0.0",
"_from": "file:toolkit\\actions-io-0.0.0.tgz",
"_id": "@actions/io@0.0.0",
"_inBundle": false,
"_integrity": "sha512-Dox3bRCdyxoG0o1mSHt/uINbyQ2SfbhtJmmMuUQny6ARB1hU8ZUi+XR0cHUfd/SrwdzLUrxX4dV8x8ylNSBQpA==",
"_integrity": "sha512-BArfobXB/b6RjR4i/+P4UcdaqR2tPjEb2WzZf9GdKiSARQn7d301pKOZAqxA+0N11X07Lk46t/txeUBcrCNbeg==",
"_location": "/@actions/io",
"_phantomChildren": {},
"_requested": {
"type": "file",
"where": "C:\\Users\\damccorm\\Documents\\setup-node",
"raw": "@actions/io@file:toolkit/actions-io-1.0.0.tgz",
"raw": "@actions/io@file:toolkit/actions-io-0.0.0.tgz",
"name": "@actions/io",
"escapedName": "@actions%2fio",
"scope": "@actions",
"rawSpec": "file:toolkit/actions-io-1.0.0.tgz",
"saveSpec": "file:toolkit\\actions-io-1.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-io-1.0.0.tgz"
"rawSpec": "file:toolkit/actions-io-0.0.0.tgz",
"saveSpec": "file:toolkit\\actions-io-0.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-io-0.0.0.tgz"
},
"_requiredBy": [
"/",
"/@actions/tool-cache"
],
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-io-1.0.0.tgz",
"_shasum": "a395423c226d068e7caced224d51356ad15c41a7",
"_spec": "@actions/io@file:toolkit/actions-io-1.0.0.tgz",
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-io-0.0.0.tgz",
"_shasum": "1e8f0faca6b39215bebacedf473e5bb0716e39bf",
"_spec": "@actions/io@file:toolkit/actions-io-0.0.0.tgz",
"_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"author": {
"name": "Danny McCormick",
"email": "damccorm@microsoft.com"
},
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
@ -60,5 +56,5 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.0.0"
"version": "0.0.0"
}

View file

@ -62,10 +62,17 @@ export declare function cacheDir(sourceDir: string, tool: string, version: strin
*/
export declare function cacheFile(sourceFile: string, targetFile: string, tool: string, version: string, arch?: string): Promise<string>;
/**
* finds the path to a tool in the local installed tool cache
* Finds the path to a tool version in the local installed tool cache
*
* @param toolName name of the tool
* @param versionSpec version of the tool
* @param arch optional arch. defaults to arch of computer
*/
export declare function find(toolName: string, versionSpec: string, arch?: string): string;
/**
* Finds the paths to all versions of a tool that are installed in the local tool cache
*
* @param toolName name of the tool
* @param arch optional arch. defaults to arch of computer
*/
export declare function findAllVersions(toolName: string, arch?: string): string[];

View file

@ -31,8 +31,6 @@ const userAgent = 'actions/tool-cache';
// On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
let tempDirectory = process.env['RUNNER_TEMPDIRECTORY'] || '';
let cacheRoot = process.env['RUNNER_TOOLSDIRECTORY'] || '';
process.env['RUNNER_TEMPDIRECTORY'] = '';
process.env['RUNNER_TOOLSDIRECTORY'] = '';
// If directories not found, place them in common temp locations
if (!tempDirectory || !cacheRoot) {
let baseLocation;
@ -315,7 +313,7 @@ function cacheFile(sourceFile, targetFile, tool, version, arch) {
}
exports.cacheFile = cacheFile;
/**
* finds the path to a tool in the local installed tool cache
* Finds the path to a tool version in the local installed tool cache
*
* @param toolName name of the tool
* @param versionSpec version of the tool
@ -331,7 +329,7 @@ function find(toolName, versionSpec, arch) {
arch = arch || os.arch();
// attempt to resolve an explicit version
if (!_isExplicitVersion(versionSpec)) {
const localVersions = _findLocalToolVersions(toolName, arch);
const localVersions = findAllVersions(toolName, arch);
const match = _evaluateVersions(localVersions, versionSpec);
versionSpec = match;
}
@ -352,6 +350,30 @@ function find(toolName, versionSpec, arch) {
return toolPath;
}
exports.find = find;
/**
* Finds the paths to all versions of a tool that are installed in the local tool cache
*
* @param toolName name of the tool
* @param arch optional arch. defaults to arch of computer
*/
function findAllVersions(toolName, arch) {
const versions = [];
arch = arch || os.arch();
const toolPath = path.join(cacheRoot, toolName);
if (fs.existsSync(toolPath)) {
const children = fs.readdirSync(toolPath);
for (const child of children) {
if (_isExplicitVersion(child)) {
const fullPath = path.join(toolPath, child, arch || '');
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
versions.push(child);
}
}
}
}
return versions;
}
exports.findAllVersions = findAllVersions;
function _createExtractFolder(dest) {
return __awaiter(this, void 0, void 0, function* () {
if (!dest) {
@ -411,21 +433,4 @@ function _evaluateVersions(versions, versionSpec) {
}
return version;
}
function _findLocalToolVersions(toolName, arch) {
const versions = [];
arch = arch || os.arch();
const toolPath = path.join(cacheRoot, toolName);
if (fs.existsSync(toolPath)) {
const children = fs.readdirSync(toolPath);
for (const child of children) {
if (_isExplicitVersion(child)) {
const fullPath = path.join(toolPath, child, arch || '');
if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
versions.push(child);
}
}
}
}
return versions;
}
//# sourceMappingURL=tool-cache.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,44 +1,41 @@
{
"_args": [
[
"@actions/tool-cache@file:toolkit\\actions-tool-cache-1.0.0.tgz",
"C:\\Users\\damccorm\\Documents\\setup-node"
]
],
"_from": "@actions/tool-cache@file:toolkit/actions-tool-cache-1.0.0.tgz",
"_id": "@actions/tool-cache@file:toolkit/actions-tool-cache-1.0.0.tgz",
"_from": "file:toolkit\\actions-tool-cache-0.0.0.tgz",
"_id": "@actions/tool-cache@0.0.0",
"_inBundle": false,
"_integrity": "sha512-hx8Z1ip11aZVA47uSCIB7Y9ec4Ty9zNPUyFyBsr0YI5vJ64TR/JoySbr0ck7l2EI0zqYAdef11Ynwz/qUkXVyg==",
"_integrity": "sha512-NavDg5VFXDfbe9TpFuj+uOHacjg1bT3Wmo3DQuul3gsGRBEXyzhh2MWKnBZs/Zh7FE3prLmIqpbtymafNBFkIA==",
"_location": "/@actions/tool-cache",
"_phantomChildren": {},
"_requested": {
"type": "file",
"where": "C:\\Users\\damccorm\\Documents\\setup-node",
"raw": "@actions/tool-cache@file:toolkit/actions-tool-cache-1.0.0.tgz",
"raw": "@actions/tool-cache@file:toolkit/actions-tool-cache-0.0.0.tgz",
"name": "@actions/tool-cache",
"escapedName": "@actions%2ftool-cache",
"scope": "@actions",
"rawSpec": "file:toolkit/actions-tool-cache-1.0.0.tgz",
"saveSpec": "file:toolkit\\actions-tool-cache-1.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-tool-cache-1.0.0.tgz"
"rawSpec": "file:toolkit/actions-tool-cache-0.0.0.tgz",
"saveSpec": "file:toolkit\\actions-tool-cache-0.0.0.tgz",
"fetchSpec": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-tool-cache-0.0.0.tgz"
},
"_requiredBy": [
"/"
],
"_resolved": false,
"_spec": "file:toolkit/actions-tool-cache-1.0.0.tgz",
"_resolved": "C:\\Users\\damccorm\\Documents\\setup-node\\toolkit\\actions-tool-cache-0.0.0.tgz",
"_shasum": "fa216c10f724010a74602fd14881f25f5b008070",
"_spec": "@actions/tool-cache@file:toolkit/actions-tool-cache-0.0.0.tgz",
"_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"bundleDependencies": false,
"dependencies": {
"@actions/core": "^0.1.0",
"@actions/exec": "^1.0.0",
"@actions/io": "^1.0.0",
"@actions/core": "^0.0.0",
"@actions/exec": "^0.0.0",
"@actions/io": "^0.0.0",
"semver": "^6.1.0",
"typed-rest-client": "^1.4.0",
"uuid": "^3.3.2"
},
"deprecated": false,
"description": "Actions tool-cache lib",
"devDependencies": {
"@types/nock": "^10.0.3",
@ -73,5 +70,5 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "1.0.0"
"version": "0.0.0"
}