@@ -28778,54 +28778,66 @@ exports["default"] = _default;
28778
28778
28779
28779
/***/ }),
28780
28780
28781
- /***/ 1751 :
28782
- /***/ ((module, __unused_webpack_exports , __nccwpck_require__) => {
28781
+ /***/ 1517 :
28782
+ /***/ ((__unused_webpack_module, exports , __nccwpck_require__) => {
28783
28783
28784
+ "use strict";
28785
+
28786
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
28787
+ exports.PrintLogs = PrintLogs;
28784
28788
const core = __nccwpck_require__(2186);
28785
- const fs = __nccwpck_require__(3292 );
28789
+ const fs = __nccwpck_require__(7147 );
28786
28790
const excludedPaths = ['steambootstrapper', 'appcache', 'steamapps'];
28787
-
28788
28791
async function PrintLogs(directory, clear = false) {
28789
28792
core.info(directory);
28790
28793
try {
28791
- const files = await fs.readdir(directory, { recursive: true });
28794
+ const files = await fs.promises. readdir(directory, { recursive: true });
28792
28795
for (const file of files) {
28793
28796
try {
28794
28797
const fullPath = `${directory}/${file}`;
28795
- const stat = await fs.stat(fullPath);
28796
- if (!stat.isFile()) { continue; }
28797
- if (!/\.(log|txt|vdf)$/.test(file)) { continue }
28798
- if (excludedPaths.some(excluded => fullPath.includes(excluded))) { continue; }
28799
- const logContent = await fs.readFile(fullPath, 'utf8');
28800
- core.info(`::group::${file}`);
28798
+ const stat = await fs.promises.stat(fullPath);
28799
+ if (!stat.isFile()) {
28800
+ continue;
28801
+ }
28802
+ if (!/\.(log|txt|vdf)$/.test(file)) {
28803
+ continue;
28804
+ }
28805
+ if (excludedPaths.some(excluded => fullPath.includes(excluded))) {
28806
+ continue;
28807
+ }
28808
+ const logContent = await fs.promises.readFile(fullPath, 'utf8');
28809
+ core.startGroup(file);
28801
28810
core.info(logContent);
28802
- core.info('::endgroup::' );
28811
+ core.endGroup( );
28803
28812
if (clear && fullPath.includes('logs')) {
28804
- await fs.unlink(fullPath);
28813
+ await fs.promises. unlink(fullPath);
28805
28814
}
28806
- } catch (error) {
28815
+ }
28816
+ catch (error) {
28807
28817
core.error(`Failed to read log: ${file}\n${error.message}`);
28808
28818
}
28809
28819
}
28810
- } catch (error) {
28820
+ }
28821
+ catch (error) {
28811
28822
core.error(`Failed to read logs in ${directory}!\n${error.message}`);
28812
28823
}
28813
28824
}
28814
28825
28815
- module.exports = { PrintLogs }
28816
-
28817
28826
28818
28827
/***/ }),
28819
28828
28820
- /***/ 7521 :
28821
- /***/ ((module, __unused_webpack_exports , __nccwpck_require__) => {
28829
+ /***/ 8429 :
28830
+ /***/ ((__unused_webpack_module, exports , __nccwpck_require__) => {
28822
28831
28823
- const path = __nccwpck_require__(1017);
28824
- const core = __nccwpck_require__(2186);
28832
+ "use strict";
28833
+
28834
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
28835
+ exports.Run = Run;
28825
28836
const tc = __nccwpck_require__(7784);
28837
+ const core = __nccwpck_require__(2186);
28826
28838
const exec = __nccwpck_require__(1514);
28827
- const fs = ( __nccwpck_require__(7147).promises );
28828
-
28839
+ const path = __nccwpck_require__(1017 );
28840
+ const fs = __nccwpck_require__(7147);
28829
28841
const steamcmd = 'steamcmd';
28830
28842
const STEAM_CMD = 'STEAM_CMD';
28831
28843
const STEAM_DIR = 'STEAM_DIR';
@@ -28835,7 +28847,6 @@ const IS_MAC = process.platform === 'darwin';
28835
28847
const IS_WINDOWS = process.platform === 'win32';
28836
28848
const toolExtension = IS_WINDOWS ? '.exe' : '.sh';
28837
28849
const toolPath = `${steamcmd}${toolExtension}`;
28838
-
28839
28850
async function Run() {
28840
28851
const [toolDirectory, steamDir] = await findOrDownload();
28841
28852
core.debug(`${STEAM_CMD} -> ${toolDirectory}`);
@@ -28845,12 +28856,11 @@ async function Run() {
28845
28856
core.debug(`${STEAM_DIR} -> ${steamDir}`);
28846
28857
core.exportVariable(STEAM_DIR, steamDir);
28847
28858
const steam_temp = path.join(process.env.RUNNER_TEMP, '.steamworks');
28848
- fs .mkdir(steam_temp);
28859
+ await fs.promises .mkdir(steam_temp);
28849
28860
core.debug(`${STEAM_TEMP} -> ${steam_temp}`);
28850
28861
core.exportVariable(STEAM_TEMP, steam_temp);
28851
28862
await exec.exec(steamcmd, ['+help', '+quit']);
28852
28863
}
28853
-
28854
28864
async function findOrDownload() {
28855
28865
const allVersions = tc.findAllVersions(steamcmd);
28856
28866
core.debug(`Found versions: ${allVersions}`);
@@ -28870,7 +28880,8 @@ async function findOrDownload() {
28870
28880
let downloadDirectory = path.join(getTempDirectory(), steamcmd);
28871
28881
if (IS_WINDOWS) {
28872
28882
downloadDirectory = await tc.extractZip(archivePath, downloadDirectory);
28873
- } else {
28883
+ }
28884
+ else {
28874
28885
downloadDirectory = await tc.extractTar(archivePath, downloadDirectory);
28875
28886
}
28876
28887
if (!downloadDirectory) {
@@ -28883,21 +28894,21 @@ async function findOrDownload() {
28883
28894
tool = path.join(downloadDirectory, toolPath);
28884
28895
if (IS_LINUX) {
28885
28896
const exe = path.join(downloadDirectory, steamcmd);
28886
- await fs.writeFile(exe, `#!/bin/bash\nexec "${tool}" "$@"`);
28887
- await fs.chmod(exe, 0o755);
28897
+ await fs.promises. writeFile(exe, `#!/bin/bash\nexec "${tool}" "$@"`);
28898
+ await fs.promises. chmod(exe, 0o755);
28888
28899
}
28889
28900
const downloadVersion = await getVersion(tool);
28890
28901
core.debug(`Setting tool cache: ${downloadDirectory} | ${steamcmd} | ${downloadVersion}`);
28891
28902
toolDirectory = await tc.cacheDir(downloadDirectory, steamcmd, downloadVersion);
28892
- } else {
28903
+ }
28904
+ else {
28893
28905
tool = path.join(toolDirectory, toolPath);
28894
28906
}
28895
- fs .access(tool);
28907
+ await fs.promises .access(tool);
28896
28908
core.debug(`Found ${tool} in ${toolDirectory}`);
28897
- const steamDir = getSteamDir(toolDirectory);
28909
+ const steamDir = await getSteamDir(toolDirectory);
28898
28910
return [toolDirectory, steamDir];
28899
28911
}
28900
-
28901
28912
function getDownloadUrl() {
28902
28913
let archiveName = undefined;
28903
28914
switch (process.platform) {
@@ -28915,15 +28926,13 @@ function getDownloadUrl() {
28915
28926
}
28916
28927
return [`https://steamcdn-a.akamaihd.net/client/installer/${archiveName}`, archiveName];
28917
28928
}
28918
-
28919
28929
function getTempDirectory() {
28920
- const tempDirectory = process.env['RUNNER_TEMP'] || ''
28921
- return tempDirectory
28930
+ const tempDirectory = process.env['RUNNER_TEMP'] || '';
28931
+ return tempDirectory;
28922
28932
}
28923
-
28924
28933
async function getVersion(tool) {
28925
28934
let output = '';
28926
- await exec.exec(tool, ' +quit' , {
28935
+ await exec.exec(tool, [` +quit`] , {
28927
28936
listeners: {
28928
28937
stdout: (data) => {
28929
28938
output += data.toString();
@@ -28941,10 +28950,9 @@ async function getVersion(tool) {
28941
28950
throw new Error('Failed to parse version');
28942
28951
}
28943
28952
core.debug(`Found version: ${version}`);
28944
- return version
28953
+ return version;
28945
28954
}
28946
-
28947
- function getSteamDir(toolDirectory) {
28955
+ async function getSteamDir(toolDirectory) {
28948
28956
let steamDir = undefined;
28949
28957
switch (process.platform) {
28950
28958
case 'linux':
@@ -28957,23 +28965,22 @@ function getSteamDir(toolDirectory) {
28957
28965
steamDir = toolDirectory;
28958
28966
break;
28959
28967
}
28960
- // check if steam directory exists and create if not
28961
28968
try {
28962
- fs.access(steamDir);
28963
- } catch (error) {
28969
+ await fs.promises.access(steamDir);
28970
+ }
28971
+ catch (error) {
28964
28972
if (error.code === 'ENOENT') {
28965
28973
core.debug(`Creating steam directory: ${steamDir}`);
28966
- fs.mkdir(steamDir);
28967
- } else {
28974
+ await fs.promises.mkdir(steamDir);
28975
+ }
28976
+ else {
28968
28977
throw error;
28969
28978
}
28970
28979
}
28971
28980
core.debug(`Steam directory: ${steamDir}`);
28972
28981
return steamDir;
28973
28982
}
28974
28983
28975
- module.exports = { Run }
28976
-
28977
28984
28978
28985
/***/ }),
28979
28986
@@ -29057,14 +29064,6 @@ module.exports = require("fs");
29057
29064
29058
29065
/***/ }),
29059
29066
29060
- /***/ 3292:
29061
- /***/ ((module) => {
29062
-
29063
- "use strict";
29064
- module.exports = require("fs/promises");
29065
-
29066
- /***/ }),
29067
-
29068
29067
/***/ 3685:
29069
29068
/***/ ((module) => {
29070
29069
@@ -30889,34 +30888,38 @@ module.exports = parseParams
30889
30888
/******/
30890
30889
/************************************************************************/
30891
30890
var __webpack_exports__ = {};
30892
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk .
30891
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode .
30893
30892
(() => {
30894
- const core = __nccwpck_require__(2186);
30895
- const logging = __nccwpck_require__(1751);
30896
- const setup = __nccwpck_require__(7521);
30893
+ "use strict";
30894
+ var exports = __webpack_exports__;
30897
30895
30896
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
30897
+ const core = __nccwpck_require__(2186);
30898
+ const logging = __nccwpck_require__(1517);
30899
+ const setup = __nccwpck_require__(8429);
30898
30900
const IsPost = !!core.getState('isPost');
30899
-
30900
30901
const main = async () => {
30901
30902
if (!IsPost) {
30902
30903
core.saveState('isPost', 'true');
30903
30904
core.info('Setup steamcmd...');
30904
30905
try {
30905
30906
await setup.Run();
30906
- } catch (error) {
30907
+ }
30908
+ catch (error) {
30907
30909
core.setFailed(error);
30908
30910
}
30909
- } else {
30911
+ }
30912
+ else {
30910
30913
core.info('steamcmd logs:');
30911
30914
await logging.PrintLogs(process.env.STEAM_TEMP);
30912
30915
if (process.platform === 'win32') {
30913
30916
await logging.PrintLogs(process.env.STEAM_CMD, true);
30914
- } else {
30917
+ }
30918
+ else {
30915
30919
await logging.PrintLogs(process.env.STEAM_DIR, true);
30916
30920
}
30917
30921
}
30918
- }
30919
-
30922
+ };
30920
30923
main();
30921
30924
30922
30925
})();
0 commit comments