diff --git a/dist/index.js b/dist/index.js index c2700f3..f1997e6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4969,6 +4969,26 @@ class BaseUtilLib { this.baseLib.info(`Set the step output variable '${name}' to value '${value}''`); this.baseLib.setOutput(name, value); } + /** + * Set a workflow variable if not set already. + * @param name The name of the variable. + * @param value The value. + */ + setVariableIfUndefined(name, value) { + this.baseLib.debug(`setVariableIfUndefined()<<`); + if (!process.env[name]) { + if (!value) { + this.baseLib.warning(`Cannot set '${name}' variable because the provided value is null.`); + } + else { + this.setVariableVerbose(name, value); + } + } + else { + this.baseLib.debug(`${name} is already set to: '${value}'`); + } + this.baseLib.debug(`setVariableIfUndefined()>>`); + } } exports.BaseUtilLib = BaseUtilLib; class Matcher { @@ -5585,7 +5605,7 @@ __exportStar(__nccwpck_require__(6188), exports); // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VCPKG_BINARY_SOURCES = exports.VCPKG_INSTALLED_DIR = exports.VCPKG_JSON = exports.VCPKGDEFAULTTRIPLET = exports.VCPKGROOT = exports.vcpkgLastBuiltCommitId = exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = exports.RUNVCPKG_VCPKG_ROOT = void 0; +exports.ACTIONS_RUNTIME_TOKEN = exports.ACTIONS_CACHE_URL = exports.VCPKG_BINARY_SOURCES = exports.VCPKG_INSTALLED_DIR = exports.VCPKG_JSON = exports.VCPKGDEFAULTTRIPLET = exports.VCPKGROOT = exports.vcpkgLastBuiltCommitId = exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = exports.RUNVCPKG_VCPKG_ROOT = void 0; exports.RUNVCPKG_VCPKG_ROOT = "RUNVCPKG_VCPKG_ROOT"; exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = "RUNVCPKG_VCPKG_DEFAULT_TRIPLET"; exports.vcpkgLastBuiltCommitId = 'vcpkgLastBuiltCommitId'; @@ -5594,6 +5614,8 @@ exports.VCPKGDEFAULTTRIPLET = "VCPKG_DEFAULT_TRIPLET"; exports.VCPKG_JSON = "vcpkg.json"; exports.VCPKG_INSTALLED_DIR = "VCPKG_INSTALLED_DIR"; exports.VCPKG_BINARY_SOURCES = `VCPKG_BINARY_SOURCES`; +exports.ACTIONS_CACHE_URL = `ACTIONS_CACHE_URL`; +exports.ACTIONS_RUNTIME_TOKEN = `ACTIONS_RUNTIME_TOKEN`; //# sourceMappingURL=vcpkg-globals.js.map /***/ }), @@ -5718,9 +5740,12 @@ class VcpkgRunner { // If running in a GitHub Runner, enable the GH's cache provider for the vcpkg's binary cache. if (process.env['GITHUB_ACTIONS'] === 'true') { yield this.baseUtils.wrapOp(`Setup to run on GitHub Action runners`, () => __awaiter(this, void 0, void 0, function* () { - // Allow users to define the vcpkg's binary source explicitly in the workflow, in that case don't override it. - if (!process.env[globals.VCPKG_BINARY_SOURCES]) - this.baseUtils.setVariableVerbose(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA); + // Allow users to define the vcpkg's binary source explicitly in the workflow, in that case do not override it. + this.baseUtils.setVariableIfUndefined(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA); + if (process.env.ACTIONS_CACHE_URL) + this.baseUtils.setVariableVerbose(globals.ACTIONS_CACHE_URL, process.env.ACTIONS_CACHE_URL); + if (process.env.ACTIONS_RUNTIME_TOKEN) + this.baseUtils.setVariableVerbose(globals.ACTIONS_RUNTIME_TOKEN, process.env.ACTIONS_RUNTIME_TOKEN); })); } // Ensuring `this.vcpkgDestPath` is existent, since is going to be used as current working directory. diff --git a/package-lock.json b/package-lock.json index c0743d6..912ca11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,11 +13,11 @@ "@actions/exec": "^1.0.3", "@actions/github": "^4.0.0", "@actions/io": "^1.0.2", - "@lukka/action-lib": "3.6.1", - "@lukka/assets-lib": "3.6.1", - "@lukka/base-lib": "3.6.1", - "@lukka/base-util-lib": "3.6.1", - "@lukka/run-cmake-lib": "3.6.1", + "@lukka/action-lib": "3.6.2", + "@lukka/assets-lib": "3.6.2", + "@lukka/base-lib": "3.6.2", + "@lukka/base-util-lib": "3.6.2", + "@lukka/run-cmake-lib": "3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.8.0", "@types/jest": "^26.0.14", @@ -1620,9 +1620,9 @@ } }, "node_modules/@lukka/action-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.1/3f45d5669469e193a1296e04125daa731595e41e", - "integrity": "sha512-JEXeDPa2irBh8wKfhO2xaUjRj3hlP42tz511z85BSFEmUp3kp6K9vHr2AKlClP5ADBuPiwLfjMJQ8q86AzH5sA==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.2/648a1cbb5d8771f29bbe93aca23dc42fefd94fce", + "integrity": "sha512-znHVgSJMlR1vHnLmu/8dam/BnOVtuEi3GIK+/hETMbZ6WAIDLwa6/djPml79Hx51LgeBCOOMO7vooZ+zyzUdTA==", "license": "MIT", "dependencies": { "@actions/core": "^1.9.1", @@ -1630,8 +1630,8 @@ "@actions/github": "^5.0.3", "@actions/glob": "^0.3.0", "@actions/io": "^1.1.2", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", @@ -1840,15 +1840,15 @@ } }, "node_modules/@lukka/assets-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.1/91d03073c984a90d3f4bc202446de380023fef62", - "integrity": "sha512-MS6Jkll2cpwq04qEA/FEAYL6lit9P1dTtOqubUAtWjN2kaKeB6i/iIcwcM1zVMiZ7W+CFBdE1PJJ70swE0f2Hw==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.2/ad719f9c6673f37ddfd420316f5cd8d1e1d7920e", + "integrity": "sha512-NSoKN2s2MtUlicXYkQAM1uC90+bnEQxzEbAuxAcfXoyWo+LWFJUnu4W0d5HgMJUrbH+i88HHcyFpCRn+Si/aMg==", "license": "MIT" }, "node_modules/@lukka/base-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.1/c258e880f2ccc4b0aa14b0cd10d9d83de8f46380", - "integrity": "sha512-YxOaZ8v6/l8sk8IilQXjvrfbchithoNHrg4kie1h+55rptTEnolsHP2p3P24OmiPCpZbNOmYdPRTWLR4LT/2FQ==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.2/86d4724123a058d7770fc033b5516c4c1fb59392", + "integrity": "sha512-41oZ2jBFYeDk+erVCyQWisYrCUL15Iexc0xyfMid78wlcLYfFidmU6dqZX47/TcYNUa7q9J5/Z26Wy7IxVpqBg==", "license": "MIT", "dependencies": { "@types/adm-zip": "^0.4.32", @@ -2028,25 +2028,25 @@ } }, "node_modules/@lukka/base-util-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.1/718d9e8360098b2234519c7d9236f829748d4ab3", - "integrity": "sha512-BGb42vBc0m7iMpaJs00l32lzaXdhNJkGy+egjzr2xNeoSjAwF2fPsVvRFxt7r6agkp1pTVrLsQVkGelUOopVeA==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.2/d11111c00ac74473f7216ac25196b0c6639c98f6", + "integrity": "sha512-VgkF/EuRBhr0vIlT4C7mwZmo2zFJHinaSwmi+qjhQhUBntUnHoIRNwMKR3uI2bmp2EhpqcF/yfoiiNLkNyJdBA==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.2", "fast-glob": "3.2.7" } }, "node_modules/@lukka/run-cmake-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.1/5d864d3b87b6b4ea6b5a551397414e56cb0db261", - "integrity": "sha512-bUpONmFgfzlMS6Lv4Xk5Wcxw0CO7j5YdrpR2u+HcTZRCJnw7VSjfYuPnvh9DCVcge6qcn2n9jRigWSd/O7b1Dw==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.2/8f408374137dab906a800263974ce0bed75e1aa2", + "integrity": "sha512-/lMJhWmlsX8DIdbSLQku0RGwqfZJp608KOLVaCMiD9Dci2vqOY6pF7PuuOwJZM1zuyVOj1qkL1TAtLHhFjsMAQ==", "license": "MIT", "dependencies": { - "@lukka/action-lib": "^3.6.1", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", - "@lukka/run-vcpkg-lib": "^3.6.1", + "@lukka/action-lib": "^3.6.2", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", + "@lukka/run-vcpkg-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", @@ -2226,14 +2226,14 @@ } }, "node_modules/@lukka/run-vcpkg-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.6.1/3354c42a0fdf667230ba5a0b804c7adb4aeb4000", - "integrity": "sha512-wmpVsomW5lDKBWDoGCfHUzf3X9BSitNSpwf4yAS+FWs5l0Mnur8i9QcCO79Xu89e/zknZjf+huNgLvXJNUoD6g==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.6.2/9f2de7031cdd590fcae174583bb4f69911814911", + "integrity": "sha512-sknb0zJX7wv5JAmgStoKiCqPPwpMUCaRJ51xfcqxDabygnrlfm/nWn5vK2GcruJpUq8ufMu2WNGWFQvHtMOmgg==", "license": "MIT", "dependencies": { - "@lukka/action-lib": "^3.6.1", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", + "@lukka/action-lib": "^3.6.2", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", @@ -16349,17 +16349,17 @@ } }, "@lukka/action-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.1/3f45d5669469e193a1296e04125daa731595e41e", - "integrity": "sha512-JEXeDPa2irBh8wKfhO2xaUjRj3hlP42tz511z85BSFEmUp3kp6K9vHr2AKlClP5ADBuPiwLfjMJQ8q86AzH5sA==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.2/648a1cbb5d8771f29bbe93aca23dc42fefd94fce", + "integrity": "sha512-znHVgSJMlR1vHnLmu/8dam/BnOVtuEi3GIK+/hETMbZ6WAIDLwa6/djPml79Hx51LgeBCOOMO7vooZ+zyzUdTA==", "requires": { "@actions/core": "^1.9.1", "@actions/exec": "^1.1.1", "@actions/github": "^5.0.3", "@actions/glob": "^0.3.0", "@actions/io": "^1.1.2", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", @@ -16522,14 +16522,14 @@ } }, "@lukka/assets-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.1/91d03073c984a90d3f4bc202446de380023fef62", - "integrity": "sha512-MS6Jkll2cpwq04qEA/FEAYL6lit9P1dTtOqubUAtWjN2kaKeB6i/iIcwcM1zVMiZ7W+CFBdE1PJJ70swE0f2Hw==" + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.2/ad719f9c6673f37ddfd420316f5cd8d1e1d7920e", + "integrity": "sha512-NSoKN2s2MtUlicXYkQAM1uC90+bnEQxzEbAuxAcfXoyWo+LWFJUnu4W0d5HgMJUrbH+i88HHcyFpCRn+Si/aMg==" }, "@lukka/base-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.1/c258e880f2ccc4b0aa14b0cd10d9d83de8f46380", - "integrity": "sha512-YxOaZ8v6/l8sk8IilQXjvrfbchithoNHrg4kie1h+55rptTEnolsHP2p3P24OmiPCpZbNOmYdPRTWLR4LT/2FQ==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.2/86d4724123a058d7770fc033b5516c4c1fb59392", + "integrity": "sha512-41oZ2jBFYeDk+erVCyQWisYrCUL15Iexc0xyfMid78wlcLYfFidmU6dqZX47/TcYNUa7q9J5/Z26Wy7IxVpqBg==", "requires": { "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", @@ -16665,23 +16665,23 @@ } }, "@lukka/base-util-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.1/718d9e8360098b2234519c7d9236f829748d4ab3", - "integrity": "sha512-BGb42vBc0m7iMpaJs00l32lzaXdhNJkGy+egjzr2xNeoSjAwF2fPsVvRFxt7r6agkp1pTVrLsQVkGelUOopVeA==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.2/d11111c00ac74473f7216ac25196b0c6639c98f6", + "integrity": "sha512-VgkF/EuRBhr0vIlT4C7mwZmo2zFJHinaSwmi+qjhQhUBntUnHoIRNwMKR3uI2bmp2EhpqcF/yfoiiNLkNyJdBA==", "requires": { - "@lukka/base-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.2", "fast-glob": "3.2.7" } }, "@lukka/run-cmake-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.1/5d864d3b87b6b4ea6b5a551397414e56cb0db261", - "integrity": "sha512-bUpONmFgfzlMS6Lv4Xk5Wcxw0CO7j5YdrpR2u+HcTZRCJnw7VSjfYuPnvh9DCVcge6qcn2n9jRigWSd/O7b1Dw==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.2/8f408374137dab906a800263974ce0bed75e1aa2", + "integrity": "sha512-/lMJhWmlsX8DIdbSLQku0RGwqfZJp608KOLVaCMiD9Dci2vqOY6pF7PuuOwJZM1zuyVOj1qkL1TAtLHhFjsMAQ==", "requires": { - "@lukka/action-lib": "^3.6.1", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", - "@lukka/run-vcpkg-lib": "^3.6.1", + "@lukka/action-lib": "^3.6.2", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", + "@lukka/run-vcpkg-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", @@ -16818,13 +16818,13 @@ } }, "@lukka/run-vcpkg-lib": { - "version": "3.6.1", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.6.1/3354c42a0fdf667230ba5a0b804c7adb4aeb4000", - "integrity": "sha512-wmpVsomW5lDKBWDoGCfHUzf3X9BSitNSpwf4yAS+FWs5l0Mnur8i9QcCO79Xu89e/zknZjf+huNgLvXJNUoD6g==", + "version": "3.6.2", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.6.2/9f2de7031cdd590fcae174583bb4f69911814911", + "integrity": "sha512-sknb0zJX7wv5JAmgStoKiCqPPwpMUCaRJ51xfcqxDabygnrlfm/nWn5vK2GcruJpUq8ufMu2WNGWFQvHtMOmgg==", "requires": { - "@lukka/action-lib": "^3.6.1", - "@lukka/base-lib": "^3.6.1", - "@lukka/base-util-lib": "^3.6.1", + "@lukka/action-lib": "^3.6.2", + "@lukka/base-lib": "^3.6.2", + "@lukka/base-util-lib": "^3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/q": "^1.5.1", diff --git a/package.json b/package.json index e987df4..1147c7b 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,11 @@ "@actions/exec": "^1.0.3", "@actions/github": "^4.0.0", "@actions/io": "^1.0.2", - "@lukka/action-lib": "3.6.1", - "@lukka/assets-lib": "3.6.1", - "@lukka/base-lib": "3.6.1", - "@lukka/base-util-lib": "3.6.1", - "@lukka/run-cmake-lib": "3.6.1", + "@lukka/action-lib": "3.6.2", + "@lukka/assets-lib": "3.6.2", + "@lukka/base-lib": "3.6.2", + "@lukka/base-util-lib": "3.6.2", + "@lukka/run-cmake-lib": "3.6.2", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.8.0", "@types/jest": "^26.0.14",