mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
rebuild
This commit is contained in:
parent
9c0b5f2c57
commit
90a3d02a0c
2 changed files with 23 additions and 5 deletions
25
dist/setup/index.js
vendored
25
dist/setup/index.js
vendored
|
@ -63130,8 +63130,17 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void
|
||||||
});
|
});
|
||||||
exports.getPackageManagerInfo = getPackageManagerInfo;
|
exports.getPackageManagerInfo = getPackageManagerInfo;
|
||||||
const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const pathList = yield Promise.all(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); })));
|
const pathOutputs = yield Promise.allSettled(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); })));
|
||||||
const cachePaths = pathList.filter(item => item);
|
const results = pathOutputs.map(item => {
|
||||||
|
if (item.status === 'fulfilled') {
|
||||||
|
return item.value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info(`[warning]getting cache directory path failed: ${item.reason}`);
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
const cachePaths = results.filter(item => item);
|
||||||
if (!cachePaths.length) {
|
if (!cachePaths.length) {
|
||||||
throw new Error(`Could not get cache folder paths.`);
|
throw new Error(`Could not get cache folder paths.`);
|
||||||
}
|
}
|
||||||
|
@ -63596,16 +63605,24 @@ function run() {
|
||||||
core.info('Setting GOROOT for Go version < 1.9');
|
core.info('Setting GOROOT for Go version < 1.9');
|
||||||
core.exportVariable('GOROOT', installDir);
|
core.exportVariable('GOROOT', installDir);
|
||||||
}
|
}
|
||||||
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
|
||||||
}
|
}
|
||||||
const added = yield addBinToPath();
|
const added = yield addBinToPath();
|
||||||
core.debug(`add bin ${added}`);
|
core.debug(`add bin ${added}`);
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
|
||||||
const goPath = yield io.which('go');
|
const goPath = yield io.which('go');
|
||||||
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
||||||
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
||||||
const packageManager = 'default';
|
const packageManager = 'default';
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
|
try {
|
||||||
|
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.warning(`Restore cache failed: ${error.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// add problem matchers
|
// add problem matchers
|
||||||
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
||||||
|
|
|
@ -50,6 +50,8 @@ export async function run() {
|
||||||
core.info('Setting GOROOT for Go version < 1.9');
|
core.info('Setting GOROOT for Go version < 1.9');
|
||||||
core.exportVariable('GOROOT', installDir);
|
core.exportVariable('GOROOT', installDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
'[warning]go-version input was not specified. The action will try to use pre-installed version.'
|
'[warning]go-version input was not specified. The action will try to use pre-installed version.'
|
||||||
|
@ -58,7 +60,6 @@ export async function run() {
|
||||||
|
|
||||||
const added = await addBinToPath();
|
const added = await addBinToPath();
|
||||||
core.debug(`add bin ${added}`);
|
core.debug(`add bin ${added}`);
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
|
||||||
|
|
||||||
const goPath = await io.which('go');
|
const goPath = await io.which('go');
|
||||||
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
||||||
|
|
Loading…
Add table
Reference in a new issue