mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-25 12:53:06 +07:00
Rebuild action
This commit is contained in:
parent
4f6b2f576a
commit
660c25a321
22
dist/index.js
vendored
22
dist/index.js
vendored
@ -250,18 +250,24 @@ class DotnetVersionResolver {
|
||||
}
|
||||
resolveVersionInput() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!semver_1.default.validRange(this.inputVersion)) {
|
||||
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`);
|
||||
const isLatestPatchSyntax = /^\d+\.\d+\.\d{1}x{2}$/.test(this.inputVersion);
|
||||
if (!semver_1.default.validRange(this.inputVersion) && !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, A.B.Cxx`);
|
||||
}
|
||||
if (semver_1.default.valid(this.inputVersion)) {
|
||||
this.resolvedArgument.type = 'version';
|
||||
this.resolvedArgument.value = this.inputVersion;
|
||||
}
|
||||
else if (!this.inputVersion) {
|
||||
this.resolvedArgument.type = null;
|
||||
}
|
||||
else {
|
||||
const [major, minor] = this.inputVersion.split('.');
|
||||
if (this.isNumericTag(major)) {
|
||||
this.resolvedArgument.type = 'channel';
|
||||
if (this.isNumericTag(minor)) {
|
||||
const [major, minor] = this.inputVersion.split('.');
|
||||
if (isLatestPatchSyntax) {
|
||||
this.resolvedArgument.value = this.inputVersion;
|
||||
}
|
||||
else if (this.isNumericTag(major) && this.isNumericTag(minor)) {
|
||||
this.resolvedArgument.value = `${major}.${minor}`;
|
||||
}
|
||||
else {
|
||||
@ -269,8 +275,10 @@ class DotnetVersionResolver {
|
||||
allowRetries: true,
|
||||
maxRetries: 3
|
||||
});
|
||||
this.resolvedArgument.value = yield this.getLatestVersion(httpClient, [major, minor]);
|
||||
}
|
||||
this.resolvedArgument.value = yield this.getLatestVersion(httpClient, [
|
||||
major,
|
||||
minor
|
||||
]);
|
||||
}
|
||||
this.resolvedArgument.qualityFlag = +major >= 6 ? true : false;
|
||||
}
|
||||
|
@ -50,10 +50,10 @@ export class DotnetVersionResolver {
|
||||
allowRetries: true,
|
||||
maxRetries: 3
|
||||
});
|
||||
this.resolvedArgument.value = await this.getLatestVersion(
|
||||
httpClient,
|
||||
[major, minor]
|
||||
);
|
||||
this.resolvedArgument.value = await this.getLatestVersion(httpClient, [
|
||||
major,
|
||||
minor
|
||||
]);
|
||||
}
|
||||
this.resolvedArgument.qualityFlag = +major >= 6 ? true : false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user