diff --git a/action.yml b/action.yml index ba28e67a..e2b32f3e 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,10 @@ inputs: description: If release notes should be automatically generated. default: false required: false + zip_export: + description: If the export should be zipped. Only used if create_release is false. + default: true + required: false runs: using: 'node12' diff --git a/dist/index.js b/dist/index.js index 4b151996..4796a4d1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10534,7 +10534,12 @@ function moveExports(exportResults) { yield Object(io.mkdirP)(relativeProjectExportsPath); const promises = []; for (const exportResult of exportResults) { - promises.push(move(yield zip(exportResult))); + if (shouldZipExport) { + promises.push(move(yield zip(exportResult))); + } + else { + promises.push(moveDirectory(exportResult.buildDirectory)); + } } yield Promise.all(promises); return 0; @@ -10572,6 +10577,11 @@ function move(zipPath) { yield Object(io.mv)(zipPath, Object(external_path_.join)(relativeProjectExportsPath, Object(external_path_.basename)(zipPath))); }); } +function moveDirectory(dir) { + return __awaiter(this, void 0, void 0, function* () { + yield Object(io.mv)(dir, relativeProjectExportsPath); + }); +} function findExecutablePath(basePath) { const paths = Object(external_fs_.readdirSync)(basePath); const dirs = []; @@ -10629,6 +10639,7 @@ var external_os_ = __webpack_require__(87); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relativeProjectExportsPath", function() { return relativeProjectExportsPath; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGitHubClient", function() { return getGitHubClient; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLatestReleaseTagName", function() { return getLatestReleaseTagName; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldZipExport", function() { return shouldZipExport; }); var main_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -10650,6 +10661,7 @@ const actionWorkingPath = Object(external_path_.resolve)(Object(external_path_.j const relativeProjectPath = Object(core.getInput)('relative_project_path'); const shouldCreateRelease = Object(core.getInput)('create_release') === 'true'; const relativeProjectExportsPath = Object(external_path_.join)(relativeProjectPath, 'exports'); +const shouldZipExport = Object(core.getInput)('zip_export') === 'true'; function main() { return main_awaiter(this, void 0, void 0, function* () { yield configCheck(); diff --git a/src/godot.ts b/src/godot.ts index 6d806f36..98b28c04 100644 --- a/src/godot.ts +++ b/src/godot.ts @@ -9,6 +9,7 @@ import { relativeProjectExportsPath, getGitHubClient, getLatestReleaseTagName, + shouldZipExport, } from './main'; import * as ini from 'ini'; import { ExportPresets, ExportPreset, ExportResult } from './types/GodotExport'; @@ -194,7 +195,12 @@ async function moveExports(exportResults: ExportResult[]): Promise { const promises: Promise[] = []; for (const exportResult of exportResults) { - promises.push(move(await zip(exportResult))); + if (shouldZipExport) { + promises.push(move(await zip(exportResult))); + } + else { + promises.push(moveDirectory(exportResult.buildDirectory)); + } } await Promise.all(promises); @@ -232,6 +238,10 @@ async function move(zipPath: string): Promise { await io.mv(zipPath, path.join(relativeProjectExportsPath, path.basename(zipPath))); } +async function moveDirectory(dir: string): Promise { + await io.mv(dir, relativeProjectExportsPath); +} + function findExecutablePath(basePath: string): string | undefined { const paths = fs.readdirSync(basePath); const dirs: string[] = []; diff --git a/src/main.ts b/src/main.ts index d2020a19..bd68ef99 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,6 +11,7 @@ const actionWorkingPath = path.resolve(path.join(os.homedir(), '/.local/share/go const relativeProjectPath = core.getInput('relative_project_path'); const shouldCreateRelease = core.getInput('create_release') === 'true'; const relativeProjectExportsPath = path.join(relativeProjectPath, 'exports'); +const shouldZipExport = core.getInput('zip_export') === 'true'; async function main(): Promise { await configCheck(); @@ -123,4 +124,4 @@ function logAndExit(error: Error): void { main().catch(logAndExit); -export { actionWorkingPath, relativeProjectPath, relativeProjectExportsPath, getGitHubClient, getLatestReleaseTagName }; +export { actionWorkingPath, relativeProjectPath, relativeProjectExportsPath, getGitHubClient, getLatestReleaseTagName, shouldZipExport };