build: build distribution files directly from TypeScript files (#221)

* build: build dist directly from TypeScript sources

* build(ts): adjust options in `tsconfig.json`

* fix: import all instead of default in @actions modules
This commit is contained in:
Alfi Maulana
2024-03-04 20:16:05 +07:00
committed by GitHub
parent e0f6aeea02
commit d37829ef6a
5 changed files with 54 additions and 26 deletions

46
dist/index.js generated vendored
View File

@@ -27685,6 +27685,35 @@ module.exports = parseParams
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __nccwpck_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __nccwpck_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __nccwpck_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
@@ -27694,8 +27723,11 @@ var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(2340);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(_actions_core__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(4926);
/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nccwpck_require__.n(_actions_exec__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _actions_io__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(1793);
/* harmony import */ var _actions_io__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nccwpck_require__.n(_actions_io__WEBPACK_IMPORTED_MODULE_2__);
@@ -27706,16 +27738,16 @@ async function main() {
const generator = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("generator");
if (generator)
configureArgs.push(...["-G", generator]);
if (generator.match(/ninja/gi) && !(await _actions_io__WEBPACK_IMPORTED_MODULE_2__.which("ninja"))) {
if (generator.match(/ninja/gi) && !(await (0,_actions_io__WEBPACK_IMPORTED_MODULE_2__.which)("ninja"))) {
switch (process.platform) {
case "linux":
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("sudo", ["apt", "install", "-y", "ninja-build"]);
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("sudo", ["apt", "install", "-y", "ninja-build"]);
break;
case "darwin":
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("brew", ["install", "ninja"]);
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("brew", ["install", "ninja"]);
break;
case "win32":
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("choco", ["install", "ninja"]);
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("choco", ["install", "ninja"]);
break;
}
}
@@ -27738,19 +27770,19 @@ async function main() {
const args = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("args")
.flatMap((args) => args.split(" "));
configureArgs.push(...args);
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", configureArgs);
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("cmake", configureArgs);
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", buildDir || "build");
const runBuild = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-build");
const runTest = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-test");
if (runBuild || runTest) {
const buildArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("build-args")
.flatMap((args) => args.split(" "));
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("cmake", ["--build", buildDir || "build", ...buildArgs]);
}
if (runTest) {
const testArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("test-args")
.flatMap((args) => args.split(" "));
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("ctest", [
await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec)("ctest", [
"--test-dir",
buildDir || "build",
"--output-on-failure",