fix: rebuild dist
This commit is contained in:
parent
72ff56e899
commit
173e3715b0
|
@ -71180,11 +71180,12 @@ const exec = __importStar(__nccwpck_require__(1514));
|
||||||
const io = __importStar(__nccwpck_require__(7436));
|
const io = __importStar(__nccwpck_require__(7436));
|
||||||
const hc = __importStar(__nccwpck_require__(6255));
|
const hc = __importStar(__nccwpck_require__(6255));
|
||||||
const fs_1 = __nccwpck_require__(7147);
|
const fs_1 = __nccwpck_require__(7147);
|
||||||
const promises_1 = __nccwpck_require__(3292);
|
|
||||||
const path_1 = __importDefault(__nccwpck_require__(1017));
|
const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||||
const os_1 = __importDefault(__nccwpck_require__(2037));
|
const os_1 = __importDefault(__nccwpck_require__(2037));
|
||||||
const semver_1 = __importDefault(__nccwpck_require__(5911));
|
const semver_1 = __importDefault(__nccwpck_require__(5911));
|
||||||
const utils_1 = __nccwpck_require__(1314);
|
const utils_1 = __nccwpck_require__(1314);
|
||||||
|
const QUALITY_INPUT_MINIMAL_MAJOR_TAG = 6;
|
||||||
|
const LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG = 5;
|
||||||
class DotnetVersionResolver {
|
class DotnetVersionResolver {
|
||||||
constructor(version) {
|
constructor(version) {
|
||||||
this.inputVersion = version.trim();
|
this.inputVersion = version.trim();
|
||||||
|
@ -71192,35 +71193,54 @@ class DotnetVersionResolver {
|
||||||
}
|
}
|
||||||
resolveVersionInput() {
|
resolveVersionInput() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!semver_1.default.validRange(this.inputVersion)) {
|
if (!semver_1.default.validRange(this.inputVersion) && !this.isLatestPatchSyntax()) {
|
||||||
throw new Error(`'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x`);
|
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! Supported syntax: A.B.C, A.B, A.B.x, A, A.x, A.B.Cxx`);
|
||||||
}
|
}
|
||||||
if (semver_1.default.valid(this.inputVersion)) {
|
if (semver_1.default.valid(this.inputVersion)) {
|
||||||
this.resolvedArgument.type = 'version';
|
this.createVersionArgument();
|
||||||
this.resolvedArgument.value = this.inputVersion;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const [major, minor] = this.inputVersion.split('.');
|
yield this.createChannelArgument();
|
||||||
if (this.isNumericTag(major)) {
|
|
||||||
this.resolvedArgument.type = 'channel';
|
|
||||||
if (this.isNumericTag(minor)) {
|
|
||||||
this.resolvedArgument.value = `${major}.${minor}`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const httpClient = new hc.HttpClient('actions/setup-dotnet', [], {
|
|
||||||
allowRetries: true,
|
|
||||||
maxRetries: 3
|
|
||||||
});
|
|
||||||
this.resolvedArgument.value = yield this.getLatestVersion(httpClient, [major, minor]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.resolvedArgument.qualityFlag = +major >= 6 ? true : false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
isNumericTag(versionTag) {
|
isNumericTag(versionTag) {
|
||||||
return /^\d+$/.test(versionTag);
|
return /^\d+$/.test(versionTag);
|
||||||
}
|
}
|
||||||
|
isLatestPatchSyntax() {
|
||||||
|
var _b, _c;
|
||||||
|
const majorTag = (_c = (_b = this.inputVersion.match(/^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/)) === null || _b === void 0 ? void 0 : _b.groups) === null || _c === void 0 ? void 0 : _c.majorTag;
|
||||||
|
if (majorTag &&
|
||||||
|
parseInt(majorTag) < LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG) {
|
||||||
|
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! The A.B.Cxx syntax is available since the .NET 5.0 release.`);
|
||||||
|
}
|
||||||
|
return majorTag ? true : false;
|
||||||
|
}
|
||||||
|
createVersionArgument() {
|
||||||
|
this.resolvedArgument.type = 'version';
|
||||||
|
this.resolvedArgument.value = this.inputVersion;
|
||||||
|
}
|
||||||
|
createChannelArgument() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
this.resolvedArgument.type = 'channel';
|
||||||
|
const [major, minor] = this.inputVersion.split('.');
|
||||||
|
if (this.isLatestPatchSyntax()) {
|
||||||
|
this.resolvedArgument.value = this.inputVersion;
|
||||||
|
}
|
||||||
|
else if (this.isNumericTag(major) && this.isNumericTag(minor)) {
|
||||||
|
this.resolvedArgument.value = `${major}.${minor}`;
|
||||||
|
}
|
||||||
|
else if (this.isNumericTag(major)) {
|
||||||
|
this.resolvedArgument.value = yield this.getLatestByMajorTag(major);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// If "dotnet-version" is specified as *, x or X resolve latest version of .NET explicitly from LTS channel. The version argument will default to "latest" by install-dotnet script.
|
||||||
|
this.resolvedArgument.value = 'LTS';
|
||||||
|
}
|
||||||
|
this.resolvedArgument.qualityFlag =
|
||||||
|
parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false;
|
||||||
|
});
|
||||||
|
}
|
||||||
createDotNetVersion() {
|
createDotNetVersion() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
yield this.resolveVersionInput();
|
yield this.resolveVersionInput();
|
||||||
|
@ -71238,17 +71258,21 @@ class DotnetVersionResolver {
|
||||||
return this.resolvedArgument;
|
return this.resolvedArgument;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getLatestVersion(httpClient, versionParts) {
|
getLatestByMajorTag(majorTag) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const httpClient = new hc.HttpClient('actions/setup-dotnet', [], {
|
||||||
|
allowRetries: true,
|
||||||
|
maxRetries: 3
|
||||||
|
});
|
||||||
const response = yield httpClient.getJson(DotnetVersionResolver.DotNetCoreIndexUrl);
|
const response = yield httpClient.getJson(DotnetVersionResolver.DotNetCoreIndexUrl);
|
||||||
const result = response.result || {};
|
const result = response.result || {};
|
||||||
const releasesInfo = result['releases-index'];
|
const releasesInfo = result['releases-index'];
|
||||||
const releaseInfo = releasesInfo.find(info => {
|
const releaseInfo = releasesInfo.find(info => {
|
||||||
const sdkParts = info['channel-version'].split('.');
|
const sdkParts = info['channel-version'].split('.');
|
||||||
return sdkParts[0] === versionParts[0];
|
return sdkParts[0] === majorTag;
|
||||||
});
|
});
|
||||||
if (!releaseInfo) {
|
if (!releaseInfo) {
|
||||||
throw new Error(`Could not find info for version ${versionParts.join('.')} at ${DotnetVersionResolver.DotNetCoreIndexUrl}`);
|
throw new Error(`Could not find info for version with major tag: "${majorTag}" at ${DotnetVersionResolver.DotNetCoreIndexUrl}`);
|
||||||
}
|
}
|
||||||
return releaseInfo['channel-version'];
|
return releaseInfo['channel-version'];
|
||||||
});
|
});
|
||||||
|
@ -71283,7 +71307,7 @@ class DotnetCoreInstaller {
|
||||||
scriptArguments.push(option, this.quality);
|
scriptArguments.push(option, this.quality);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.warning(`'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A and A.x formats where the major tag is higher than 5. You specified: ${this.version}. 'dotnet-quality' input is ignored.`);
|
core.warning(`The 'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A, A.x and A.B.Cxx formats where the major tag is higher than 5. You specified: ${this.version}. 'dotnet-quality' input is ignored.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
installDotnet() {
|
installDotnet() {
|
||||||
|
@ -71340,22 +71364,21 @@ class DotnetCoreInstaller {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
env: process.env
|
env: process.env
|
||||||
};
|
};
|
||||||
const { exitCode, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions);
|
const { exitCode, stdout, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions);
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`);
|
throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`);
|
||||||
}
|
}
|
||||||
return this.outputDotnetVersion(dotnetVersion.value);
|
return this.parseInstalledVersion(stdout);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
outputDotnetVersion(version) {
|
parseInstalledVersion(stdout) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const regex = /(?<version>\d+\.\d+\.\d+[a-z0-9._-]*)/gm;
|
||||||
const installationPath = process.env['DOTNET_INSTALL_DIR'];
|
const matchedResult = regex.exec(stdout);
|
||||||
const versionsOnRunner = yield (0, promises_1.readdir)(path_1.default.join(installationPath.replace(/'/g, ''), 'sdk'));
|
if (!matchedResult) {
|
||||||
const installedVersion = semver_1.default.maxSatisfying(versionsOnRunner, version, {
|
core.warning(`Failed to parse installed by the script version of .NET`);
|
||||||
includePrerelease: true
|
return null;
|
||||||
});
|
}
|
||||||
return installedVersion;
|
return matchedResult.groups.version;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DotnetCoreInstaller = DotnetCoreInstaller;
|
exports.DotnetCoreInstaller = DotnetCoreInstaller;
|
||||||
|
@ -71472,13 +71495,13 @@ function run() {
|
||||||
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
versions.push(getVersionFromGlobalJson(globalJsonPath));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info(`global.json wasn't found in the root directory. No .NET version will be installed.`);
|
core.info(`The global.json wasn't found in the root directory. No .NET version will be installed.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (versions.length) {
|
if (versions.length) {
|
||||||
const quality = core.getInput('dotnet-quality');
|
const quality = core.getInput('dotnet-quality');
|
||||||
if (quality && !qualityOptions.includes(quality)) {
|
if (quality && !qualityOptions.includes(quality)) {
|
||||||
throw new Error(`${quality} is not a supported value for 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`);
|
throw new Error(`Value '${quality}' is not supported for the 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`);
|
||||||
}
|
}
|
||||||
let dotnetInstaller;
|
let dotnetInstaller;
|
||||||
const uniqueVersions = new Set(versions);
|
const uniqueVersions = new Set(versions);
|
||||||
|
@ -71494,13 +71517,7 @@ function run() {
|
||||||
if (sourceUrl) {
|
if (sourceUrl) {
|
||||||
auth.configAuthentication(sourceUrl, configFile);
|
auth.configAuthentication(sourceUrl, configFile);
|
||||||
}
|
}
|
||||||
const comparisonRange = globalJsonFileInput
|
outputInstalledVersion(installedDotnetVersions, globalJsonFileInput);
|
||||||
? versions[versions.length - 1]
|
|
||||||
: '*';
|
|
||||||
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, {
|
|
||||||
includePrerelease: true
|
|
||||||
});
|
|
||||||
core.setOutput(constants_1.Outputs.DotnetVersion, versionToOutput);
|
|
||||||
if (core.getBooleanInput('cache') && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
if (core.getBooleanInput('cache') && (0, cache_utils_1.isCacheFeatureAvailable)()) {
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
yield (0, cache_restore_1.restoreCache)(cacheDependencyPath);
|
yield (0, cache_restore_1.restoreCache)(cacheDependencyPath);
|
||||||
|
@ -71529,6 +71546,25 @@ function getVersionFromGlobalJson(globalJsonPath) {
|
||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
function outputInstalledVersion(installedVersions, globalJsonFileInput) {
|
||||||
|
if (!installedVersions.length) {
|
||||||
|
core.info(`The '${constants_1.Outputs.DotnetVersion}' output will not be set.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (installedVersions.includes(null)) {
|
||||||
|
core.warning(`Failed to output the installed version of .NET. The '${constants_1.Outputs.DotnetVersion}' output will not be set.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (globalJsonFileInput) {
|
||||||
|
const versionToOutput = installedVersions.at(-1); // .NET SDK version parsed from the global.json file is installed last
|
||||||
|
core.setOutput(constants_1.Outputs.DotnetVersion, versionToOutput);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const versionToOutput = semver_1.default.maxSatisfying(installedVersions, '*', {
|
||||||
|
includePrerelease: true
|
||||||
|
});
|
||||||
|
core.setOutput(constants_1.Outputs.DotnetVersion, versionToOutput);
|
||||||
|
}
|
||||||
run();
|
run();
|
||||||
|
|
||||||
|
|
||||||
|
@ -71603,14 +71639,6 @@ module.exports = require("fs");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 3292:
|
|
||||||
/***/ ((module) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
module.exports = require("fs/promises");
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 3685:
|
/***/ 3685:
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue