diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index 22e0e06..0b95177 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -1,5 +1,5 @@
name: Main workflow
-on: [push]
+on: [push, pull_request]
jobs:
run:
name: Run
diff --git a/.gitignore b/.gitignore
index fe24304..2b27c52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,3 +92,4 @@ typings/
.dynamodb/
.vscode/*
+node_modules
diff --git a/README.md b/README.md
index aae4c19..5001ee7 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
-This action sets up a dotnet environment for use in actions by:
+This action sets up a [dotnet core cli](https://github.com/dotnet/cli) environment for use in actions by:
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
- registering problem matchers for error output
@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-16.04
strategy:
matrix:
- dotnet: [ '2.2.103', '3.0.100-preview8-013656', '4.5.1' ]
+ dotnet: [ '2.2.103', '3.0.100', '3.1.100-preview1-014459' ]
name: Dotnet ${{ matrix.dotnet }} sample
steps:
- uses: actions/checkout@master
diff --git a/externals/install-dotnet.ps1 b/externals/install-dotnet.ps1
index f17bd85..6dedd84 100644
--- a/externals/install-dotnet.ps1
+++ b/externals/install-dotnet.ps1
@@ -37,15 +37,13 @@
.PARAMETER SharedRuntime
This parameter is obsolete and may be removed in a future version of this script.
The recommended alternative is '-Runtime dotnet'.
-
- Default: false
Installs just the shared runtime bits, not the entire SDK.
- This is equivalent to specifying `-Runtime dotnet`.
.PARAMETER Runtime
Installs just a shared runtime, not the entire SDK.
Possible values:
- dotnet - the Microsoft.NETCore.App shared runtime
- aspnetcore - the Microsoft.AspNetCore.App shared runtime
+ - windowsdesktop - the Microsoft.WindowsDesktop.App shared runtime
.PARAMETER DryRun
If set it will not perform installation but instead display what command line to use to consistently install
currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link
@@ -76,14 +74,18 @@
Skips installing non-versioned files if they already exist, such as dotnet.exe.
.PARAMETER NoCdn
Disable downloading from the Azure CDN, and use the uncached feed directly.
+.PARAMETER JSonFile
+ Determines the SDK version from a user specified global.json file
+ Note: global.json must have a value for 'SDK:Version'
#>
[cmdletbinding()]
param(
[string]$Channel="LTS",
[string]$Version="Latest",
+ [string]$JSonFile,
[string]$InstallDir="",
[string]$Architecture="",
- [ValidateSet("dotnet", "aspnetcore", IgnoreCase = $false)]
+ [ValidateSet("dotnet", "aspnetcore", "windowsdesktop", IgnoreCase = $false)]
[string]$Runtime,
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
[switch]$SharedRuntime,
@@ -257,7 +259,6 @@ function GetHTTPResponse([Uri] $Uri)
})
}
-
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Coherent) {
Say-Invocation $MyInvocation
@@ -268,6 +269,10 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co
elseif ($Runtime -eq "aspnetcore") {
$VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version"
}
+ # Currently, the WindowsDesktop runtime is manufactured with the .Net core runtime
+ elseif ($Runtime -eq "windowsdesktop") {
+ $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version"
+ }
elseif (-not $Runtime) {
if ($Coherent) {
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version"
@@ -299,20 +304,64 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co
return $VersionInfo
}
-
-function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) {
+function Parse-Jsonfile-For-Version([string]$JSonFile) {
Say-Invocation $MyInvocation
- switch ($Version.ToLower()) {
- { $_ -eq "latest" } {
- $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False
- return $LatestVersionInfo.Version
+ If (-Not (Test-Path $JSonFile)) {
+ throw "Unable to find '$JSonFile'"
+ exit 0
+ }
+ try {
+ $JSonContent = Get-Content($JSonFile) -Raw | ConvertFrom-Json | Select-Object -expand "sdk" -ErrorAction SilentlyContinue
+ }
+ catch {
+ throw "Json file unreadable: '$JSonFile'"
+ exit 0
+ }
+ if ($JSonContent) {
+ try {
+ $JSonContent.PSObject.Properties | ForEach-Object {
+ $PropertyName = $_.Name
+ if ($PropertyName -eq "version") {
+ $Version = $_.Value
+ Say-Verbose "Version = $Version"
+ }
+ }
}
- { $_ -eq "coherent" } {
- $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True
- return $LatestVersionInfo.Version
+ catch {
+ throw "Unable to parse the SDK node in '$JSonFile'"
+ exit 0
}
- default { return $Version }
+ }
+ else {
+ throw "Unable to find the SDK node in '$JSonFile'"
+ exit 0
+ }
+ If ($Version -eq $null) {
+ throw "Unable to find the SDK:version node in '$JSonFile'"
+ exit 0
+ }
+ return $Version
+}
+
+function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version, [string]$JSonFile) {
+ Say-Invocation $MyInvocation
+
+ if (-not $JSonFile) {
+ switch ($Version.ToLower()) {
+ { $_ -eq "latest" } {
+ $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False
+ return $LatestVersionInfo.Version
+ }
+ { $_ -eq "coherent" } {
+ $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True
+ return $LatestVersionInfo.Version
+ }
+ default { return $Version }
+ }
+ }
+ else {
+ return Parse-Jsonfile-For-Version $JSonFile
}
}
@@ -325,6 +374,9 @@ function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string
elseif ($Runtime -eq "aspnetcore") {
$PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
}
+ elseif ($Runtime -eq "windowsdesktop") {
+ $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
+ }
elseif (-not $Runtime) {
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip"
}
@@ -374,23 +426,6 @@ function Resolve-Installation-Path([string]$InstallDir) {
return $InstallDir
}
-function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$RelativePathToVersionFile) {
- Say-Invocation $MyInvocation
-
- $VersionFile = Join-Path -Path $InstallRoot -ChildPath $RelativePathToVersionFile
- Say-Verbose "Local version file: $VersionFile"
-
- if (Test-Path $VersionFile) {
- $VersionText = cat $VersionFile
- Say-Verbose "Local version file text: $VersionText"
- return Get-Version-Info-From-Version-Text $VersionText
- }
-
- Say-Verbose "Local version file not found."
-
- return $null
-}
-
function Is-Dotnet-Package-Installed([string]$InstallRoot, [string]$RelativePathToPackage, [string]$SpecificVersion) {
Say-Invocation $MyInvocation
@@ -526,7 +561,7 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
}
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
-$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
+$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -JSonFile $JSonFile
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
@@ -564,6 +599,10 @@ elseif ($Runtime -eq "aspnetcore") {
$assetName = "ASP.NET Core Runtime"
$dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.App"
}
+elseif ($Runtime -eq "windowsdesktop") {
+ $assetName = ".NET Core Windows Desktop Runtime"
+ $dotnetPackageRelativePath = "shared\Microsoft.WindowsDesktop.App"
+}
elseif (-not $Runtime) {
$assetName = ".NET Core SDK"
$dotnetPackageRelativePath = "sdk"
diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh
index 2217d47..b46c343 100644
--- a/externals/install-dotnet.sh
+++ b/externals/install-dotnet.sh
@@ -148,7 +148,7 @@ get_linux_platform_name() {
return 0
elif [ -e /etc/redhat-release ]; then
local redhatRelease=$("
architecture=""
dry_run=false
@@ -868,6 +903,9 @@ do
runtime="$1"
if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then
say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'."
+ if [[ "$runtime" == "windowsdesktop" ]]; then
+ say_err "WindowsDesktop archives are manufactured for Windows platforms only."
+ fi
exit 1
fi
;;
@@ -906,6 +944,10 @@ do
runtime_id="$1"
non_dynamic_parameters+=" $name "\""$1"\"""
;;
+ --jsonfile|-[Jj][Ss]on[Ff]ile)
+ shift
+ json_file="$1"
+ ;;
--skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles)
override_non_versioned_files=false
non_dynamic_parameters+=" $name"
@@ -947,22 +989,25 @@ do
echo " Possible values:"
echo " - dotnet - the Microsoft.NETCore.App shared runtime"
echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime"
- echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
- echo " -SkipNonVersionedFiles"
echo " --dry-run,-DryRun Do not perform installation. Display download link."
echo " --no-path, -NoPath Do not set PATH for the current process."
echo " --verbose,-Verbose Display diagnostics information."
echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user."
echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user."
- echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified."
+ echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
+ echo " -SkipNonVersionedFiles"
+ echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
+ echo " --jsonfile Determines the SDK version from a user specified global.json file."
+ echo " Note: global.json must have a value for 'SDK:Version'"
echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)."
echo " -RuntimeId"
echo " -?,--?,-h,--help,-Help Shows this help message"
echo ""
echo "Obsolete parameters:"
echo " --shared-runtime The recommended alternative is '--runtime dotnet'."
- echo " -SharedRuntime Installs just the shared runtime bits, not the entire SDK."
+ echo " This parameter is obsolete and may be removed in a future version of this script."
+ echo " Installs just the shared runtime bits, not the entire SDK."
echo ""
echo "Install Location:"
echo " Location is chosen in following order:"
diff --git a/lib/installer.js b/lib/installer.js
index 73bded0..527eafd 100644
--- a/lib/installer.js
+++ b/lib/installer.js
@@ -26,7 +26,6 @@ const fs_1 = require("fs");
const os = __importStar(require("os"));
const path = __importStar(require("path"));
const semver = __importStar(require("semver"));
-const util = __importStar(require("util"));
const IS_WINDOWS = process.platform === 'win32';
if (!tempDirectory) {
let baseLocation;
@@ -73,7 +72,7 @@ class DotnetCoreInstaller {
console.log('Using cached tool');
}
// Need to set this so that .NET Core global tools find the right locations.
- core.exportVariable('DOTNET_ROOT', path.join(toolPath, '../..'));
+ core.exportVariable('DOTNET_ROOT', toolPath);
// Prepend the tools path. instructs the agent to prepend for future tasks
core.addPath(toolPath);
});
@@ -175,39 +174,29 @@ class DotnetCoreInstaller {
getDownloadUrls(osSuffixes, version) {
return __awaiter(this, void 0, void 0, function* () {
let downloadUrls = [];
- let releasesJSON = yield this.getReleasesJson();
- core.debug('Releases: ' + releasesJSON);
- let releasesInfo = JSON.parse(yield releasesJSON.readBody());
+ const httpCallbackClient = new httpClient.HttpClient('actions/setup-dotnet', [], {});
+ const releasesJsonUrl = yield this.getReleasesJsonUrl(httpCallbackClient, version.split('.'));
+ let releasesJSON = yield httpCallbackClient.get(releasesJsonUrl);
+ let releasesInfo = JSON.parse(yield releasesJSON.readBody())['releases'];
releasesInfo = releasesInfo.filter((releaseInfo) => {
- return (releaseInfo['version-sdk'] === version ||
- releaseInfo['version-sdk-display'] === version);
+ return (releaseInfo['sdk']['version'] === version ||
+ releaseInfo['sdk']['version-display'] === version);
});
if (releasesInfo.length != 0) {
let release = releasesInfo[0];
- let blobUrl = release['blob-sdk'];
- let dlcUrl = release['dlc--sdk'];
- let fileName = release['sdk-' + osSuffixes[0]]
- ? release['sdk-' + osSuffixes[0]]
- : release['sdk-' + osSuffixes[1]];
- if (!!fileName) {
- fileName = fileName.trim();
- // For some latest version, the filename itself can be full download url.
- // Do a very basic check for url(instead of regex) as the url is only for downloading and
- // is coming from .net core releases json and not some ransom user input
- if (fileName.toLowerCase().startsWith('https://')) {
- downloadUrls.push(fileName);
- }
- else {
- if (!!blobUrl) {
- downloadUrls.push(util.format('%s%s', blobUrl.trim(), fileName));
- }
- if (!!dlcUrl) {
- downloadUrls.push(util.format('%s%s', dlcUrl.trim(), fileName));
- }
+ let files = release['sdk']['files'];
+ files = files.filter((file) => {
+ if (file['rid'] == osSuffixes[0] || file['rid'] == osSuffixes[1]) {
+ return (file['url'].endsWith('.zip') || file['url'].endsWith('.tar.gz'));
}
+ });
+ if (files.length > 0) {
+ files.forEach((file) => {
+ downloadUrls.push(file['url']);
+ });
}
else {
- throw `The specified version's download links are not correctly formed in the supported versions document => ${DotNetCoreReleasesUrl}`;
+ throw `The specified version's download links are not correctly formed in the supported versions document => ${releasesJsonUrl}`;
}
}
else {
@@ -221,9 +210,23 @@ class DotnetCoreInstaller {
return downloadUrls;
});
}
- getReleasesJson() {
- var httpCallbackClient = new httpClient.HttpClient('setup-dotnet', [], {});
- return httpCallbackClient.get(DotNetCoreReleasesUrl);
+ getReleasesJsonUrl(httpCallbackClient, versionParts) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const releasesIndex = yield httpCallbackClient.get(DotNetCoreIndexUrl);
+ let releasesInfo = JSON.parse(yield releasesIndex.readBody())['releases-index'];
+ releasesInfo = releasesInfo.filter((info) => {
+ // channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
+ const sdkParts = info['channel-version'].split('.');
+ if (versionParts.length >= 2 && versionParts[1] != 'x') {
+ return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
+ }
+ return versionParts[0] == sdkParts[0];
+ });
+ if (releasesInfo.length === 0) {
+ throw `Could not find info for version ${versionParts.join('.')} at ${DotNetCoreIndexUrl}`;
+ }
+ return releasesInfo[0]['releases.json'];
+ });
}
getFallbackDownloadUrls(version) {
return __awaiter(this, void 0, void 0, function* () {
@@ -306,4 +309,4 @@ class DotnetCoreInstaller {
}
}
exports.DotnetCoreInstaller = DotnetCoreInstaller;
-const DotNetCoreReleasesUrl = 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json';
+const DotNetCoreIndexUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
diff --git a/lib/setup-dotnet.js b/lib/setup-dotnet.js
index 7c42583..258a188 100644
--- a/lib/setup-dotnet.js
+++ b/lib/setup-dotnet.js
@@ -26,6 +26,7 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
+ console.log(`::warning::Use the v1 tag to get the last version, master may contain breaking changes and will not contain any required packages in the future. i.e. actions/setup-dotnet@v1`);
let version = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');
diff --git a/src/installer.ts b/src/installer.ts
index eff1cd3..a592286 100644
--- a/src/installer.ts
+++ b/src/installer.ts
@@ -59,7 +59,7 @@ export class DotnetCoreInstaller {
}
// Need to set this so that .NET Core global tools find the right locations.
- core.exportVariable('DOTNET_ROOT', path.join(toolPath, '../..'));
+ core.exportVariable('DOTNET_ROOT', toolPath);
// Prepend the tools path. instructs the agent to prepend for future tasks
core.addPath(toolPath);
@@ -187,43 +187,46 @@ export class DotnetCoreInstaller {
version: string
): Promise {
let downloadUrls: string[] = [];
- let releasesJSON = await this.getReleasesJson();
- core.debug('Releases: ' + releasesJSON);
- let releasesInfo = JSON.parse(await releasesJSON.readBody());
+ const httpCallbackClient = new httpClient.HttpClient(
+ 'actions/setup-dotnet',
+ [],
+ {}
+ );
+ const releasesJsonUrl: string = await this.getReleasesJsonUrl(
+ httpCallbackClient,
+ version.split('.')
+ );
+
+ let releasesJSON = await httpCallbackClient.get(releasesJsonUrl);
+
+ let releasesInfo: any[] = JSON.parse(await releasesJSON.readBody())[
+ 'releases'
+ ];
releasesInfo = releasesInfo.filter((releaseInfo: any) => {
return (
- releaseInfo['version-sdk'] === version ||
- releaseInfo['version-sdk-display'] === version
+ releaseInfo['sdk']['version'] === version ||
+ releaseInfo['sdk']['version-display'] === version
);
});
if (releasesInfo.length != 0) {
let release = releasesInfo[0];
- let blobUrl: string = release['blob-sdk'];
- let dlcUrl: string = release['dlc--sdk'];
- let fileName: string = release['sdk-' + osSuffixes[0]]
- ? release['sdk-' + osSuffixes[0]]
- : release['sdk-' + osSuffixes[1]];
-
- if (!!fileName) {
- fileName = fileName.trim();
- // For some latest version, the filename itself can be full download url.
- // Do a very basic check for url(instead of regex) as the url is only for downloading and
- // is coming from .net core releases json and not some ransom user input
- if (fileName.toLowerCase().startsWith('https://')) {
- downloadUrls.push(fileName);
- } else {
- if (!!blobUrl) {
- downloadUrls.push(util.format('%s%s', blobUrl.trim(), fileName));
- }
-
- if (!!dlcUrl) {
- downloadUrls.push(util.format('%s%s', dlcUrl.trim(), fileName));
- }
+ let files: any[] = release['sdk']['files'];
+ files = files.filter((file: any) => {
+ if (file['rid'] == osSuffixes[0] || file['rid'] == osSuffixes[1]) {
+ return (
+ file['url'].endsWith('.zip') || file['url'].endsWith('.tar.gz')
+ );
}
+ });
+
+ if (files.length > 0) {
+ files.forEach((file: any) => {
+ downloadUrls.push(file['url']);
+ });
} else {
- throw `The specified version's download links are not correctly formed in the supported versions document => ${DotNetCoreReleasesUrl}`;
+ throw `The specified version's download links are not correctly formed in the supported versions document => ${releasesJsonUrl}`;
}
} else {
console.log(
@@ -241,9 +244,30 @@ export class DotnetCoreInstaller {
return downloadUrls;
}
- private getReleasesJson(): Promise {
- var httpCallbackClient = new httpClient.HttpClient('setup-dotnet', [], {});
- return httpCallbackClient.get(DotNetCoreReleasesUrl);
+ private async getReleasesJsonUrl(
+ httpCallbackClient: httpClient.HttpClient,
+ versionParts: string[]
+ ): Promise {
+ const releasesIndex: HttpClientResponse = await httpCallbackClient.get(
+ DotNetCoreIndexUrl
+ );
+ let releasesInfo: any[] = JSON.parse(await releasesIndex.readBody())[
+ 'releases-index'
+ ];
+ releasesInfo = releasesInfo.filter((info: any) => {
+ // channel-version is the first 2 elements of the version (e.g. 2.1), filter out versions that don't match 2.1.x.
+ const sdkParts: string[] = info['channel-version'].split('.');
+ if (versionParts.length >= 2 && versionParts[1] != 'x') {
+ return versionParts[0] == sdkParts[0] && versionParts[1] == sdkParts[1];
+ }
+ return versionParts[0] == sdkParts[0];
+ });
+ if (releasesInfo.length === 0) {
+ throw `Could not find info for version ${versionParts.join(
+ '.'
+ )} at ${DotNetCoreIndexUrl}`;
+ }
+ return releasesInfo[0]['releases.json'];
}
private async getFallbackDownloadUrls(version: string): Promise {
@@ -350,5 +374,5 @@ export class DotnetCoreInstaller {
private arch: string;
}
-const DotNetCoreReleasesUrl: string =
- 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json';
+const DotNetCoreIndexUrl: string =
+ 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json';
diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts
index d1cac40..e6e9723 100644
--- a/src/setup-dotnet.ts
+++ b/src/setup-dotnet.ts
@@ -9,6 +9,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc...
//
+ console.log(
+ `::warning::Use the v1 tag to get the last version, master may contain breaking changes and will not contain any required packages in the future. i.e. actions/setup-dotnet@v1`
+ );
+
let version = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');