diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 01f85c5..24e054e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -66,6 +66,7 @@ jobs: configurePreset: default buildPreset: default testPreset: default + packagePreset: default - name: test for run-cmake (Ninja Multi-Config) uses: ./ @@ -74,6 +75,7 @@ jobs: configurePreset: default-multi buildPreset: default-multi testPreset: default-multi + packagePreset: default-multi - name: build and test (skip configure) for run-cmake (Ninja Multi-Config) with specific config uses: ./ diff --git a/README.md b/README.md index 4ddfa37..c85b0b2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Take a look at this [C++ project template](https://github.com/lukka/CppCMakeVcpk # [**run-cmake@v10** runs CMake with CMakePresets.json](https://github.com/marketplace/actions/run-cmake) -The **run-cmake** action runs [CMake](https://cmake.org) on GitHub workflows leveraging [CMakePresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html). +The **run-cmake** action runs [CMake](https://cmake.org) on GitHub workflows leveraging [CMakePresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html). Note that usage of CMakePresets.json is required. Good companions are the [run-vcpkg](https://github.com/marketplace/actions/run-vcpkg) action and the [get-cmake](https://github.com/marketplace/actions/get-cmake) action. @@ -37,7 +37,7 @@ The provided [samples](#samples) use [GitHub hosted runners](https://help.github It is __highly recommended__ to use: - a [vcpkg.json](https://vcpkg.io/en/docs/maintainers/manifest-files.html) manifest file to declaratively specify the dependencies. -- a [CMakePresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) file. +- the required [CMakePresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) file. - [vcpkg as a submodule of your repository](https://github.com/microsoft/vcpkg/blob/master/README.md#vcpkg-as-a-submodule). ```yaml @@ -89,7 +89,8 @@ jobs: # cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' # You could use CMake workflow presets defined in the CMakePresets.json - # with just this line below. + # with just this line below. Note this one cannot be used with any other + # preset input, it is mutually exclusive. # workflowPreset: 'workflow-name' # This is the name of the CMakePresets.json's configuration to use to generate @@ -163,7 +164,7 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-cmake/ │ │ Inputs: │ │ - `buildPreset` │ $BUILD_PRESET_NAME=buildPreset │ - `cmakeListsTxtPath` -│ run: `cmake --build --preset` │ - `buildPresetCmdString` +│ runs: `cmake --build --preset` │ - `buildPresetCmdString` └─────────────┬─────────────────────┘ - `buildPresetAdditionalArgs` │ ▼ @@ -171,9 +172,15 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-cmake/ │ │ Inputs: │ │ - `testPreset` │ $TEST_PRESET_NAME=testPreset │ - `cmakeListsTxtPath` -│ run a`ctest --preset` │ - `testPresetCmdString` +│ runs: `ctest --preset` │ - `testPresetCmdString` └─────────────┬─────────────────────┘ - `testPresetAdditionalArgs` │ +┌───────────────────────────────────┐ +│ │ Inputs: +│ │ - `packagePreset` +│ $PACKAGE_PRESET_NAME=packagePreset│ - `cmakeListsTxtPath` +│ runs: `cpack --preset` │ - `packagePresetCmdString` +└─────────────┬─────────────────────┘ - `packagePresetAdditionalArgs` ▼ ⬬ ``` diff --git a/__tests__/functional.test.ts b/__tests__/functional.test.ts index 0af5428..9937242 100644 --- a/__tests__/functional.test.ts +++ b/__tests__/functional.test.ts @@ -32,6 +32,15 @@ function envTest(useShell: boolean, envVarValue?: string): void { console.log(cp.execSync(`node ${testScript}`, options)?.toString()); } +function noInputsTest(): void { + process.env.INPUT_CMAKELISTSTXTPATH = path.join(assetDirectory, 'CMakeLists.txt'); + const options: cp.ExecSyncOptions = { + env: process.env, + stdio: "inherit", + }; + console.log(cp.execSync(`node ${testScript}`, options)?.toString()); +} + describe('run-cmake functional tests', () => { beforeEach(async () => { await io.rmRF(buildDirectory); @@ -87,10 +96,11 @@ describe('run-cmake functional tests', () => { console.log(cp.execSync(`node ${testScript}`, options)?.toString()); }); - test('configure and build test with Ninja (Multi-Config)', () => { + test('configure build package and test with Ninja (Multi-Config)', () => { process.env.INPUT_CONFIGUREPRESET = "default-multi" process.env.INPUT_BUILDPRESET = "default-multi" process.env.INPUT_TESTPRESET = "default-multi" + process.env.INPUT_PACKAGEPRESET = "default-multi" process.env.INPUT_CMAKELISTSTXTPATH = path.join(assetDirectory, 'CMakeLists.txt'); const options: cp.ExecSyncOptions = { env: process.env, @@ -117,6 +127,11 @@ describe('run-cmake functional tests', () => { expect(() => envTest(false, undefined)).toThrow(); }); + test('should throw when no inputs are provided', () => { + // Not specifying any input should fail. + expect(() => noInputsTest()).toThrow(); + }); + test('basic test for environment variables in input, with shell', () => { envTest(true, toolchainFile); }); diff --git a/__tests__/theAssets/CMakeLists.txt b/__tests__/theAssets/CMakeLists.txt index 9a218f4..461e84a 100644 --- a/__tests__/theAssets/CMakeLists.txt +++ b/__tests__/theAssets/CMakeLists.txt @@ -1,6 +1,8 @@ -project(empty) +project(test_project) cmake_minimum_required(VERSION 3.21) add_executable(main main.cpp) -install(TARGETS main DESTINATION bin) \ No newline at end of file +install(TARGETS main DESTINATION bin) + +include(CPack) \ No newline at end of file diff --git a/__tests__/theAssets/CMakePresets.json b/__tests__/theAssets/CMakePresets.json index fe63ded..19a50fa 100644 --- a/__tests__/theAssets/CMakePresets.json +++ b/__tests__/theAssets/CMakePresets.json @@ -53,6 +53,31 @@ "configurePreset": "default-multi" } ], + "packagePresets": [ + { + "packageName": "default-package-name", + "packageVersion": "0.1", + "name": "default", + "configurePreset": "default", + "generators": [ + "TGZ", + "ZIP" + ] + }, + { + "packageName": "default-multi-package-name", + "packageVersion": "0.1", + "name": "default-multi", + "configurePreset": "default-multi", + "generators": [ + "TGZ", + "ZIP" + ], + "configurations": [ + "Debug" + ] + } + ], "workflowPresets": [ { "name": "default-workflow", diff --git a/action.yml b/action.yml index 49a0df2..163c021 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ # SPDX short identifier: MIT name: 'run-cmake' -description: 'Run CMake with CMakePreset.json to configure, build and test C/C++ source code.' +description: 'Run CMake with CMakePreset.json to configure, build, package and test C/C++ source code.' author: 'Luca Cappa https://github.com/lukka' inputs: @@ -15,19 +15,23 @@ inputs: workflowPreset: default: "" required: false - description: "The name of the workflow preset. Optional. This value is stored in the WORKFLOW_PRESET_NAME environment variable, and used by the default value of 'workflowPresetCmdString' input." + description: "The name of the workflow preset. Optional, it cannot be used with any other preset input. This value is stored in the WORKFLOW_PRESET_NAME environment variable, and used by the default value of 'workflowPresetCmdString' input." configurePreset: default: "" required: false - description: "The name of the configure preset. Optional. This value is stored in the CONFIGURE_PRESET_NAME environment variable, and used by the default value of 'configurePresetCmdString' input." + description: "The name of the configure preset. Optional, but at least one of the preset input must be provided. This value is stored in the CONFIGURE_PRESET_NAME environment variable, and used by the default value of 'configurePresetCmdString' input." buildPreset: default: "" required: false - description: "The name of the build preset. Optional. This value is stored in the BUILD_PRESET_NAME environment variable, and used by the default value of 'buildPresetCmdString' input.'" + description: "The name of the build preset. Optional, but at least one of the preset input must be provided. This value is stored in the BUILD_PRESET_NAME environment variable, and used by the default value of 'buildPresetCmdString' input.'" testPreset: default: "" required: false - description: "The name of the test preset. Optional. This value is stored in the TEST_PRESET_NAME environment variable, and used by the default value of 'testPresetCmdString' input.'" + description: "The name of the test preset (ctest). Optional, but at least one of the preset input must be provided. This value is stored in the TEST_PRESET_NAME environment variable, and used by the default value of 'testPresetCmdString' input.'" + packagePreset: + default: "" + required: false + description: "The name of the package preset (cpack). Optional, but at least one of the preset input must be provided. This value is stored in the PACKAGE_PRESET_NAME environment variable, and used by the default value of 'packagePresetCmdString' input.'" configurePresetAdditionalArgs: default: "[]" required: false @@ -40,6 +44,11 @@ inputs: default: "[]" required: false description: "A string representing list of additional arguments for testing. Optional. Useful when specifing the config to test with a multi configuration generator, e.g., ['--config DEBUG']" + packagePresetAdditionalArgs: + default: "[]" + required: false + description: "A string representing list of additional arguments for cpack. Optional." + # The following inputs are rarely set by the user, since the default values suffice the most common scenarios. useShell: @@ -66,6 +75,10 @@ inputs: default: "[`--preset`, `$[env.TEST_PRESET_NAME]`]" required: false description: "The CTest command format string to run test." + packagePresetCmdString: + default: "[`--preset`, `$[env.PACKAGE_PRESET_NAME]`]" + required: false + description: "The CPack command format string to package the project." runVcpkgEnvFormatString: default: "[`env`, `--bin`, `--include`, `--tools`, `--python`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `set`]" required: false diff --git a/dist/index.js b/dist/index.js index 9ed6b1f..c2700f3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32,16 +32,19 @@ function main() { const configurePreset = actionLib.getInput(cmakeglobals.configurePreset, false); const buildPreset = actionLib.getInput(cmakeglobals.buildPreset, false); const testPreset = actionLib.getInput(cmakeglobals.testPreset, false); + const packagePreset = actionLib.getInput(cmakeglobals.packagePreset, false); const workflowPreset = actionLib.getInput(cmakeglobals.workflowPreset, false); const workflowPresetCmdStringFormat = actionLib.getInput(cmakeglobals.workflowPresetFormat, false); const configurePresetCmdStringFormat = actionLib.getInput(cmakeglobals.configurePresetFormat, false); const buildPresetCmdStringFormat = actionLib.getInput(cmakeglobals.buildPresetFormat, false); const testPresetCmdStringFormat = actionLib.getInput(cmakeglobals.testPresetFormat, false); + const packagePresetCmdStringFormat = actionLib.getInput(cmakeglobals.packagePresetFormat, false); const configurePresetAdditionalArgs = actionLib.getInput(cmakeglobals.configurePresetAdditionalArgs, false); const buildPresetAdditionalArgs = actionLib.getInput(cmakeglobals.buildPresetAdditionalArgs, false); const testPresetAdditionalArgs = actionLib.getInput(cmakeglobals.testPresetAdditionalArgs, false); + const packagePresetAdditionalArgs = actionLib.getInput(cmakeglobals.packagePresetAdditionalArgs, false); const runVcpkgEnvFormatString = actionLib.getInput(vcpkgglobals.runVcpkgEnvFormatStringInput, false); - yield runcmakelib.CMakeRunner.run(actionLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetAdditionalArgs, buildPreset, buildPresetCmdStringFormat, buildPresetAdditionalArgs, testPreset, testPresetCmdStringFormat, testPresetAdditionalArgs, runVcpkgEnvFormatString); + yield runcmakelib.CMakeRunner.run(actionLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetAdditionalArgs, buildPreset, buildPresetCmdStringFormat, buildPresetAdditionalArgs, testPreset, testPresetCmdStringFormat, testPresetAdditionalArgs, packagePreset, packagePresetCmdStringFormat, packagePresetAdditionalArgs, runVcpkgEnvFormatString); actionLib.info('run-cmake action execution succeeded'); process.exitCode = 0; } @@ -4345,6 +4348,9 @@ class ActionToolRunner { this.path = path; this.arguments = []; } + getName() { + return this.path; + } _argStringToArray(text) { return this.__argStringToArray(text); } @@ -4632,6 +4638,9 @@ class ActionLib { hashFiles(fileGlob, options) { return actionglob.hashFiles(fileGlob, options); } + addPath(path) { + core.addPath(path); + } } exports.ActionLib = ActionLib; //# sourceMappingURL=action-lib.js.map @@ -5137,19 +5146,22 @@ __exportStar(__nccwpck_require__(9604), exports); // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.logCollectionRegExps = exports.testPresetAdditionalArgs = exports.buildPresetAdditionalArgs = exports.configurePresetAdditionalArgs = exports.workflowPresetFormat = exports.testPresetFormat = exports.buildPresetFormat = exports.configurePresetFormat = exports.workflowPreset = exports.testPreset = exports.buildPreset = exports.configurePreset = exports.cmakeListsTxtPath = void 0; +exports.logCollectionRegExps = exports.packagePresetAdditionalArgs = exports.testPresetAdditionalArgs = exports.buildPresetAdditionalArgs = exports.configurePresetAdditionalArgs = exports.workflowPresetFormat = exports.packagePresetFormat = exports.testPresetFormat = exports.buildPresetFormat = exports.configurePresetFormat = exports.workflowPreset = exports.packagePreset = exports.testPreset = exports.buildPreset = exports.configurePreset = exports.cmakeListsTxtPath = void 0; exports.cmakeListsTxtPath = 'cmakeListsTxtPath'; exports.configurePreset = 'configurePreset'; exports.buildPreset = 'buildPreset'; exports.testPreset = 'testPreset'; +exports.packagePreset = 'packagePreset'; exports.workflowPreset = 'workflowPreset'; exports.configurePresetFormat = 'configurePresetCmdString'; exports.buildPresetFormat = 'buildPresetCmdString'; exports.testPresetFormat = 'testPresetCmdString'; +exports.packagePresetFormat = 'packagePresetCmdString'; exports.workflowPresetFormat = 'workflowPresetCmdString'; exports.configurePresetAdditionalArgs = 'configurePresetAdditionalArgs'; exports.buildPresetAdditionalArgs = 'buildPresetAdditionalArgs'; exports.testPresetAdditionalArgs = 'testPresetAdditionalArgs'; +exports.packagePresetAdditionalArgs = 'packagePresetAdditionalArgs'; exports.logCollectionRegExps = 'logCollectionRegExps'; //# sourceMappingURL=cmake-globals.js.map @@ -5200,7 +5212,7 @@ const using_statement_1 = __nccwpck_require__(8515); const cmakeutil = __importStar(__nccwpck_require__(4067)); const runvcpkglib = __importStar(__nccwpck_require__(4393)); class CMakeRunner { - constructor(baseLib, workflowPreset = null, workflowPresetCmdStringFormat = CMakeRunner.workflowPresetDefault, configurePreset = null, configurePresetCmdStringFormat = CMakeRunner.configurePresetDefault, configurePresetCmdStringAddArgs = null, buildPreset = null, buildPresetCmdStringFormat = CMakeRunner.buildPresetDefault, buildPresetCmdStringAddArgs = null, testPreset = null, testPresetCmdStringFormat = CMakeRunner.testPresetDefault, testPresetCmdStringAddArgs = null, vcpkgEnvStringFormat = CMakeRunner.vcpkgEnvDefault) { + constructor(baseLib, workflowPreset = null, workflowPresetCmdStringFormat = CMakeRunner.workflowPresetDefault, configurePreset = null, configurePresetCmdStringFormat = CMakeRunner.configurePresetDefault, configurePresetCmdStringAddArgs = null, buildPreset = null, buildPresetCmdStringFormat = CMakeRunner.buildPresetDefault, buildPresetCmdStringAddArgs = null, testPreset = null, testPresetCmdStringFormat = CMakeRunner.testPresetDefault, testPresetCmdStringAddArgs = null, packagePreset = null, packagePresetCmdStringFormat = CMakeRunner.packagePresetDefault, packagePresetCmdStringAddArgs = null, vcpkgEnvStringFormat = CMakeRunner.vcpkgEnvDefault) { var _a, _b, _c; this.baseLib = baseLib; this.workflowPreset = workflowPreset; @@ -5214,6 +5226,9 @@ class CMakeRunner { this.testPreset = testPreset; this.testPresetCmdStringFormat = testPresetCmdStringFormat; this.testPresetCmdStringAddArgs = testPresetCmdStringAddArgs; + this.packagePreset = packagePreset; + this.packagePresetCmdStringFormat = packagePresetCmdStringFormat; + this.packagePresetCmdStringAddArgs = packagePresetCmdStringAddArgs; this.vcpkgEnvStringFormat = vcpkgEnvStringFormat; this.baseUtils = new baseutillib.BaseUtilLib(this.baseLib); const regs = (_a = this.baseLib.getDelimitedInput(cmakeglobals.logCollectionRegExps, ';', false)) !== null && _a !== void 0 ? _a : []; @@ -5222,10 +5237,10 @@ class CMakeRunner { this.cmakeSourceDir = path.dirname((_c = baseutillib.BaseUtilLib.normalizePath(this.cmakeListsTxtPath)) !== null && _c !== void 0 ? _c : ""); baseutillib.BaseUtilLib.throwIfNull(this.cmakeSourceDir, cmakeglobals.cmakeListsTxtPath); } - static run(baseLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetCmdStringAddArgs, buildPreset, buildPresetCmdStringFormat, buildPresetCmdStringAddArgs, testPreset, testPresetCmdStringFormat, testPresetCmdStringAddArgs, vcpkgEnvCmdStringFormat) { + static run(baseLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetCmdStringAddArgs, buildPreset, buildPresetCmdStringFormat, buildPresetCmdStringAddArgs, testPreset, testPresetCmdStringFormat, testPresetCmdStringAddArgs, packagePreset, packagePresetCmdStringFormat, packagePresetCmdStringAddArgs, vcpkgEnvCmdStringFormat) { return __awaiter(this, void 0, void 0, function* () { yield using_statement_1.using(baseutillib.Matcher.createMatcher('all', baseLib, __dirname), () => __awaiter(this, void 0, void 0, function* () { - const cmakeRunner = new CMakeRunner(baseLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetCmdStringAddArgs, buildPreset, buildPresetCmdStringFormat, buildPresetCmdStringAddArgs, testPreset, testPresetCmdStringFormat, testPresetCmdStringAddArgs, vcpkgEnvCmdStringFormat); + const cmakeRunner = new CMakeRunner(baseLib, workflowPreset, workflowPresetCmdStringFormat, configurePreset, configurePresetCmdStringFormat, configurePresetCmdStringAddArgs, buildPreset, buildPresetCmdStringFormat, buildPresetCmdStringAddArgs, testPreset, testPresetCmdStringFormat, testPresetCmdStringAddArgs, packagePreset, packagePresetCmdStringFormat, packagePresetCmdStringAddArgs, vcpkgEnvCmdStringFormat); yield cmakeRunner.run(); })); }); @@ -5237,23 +5252,38 @@ class CMakeRunner { this.baseLib.debug(`cmake located at: '${cmake}'.`); const ctest = yield this.baseLib.which('ctest', true); this.baseLib.debug(`ctest located at: '${ctest}'.`); + const cpack = yield this.baseLib.which('cpack', true); + this.baseLib.debug(`cpack located at: '${cpack}'.`); + let onePresetInputProvided = false; if (this.workflowPreset) { + onePresetInputProvided = true; const workflowTool = this.baseLib.tool(cmake); yield this.workflow(workflowTool, this.workflowPreset); } else { if (this.configurePreset) { + onePresetInputProvided = true; const configureTool = this.baseLib.tool(cmake); yield this.configure(configureTool, this.configurePreset); } if (this.buildPreset) { + onePresetInputProvided = true; const buildTool = this.baseLib.tool(cmake); yield this.build(buildTool, this.buildPreset); } if (this.testPreset) { + onePresetInputProvided = true; const testTool = this.baseLib.tool(ctest); yield this.test(testTool, this.testPreset); } + if (this.packagePreset) { + onePresetInputProvided = true; + const packageTool = this.baseLib.tool(cpack); + yield this.package(packageTool, this.packagePreset); + } + } + if (!onePresetInputProvided) { + throw new Error(`"Error: no preset has been specified in any of the inputs. Please provide at least the name of one preset.`); } this.baseLib.debug('run()>>'); }); @@ -5268,11 +5298,26 @@ class CMakeRunner { } this.baseLib.debug(`Testing with CTest ...`); yield this.baseUtils.wrapOp("Test with CTest", () => __awaiter(this, void 0, void 0, function* () { - return yield this.launchCMake(ctest, this.cmakeSourceDir, this.logFilesCollector); + return yield this.launchTool(ctest, this.cmakeSourceDir, this.logFilesCollector); })); this.baseLib.debug('test()>>'); }); } + package(cpack, packagePresetName) { + return __awaiter(this, void 0, void 0, function* () { + this.baseLib.debug('package()<<'); + baseutillib.setEnvVarIfUndefined("PACKAGE_PRESET_NAME", packagePresetName); + CMakeRunner.addArguments(cpack, this.packagePresetCmdStringFormat); + if (this.packagePresetCmdStringAddArgs) { + CMakeRunner.addArguments(cpack, this.packagePresetCmdStringAddArgs); + } + this.baseLib.debug(`Packaging with CPack ...`); + yield this.baseUtils.wrapOp("Package with CPack", () => __awaiter(this, void 0, void 0, function* () { + return yield this.launchTool(cpack, this.cmakeSourceDir, this.logFilesCollector); + })); + this.baseLib.debug('package()>>'); + }); + } build(cmake, buildPresetName) { return __awaiter(this, void 0, void 0, function* () { this.baseLib.debug('build()<<'); @@ -5283,7 +5328,7 @@ class CMakeRunner { } this.baseLib.debug(`Building with CMake ...`); yield this.baseUtils.wrapOp("Build with CMake", () => __awaiter(this, void 0, void 0, function* () { - return yield this.launchCMake(cmake, this.cmakeSourceDir, this.logFilesCollector); + return yield this.launchTool(cmake, this.cmakeSourceDir, this.logFilesCollector); })); this.baseLib.debug('build()>>'); }); @@ -5326,7 +5371,7 @@ class CMakeRunner { })); // this.baseLib.debug(`Generating project files with CMake ...`); - yield this.baseUtils.wrapOp("Generate project files with CMake", () => __awaiter(this, void 0, void 0, function* () { return yield this.launchCMake(cmake, this.cmakeSourceDir, this.logFilesCollector); })); + yield this.baseUtils.wrapOp("Generate project files with CMake", () => __awaiter(this, void 0, void 0, function* () { return yield this.launchTool(cmake, this.cmakeSourceDir, this.logFilesCollector); })); this.baseLib.debug('configure()>>'); }); } @@ -5337,11 +5382,11 @@ class CMakeRunner { CMakeRunner.addArguments(cmake, this.workflowPresetCmdStringFormat); // this.baseLib.debug(`Running the workflow preset named '${workflowPresetName}' ...`); - yield this.baseUtils.wrapOp(`Running workflow '${workflowPresetName}' with CMake`, () => __awaiter(this, void 0, void 0, function* () { return yield this.launchCMake(cmake, this.cmakeSourceDir, this.logFilesCollector); })); + yield this.baseUtils.wrapOp(`Running workflow '${workflowPresetName}' with CMake`, () => __awaiter(this, void 0, void 0, function* () { return yield this.launchTool(cmake, this.cmakeSourceDir, this.logFilesCollector); })); this.baseLib.debug('workflow()>>'); }); } - launchCMake(cmake, sourceDir, logCollector) { + launchTool(tool, sourceDir, logCollector) { return __awaiter(this, void 0, void 0, function* () { const options = { cwd: sourceDir, @@ -5357,16 +5402,16 @@ class CMakeRunner { stderr: (t) => logCollector.handleOutput(t), } }; - const code = yield cmake.exec(options); + const code = yield tool.exec(options); if (code !== 0) { - throw new Error(`"CMake failed with error code: '${code}'.`); + throw new Error(`"'${tool.getName()}' failed with error code: '${code}'.`); } }); } static addArguments(tool, args) { const additionalArgs = baseutillib.replaceFromEnvVar(args); - const arghs = eval(additionalArgs); - for (const arg of arghs) { + const evaluatedArgs = eval(additionalArgs); + for (const arg of evaluatedArgs) { tool.arg(arg); } } @@ -5376,6 +5421,7 @@ CMakeRunner.workflowPresetDefault = "[`--workflow`, `--preset`, `$[env.WORKFLOW_ CMakeRunner.configurePresetDefault = "[`--preset`, `$[env.CONFIGURE_PRESET_NAME]`]"; CMakeRunner.buildPresetDefault = "[`--build`, `--preset`, `$[env.BUILD_PRESET_NAME]`]"; CMakeRunner.testPresetDefault = "[`--preset`, `$[env.TEST_PRESET_NAME]`]"; +CMakeRunner.packagePresetDefault = "[`--preset`, `$[env.PACKAGE_PRESET_NAME]`]"; CMakeRunner.vcpkgEnvDefault = "[`env`, `--bin`, `--include`, `--tools`, `--python`, `--triplet $[env.VCPKG_DEFAULT_TRIPLET]`, `set`]"; //# sourceMappingURL=cmake-runner.js.map @@ -5535,18 +5581,19 @@ __exportStar(__nccwpck_require__(6188), exports); "use strict"; -// Copyright (c) 2019-2020-2021-2022 Luca Cappa +// Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VCPKG_CONFIGURATION_JSON = exports.VCPKG_JSON = exports.VCPKGDEFAULTTRIPLET = exports.VCPKGROOT = exports.vcpkgLastBuiltCommitId = exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = exports.RUNVCPKG_VCPKG_ROOT = void 0; +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'; exports.VCPKGROOT = 'VCPKG_ROOT'; exports.VCPKGDEFAULTTRIPLET = "VCPKG_DEFAULT_TRIPLET"; exports.VCPKG_JSON = "vcpkg.json"; -exports.VCPKG_CONFIGURATION_JSON = "vcpkg-configuration.json"; +exports.VCPKG_INSTALLED_DIR = "VCPKG_INSTALLED_DIR"; +exports.VCPKG_BINARY_SOURCES = `VCPKG_BINARY_SOURCES`; //# sourceMappingURL=vcpkg-globals.js.map /***/ }), @@ -5556,7 +5603,7 @@ exports.VCPKG_CONFIGURATION_JSON = "vcpkg-configuration.json"; "use strict"; -// Copyright (c) 2019-2020-2021-2022 Luca Cappa +// Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -5619,7 +5666,7 @@ class VcpkgRunner { vcpkgUrl = VcpkgRunner.DEFAULTVCPKGURL; baseUtil.baseLib.info(`The vcpkg's URL Git repository is not provided, using the predefined: '${VcpkgRunner.DEFAULTVCPKGURL}'`); } - baseutillib.setEnvVarIfUndefined("VCPKG_INSTALLED_DIR", yield vcpkgutils.getDefaultVcpkgInstallDirectory(baseUtil.baseLib)); + baseutillib.setEnvVarIfUndefined(globals.VCPKG_INSTALLED_DIR, yield vcpkgutils.getDefaultVcpkgInstallDirectory(baseUtil.baseLib)); baseutillib.setEnvVarIfUndefined(globals.VCPKGDEFAULTTRIPLET, baseUtil.getDefaultTriplet()); if (!vcpkgInstallCmd) { vcpkgInstallCmd = baseutillib.replaceFromEnvVar(VcpkgRunner.VCPKGINSTALLCMDDEFAULT); @@ -5668,6 +5715,14 @@ class VcpkgRunner { if (!process.env[VcpkgRunner.VCPKG_ENABLE_METRICS]) { process.env[VcpkgRunner.VCPKG_DISABLE_METRICS] = "1"; } + // 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); + })); + } // Ensuring `this.vcpkgDestPath` is existent, since is going to be used as current working directory. if (!(yield this.baseUtils.baseLib.exist(this.vcpkgDestPath))) { this.baseUtils.baseLib.debug(`Creating vcpkg root directory as it is not existing: ${this.vcpkgDestPath}`); @@ -5695,6 +5750,7 @@ class VcpkgRunner { if (needRebuild) { yield this.baseUtils.wrapOp("Build vcpkg executable", () => this.build()); } + this.baseUtils.wrapOpSync(`Add to PATH vcpkg at '${this.vcpkgDestPath}'`, () => this.baseUtils.baseLib.addPath(this.vcpkgDestPath)); yield this.runVcpkgInstall(); this.baseUtils.wrapOpSync("Set output environment variables", () => this.setOutputs()); this.baseUtils.baseLib.debug("runImpl()>>"); @@ -5892,7 +5948,7 @@ class VcpkgRunner { this.baseUtils.baseLib.info(`vcpkg executable returned code ${result.code}, forcing a rebuild.`); } } - this.baseUtils.baseLib.debug(`checkExecutable()>> -> ${needRebuild}`); + this.baseUtils.baseLib.debug(`checkExecutable()>> -> DoesItNeedRebuild=${needRebuild}`); return needRebuild; }); } @@ -5906,6 +5962,10 @@ class VcpkgRunner { else { bootstrapFileName += '.sh'; } + // On on arm platforms the VCPKG_FORCE_SYSTEM_BINARIES + // environment variable must be set. + if (process.arch === 'arm64') + this.baseUtils.baseLib.setVariable(VcpkgRunner.VCPKG_FORCE_SYSTEM_BINARIES, "1"); if (this.baseUtils.isWin32()) { const cmdPath = yield this.baseUtils.baseLib.which('cmd.exe', true); const cmdTool = this.baseUtils.baseLib.tool(cmdPath); @@ -5935,6 +5995,8 @@ VcpkgRunner.VCPKGINSTALLCMDDEFAULT = '[`install`, `--recurse`, `--clean-after-bu VcpkgRunner.DEFAULTVCPKGURL = 'https://github.com/microsoft/vcpkg.git'; VcpkgRunner.VCPKG_ENABLE_METRICS = "VCPKG_ENABLE_METRICS"; VcpkgRunner.VCPKG_DISABLE_METRICS = "VCPKG_DISABLE_METRICS"; +VcpkgRunner.VCPKG_BINARY_SOURCES_GHA = 'clear;x-gha,readwrite'; +VcpkgRunner.VCPKG_FORCE_SYSTEM_BINARIES = "VCPKG_FORCE_SYSTEM_BINARIES"; //# sourceMappingURL=vcpkg-runner.js.map /***/ }), @@ -5944,7 +6006,7 @@ VcpkgRunner.VCPKG_DISABLE_METRICS = "VCPKG_DISABLE_METRICS"; "use strict"; -// Copyright (c) 2020-2021-2022 Luca Cappa +// Copyright (c) 2020-2021-2022-2023 Luca Cappa // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -5981,7 +6043,7 @@ const path = __importStar(__nccwpck_require__(1017)); /** * * @param vcpkgRootDir The VCPKG_ROOT directory. - * @returns The list of paths to cache, and the ones to not cache (with the prefix exclamation mark). + * @returns The list of paths to cache, and the ones to not cache (with the exclamation mark prefix). */ function getOrdinaryCachedPaths(vcpkgRootDir) { const pathsToCache = [ @@ -19994,7 +20056,7 @@ var __webpack_exports__ = {}; "use strict"; var exports = __webpack_exports__; -// Copyright (c) 2019-2020-2021 Luca Cappa +// Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT Object.defineProperty(exports, "__esModule", ({ value: true })); diff --git a/package-lock.json b/package-lock.json index 832cd91..c0743d6 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.3.0", - "@lukka/assets-lib": "3.3.0", - "@lukka/base-lib": "3.3.0", - "@lukka/base-util-lib": "3.3.0", - "@lukka/run-cmake-lib": "3.3.0", + "@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", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.3.0/5fc4362eb61fa87848bcc0254116dbb6fc4dbde5", - "integrity": "sha512-hlvMtQUQkrlXVYRokf8kuL3ME4LOf9RFeKMJTm7MJrnQXSmDHbFj7F8IIJpr5LY2SH/69xcJg2LeNdV+mZLR0A==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.1/3f45d5669469e193a1296e04125daa731595e41e", + "integrity": "sha512-JEXeDPa2irBh8wKfhO2xaUjRj3hlP42tz511z85BSFEmUp3kp6K9vHr2AKlClP5ADBuPiwLfjMJQ8q86AzH5sA==", "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.3.0", - "@lukka/base-util-lib": "^3.3.0", + "@lukka/base-lib": "^3.6.1", + "@lukka/base-util-lib": "^3.6.1", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.3.0/e2f8697c6bd1449904adc4b89adf7c156b160843", - "integrity": "sha512-wb2046Pw/x1sNEgnyAS+qV5wIIWazeZGbCA0fqM7t0yMiV9wt9/Qlm6d9JhpVa7AQSgxDGvM6kOcJ/hIJP8+YA==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.1/91d03073c984a90d3f4bc202446de380023fef62", + "integrity": "sha512-MS6Jkll2cpwq04qEA/FEAYL6lit9P1dTtOqubUAtWjN2kaKeB6i/iIcwcM1zVMiZ7W+CFBdE1PJJ70swE0f2Hw==", "license": "MIT" }, "node_modules/@lukka/base-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.3.0/f2cb59d710f1ba9d3fbdb9381f8295da3695f5ec", - "integrity": "sha512-lY51MTUh/FO5Ey1hvVoejvhMIkZMN1h7PYt2CrhNzh2PlW6DTTuHc42gLlVa2Rqznmsn85bG8GTzg/kFhXHC3Q==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.1/c258e880f2ccc4b0aa14b0cd10d9d83de8f46380", + "integrity": "sha512-YxOaZ8v6/l8sk8IilQXjvrfbchithoNHrg4kie1h+55rptTEnolsHP2p3P24OmiPCpZbNOmYdPRTWLR4LT/2FQ==", "license": "MIT", "dependencies": { "@types/adm-zip": "^0.4.32", @@ -2028,25 +2028,25 @@ } }, "node_modules/@lukka/base-util-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.3.0/2d3c7da0654298ef8825b731737f7be8ee56abff", - "integrity": "sha512-oiLtNc0aK8H9rTA2oGl2rJkjEQArgcsToVBYFUloG3w9zAfJckjZPO2sEy2vHoqHrArykdOo3c2MjPvhGRu1xw==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.1/718d9e8360098b2234519c7d9236f829748d4ab3", + "integrity": "sha512-BGb42vBc0m7iMpaJs00l32lzaXdhNJkGy+egjzr2xNeoSjAwF2fPsVvRFxt7r6agkp1pTVrLsQVkGelUOopVeA==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^3.3.0", + "@lukka/base-lib": "^3.6.1", "fast-glob": "3.2.7" } }, "node_modules/@lukka/run-cmake-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.3.0/fc549e9d48db8c26fcce40ce92a11f634888ed88", - "integrity": "sha512-q/5w20gyMK1zHfccIqemAuF/H39yf0g56zzdccpyXAOfCt2KnydFE6kkYsqDkcXrw5EhZp5k34hQ9goMZhCZdQ==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.1/5d864d3b87b6b4ea6b5a551397414e56cb0db261", + "integrity": "sha512-bUpONmFgfzlMS6Lv4Xk5Wcxw0CO7j5YdrpR2u+HcTZRCJnw7VSjfYuPnvh9DCVcge6qcn2n9jRigWSd/O7b1Dw==", "license": "MIT", "dependencies": { - "@lukka/action-lib": "^3.3.0", - "@lukka/base-lib": "^3.3.0", - "@lukka/base-util-lib": "^3.3.0", - "@lukka/run-vcpkg-lib": "^3.3.0", + "@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", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.3.0/d9c931073f8c8ab8676ddda7b8d4c9841ddf0d45", - "integrity": "sha512-o7cjaynkY/B2uylcgL7CIjGZ2zUb2VmhuvKqgCvZz716c83TTXC2ZdRK8kfeky+ITjoFvGRA6UoWim4o4djqEw==", + "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==", "license": "MIT", "dependencies": { - "@lukka/action-lib": "^3.3.0", - "@lukka/base-lib": "^3.3.0", - "@lukka/base-util-lib": "^3.3.0", + "@lukka/action-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.1", + "@lukka/base-util-lib": "^3.6.1", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.3.0/5fc4362eb61fa87848bcc0254116dbb6fc4dbde5", - "integrity": "sha512-hlvMtQUQkrlXVYRokf8kuL3ME4LOf9RFeKMJTm7MJrnQXSmDHbFj7F8IIJpr5LY2SH/69xcJg2LeNdV+mZLR0A==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.6.1/3f45d5669469e193a1296e04125daa731595e41e", + "integrity": "sha512-JEXeDPa2irBh8wKfhO2xaUjRj3hlP42tz511z85BSFEmUp3kp6K9vHr2AKlClP5ADBuPiwLfjMJQ8q86AzH5sA==", "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.3.0", - "@lukka/base-util-lib": "^3.3.0", + "@lukka/base-lib": "^3.6.1", + "@lukka/base-util-lib": "^3.6.1", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.3.0/e2f8697c6bd1449904adc4b89adf7c156b160843", - "integrity": "sha512-wb2046Pw/x1sNEgnyAS+qV5wIIWazeZGbCA0fqM7t0yMiV9wt9/Qlm6d9JhpVa7AQSgxDGvM6kOcJ/hIJP8+YA==" + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.6.1/91d03073c984a90d3f4bc202446de380023fef62", + "integrity": "sha512-MS6Jkll2cpwq04qEA/FEAYL6lit9P1dTtOqubUAtWjN2kaKeB6i/iIcwcM1zVMiZ7W+CFBdE1PJJ70swE0f2Hw==" }, "@lukka/base-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.3.0/f2cb59d710f1ba9d3fbdb9381f8295da3695f5ec", - "integrity": "sha512-lY51MTUh/FO5Ey1hvVoejvhMIkZMN1h7PYt2CrhNzh2PlW6DTTuHc42gLlVa2Rqznmsn85bG8GTzg/kFhXHC3Q==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.6.1/c258e880f2ccc4b0aa14b0cd10d9d83de8f46380", + "integrity": "sha512-YxOaZ8v6/l8sk8IilQXjvrfbchithoNHrg4kie1h+55rptTEnolsHP2p3P24OmiPCpZbNOmYdPRTWLR4LT/2FQ==", "requires": { "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", @@ -16665,23 +16665,23 @@ } }, "@lukka/base-util-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.3.0/2d3c7da0654298ef8825b731737f7be8ee56abff", - "integrity": "sha512-oiLtNc0aK8H9rTA2oGl2rJkjEQArgcsToVBYFUloG3w9zAfJckjZPO2sEy2vHoqHrArykdOo3c2MjPvhGRu1xw==", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.6.1/718d9e8360098b2234519c7d9236f829748d4ab3", + "integrity": "sha512-BGb42vBc0m7iMpaJs00l32lzaXdhNJkGy+egjzr2xNeoSjAwF2fPsVvRFxt7r6agkp1pTVrLsQVkGelUOopVeA==", "requires": { - "@lukka/base-lib": "^3.3.0", + "@lukka/base-lib": "^3.6.1", "fast-glob": "3.2.7" } }, "@lukka/run-cmake-lib": { - "version": "3.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.3.0/fc549e9d48db8c26fcce40ce92a11f634888ed88", - "integrity": "sha512-q/5w20gyMK1zHfccIqemAuF/H39yf0g56zzdccpyXAOfCt2KnydFE6kkYsqDkcXrw5EhZp5k34hQ9goMZhCZdQ==", - "requires": { - "@lukka/action-lib": "^3.3.0", - "@lukka/base-lib": "^3.3.0", - "@lukka/base-util-lib": "^3.3.0", - "@lukka/run-vcpkg-lib": "^3.3.0", + "version": "3.6.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-cmake-lib/3.6.1/5d864d3b87b6b4ea6b5a551397414e56cb0db261", + "integrity": "sha512-bUpONmFgfzlMS6Lv4Xk5Wcxw0CO7j5YdrpR2u+HcTZRCJnw7VSjfYuPnvh9DCVcge6qcn2n9jRigWSd/O7b1Dw==", + "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", "@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.3.0", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.3.0/d9c931073f8c8ab8676ddda7b8d4c9841ddf0d45", - "integrity": "sha512-o7cjaynkY/B2uylcgL7CIjGZ2zUb2VmhuvKqgCvZz716c83TTXC2ZdRK8kfeky+ITjoFvGRA6UoWim4o4djqEw==", + "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==", "requires": { - "@lukka/action-lib": "^3.3.0", - "@lukka/base-lib": "^3.3.0", - "@lukka/base-util-lib": "^3.3.0", + "@lukka/action-lib": "^3.6.1", + "@lukka/base-lib": "^3.6.1", + "@lukka/base-util-lib": "^3.6.1", "@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 f52b2b4..e987df4 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.3.0", - "@lukka/assets-lib": "3.3.0", - "@lukka/base-lib": "3.3.0", - "@lukka/base-util-lib": "3.3.0", - "@lukka/run-cmake-lib": "3.3.0", + "@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", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.8.0", "@types/jest": "^26.0.14", diff --git a/src/action.ts b/src/action.ts index c051db1..ff0c110 100644 --- a/src/action.ts +++ b/src/action.ts @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020-2021 Luca Cappa +// Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa // Released under the term specified in file LICENSE.txt // SPDX short identifier: MIT diff --git a/src/cmake-action.ts b/src/cmake-action.ts index a4c6b47..82759ae 100644 --- a/src/cmake-action.ts +++ b/src/cmake-action.ts @@ -8,7 +8,6 @@ import * as cmakeglobals from '@lukka/run-cmake-lib/build/cmake-globals' import * as vcpkgglobals from '@lukka/run-cmake-lib/build/vcpkg-globals' import * as core from '@actions/core' - export async function main(): Promise { const actionLib: libaction.ActionLib = new libaction.ActionLib(); @@ -16,14 +15,17 @@ export async function main(): Promise { const configurePreset = actionLib.getInput(cmakeglobals.configurePreset, false); const buildPreset = actionLib.getInput(cmakeglobals.buildPreset, false); const testPreset = actionLib.getInput(cmakeglobals.testPreset, false); + const packagePreset = actionLib.getInput(cmakeglobals.packagePreset, false); const workflowPreset = actionLib.getInput(cmakeglobals.workflowPreset, false); const workflowPresetCmdStringFormat = actionLib.getInput(cmakeglobals.workflowPresetFormat, false); const configurePresetCmdStringFormat = actionLib.getInput(cmakeglobals.configurePresetFormat, false); const buildPresetCmdStringFormat = actionLib.getInput(cmakeglobals.buildPresetFormat, false); const testPresetCmdStringFormat = actionLib.getInput(cmakeglobals.testPresetFormat, false); + const packagePresetCmdStringFormat = actionLib.getInput(cmakeglobals.packagePresetFormat, false); const configurePresetAdditionalArgs = actionLib.getInput(cmakeglobals.configurePresetAdditionalArgs, false); const buildPresetAdditionalArgs = actionLib.getInput(cmakeglobals.buildPresetAdditionalArgs, false); const testPresetAdditionalArgs = actionLib.getInput(cmakeglobals.testPresetAdditionalArgs, false); + const packagePresetAdditionalArgs = actionLib.getInput(cmakeglobals.packagePresetAdditionalArgs, false); const runVcpkgEnvFormatString = actionLib.getInput(vcpkgglobals.runVcpkgEnvFormatStringInput, false); await runcmakelib.CMakeRunner.run( actionLib, @@ -31,6 +33,7 @@ export async function main(): Promise { configurePreset, configurePresetCmdStringFormat, configurePresetAdditionalArgs, buildPreset, buildPresetCmdStringFormat, buildPresetAdditionalArgs, testPreset, testPresetCmdStringFormat, testPresetAdditionalArgs, + packagePreset, packagePresetCmdStringFormat, packagePresetAdditionalArgs, runVcpkgEnvFormatString); actionLib.info('run-cmake action execution succeeded'); process.exitCode = 0;