From ee0f679d622b92ffb5b197c16d67da482e8067df Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Thu, 11 May 2023 04:12:53 +0200 Subject: [PATCH 01/13] Update installers --- externals/install-dotnet.ps1 | 459 ++++++++++++++++++----------------- externals/install-dotnet.sh | 14 +- 2 files changed, 245 insertions(+), 228 deletions(-) diff --git a/externals/install-dotnet.ps1 b/externals/install-dotnet.ps1 index b0b131acd..c9a30cb3c 100644 --- a/externals/install-dotnet.ps1 +++ b/externals/install-dotnet.ps1 @@ -9,6 +9,12 @@ .DESCRIPTION Installs dotnet cli. If dotnet installation already exists in the given directory it will update it only if the requested version differs from the one already installed. + + Note that the intended use of this script is for Continuous Integration (CI) scenarios, where: + - The SDK needs to be installed without user interaction and without admin rights. + - The SDK installation doesn't need to persist across multiple CI runs. + To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer. + .PARAMETER Channel Default: LTS Download from the Channel specified. Possible values: @@ -164,6 +170,12 @@ function Say-Verbose($str) { } } +function Measure-Action($name, $block) { + $time = Measure-Command $block + $totalSeconds = $time.TotalSeconds + Say-Verbose "⏱ Action '$name' took $totalSeconds seconds" +} + function Say-Invocation($Invocation) { $command = $Invocation.MyCommand; $args = (($Invocation.BoundParameters.Keys | foreach { "-$_ `"$($Invocation.BoundParameters[$_])`"" }) -join " ") @@ -1104,10 +1116,10 @@ function Prepare-Install-Directory { } } -Say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" -Say "- The SDK needs to be installed without user interaction and without admin rights." -Say "- The SDK installation doesn't need to persist across multiple CI runs." -Say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n" +Say-Verbose "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" +Say-Verbose "- The SDK needs to be installed without user interaction and without admin rights." +Say-Verbose "- The SDK installation doesn't need to persist across multiple CI runs." +Say-Verbose "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.`r`n" if ($SharedRuntime -and (-not $Runtime)) { $Runtime = "dotnet" @@ -1115,14 +1127,16 @@ if ($SharedRuntime -and (-not $Runtime)) { $OverrideNonVersionedFiles = !$SkipNonVersionedFiles -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$NormalizedQuality = Get-NormalizedQuality $Quality -Say-Verbose "Normalized quality: '$NormalizedQuality'" -$NormalizedChannel = Get-NormalizedChannel $Channel -Say-Verbose "Normalized channel: '$NormalizedChannel'" -$NormalizedProduct = Get-NormalizedProduct $Runtime -Say-Verbose "Normalized product: '$NormalizedProduct'" -$FeedCredential = ValidateFeedCredential $FeedCredential +Measure-Action "Product discovery" { + $script:CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture + $script:NormalizedQuality = Get-NormalizedQuality $Quality + Say-Verbose "Normalized quality: '$NormalizedQuality'" + $script:NormalizedChannel = Get-NormalizedChannel $Channel + Say-Verbose "Normalized channel: '$NormalizedChannel'" + $script:NormalizedProduct = Get-NormalizedProduct $Runtime + Say-Verbose "Normalized product: '$NormalizedProduct'" + $script:FeedCredential = ValidateFeedCredential $FeedCredential +} $InstallRoot = Resolve-Installation-Path $InstallDir Say-Verbose "InstallRoot: $InstallRoot" @@ -1200,7 +1214,7 @@ if ($DryRun) { return } -Prepare-Install-Directory +Measure-Action "Installation directory preparation" { Prepare-Install-Directory } $ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) Say-Verbose "Zip path: $ZipPath" @@ -1214,7 +1228,7 @@ foreach ($link in $DownloadLinks) Say-Verbose "Downloading `"$($link.type)`" link $($link.downloadLink)" try { - DownloadFile -Source $link.downloadLink -OutPath $ZipPath + Measure-Action "Package download" { DownloadFile -Source $link.downloadLink -OutPath $ZipPath } Say-Verbose "Download succeeded." $DownloadSucceeded = $true $DownloadedLink = $link @@ -1251,7 +1265,7 @@ if (-not $DownloadSucceeded) { } Say "Extracting the archive." -Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot +Measure-Action "Package extraction" { Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot } # Check if the SDK version is installed; if not, fail the installation. $isAssetInstalled = $false @@ -1277,225 +1291,224 @@ if (!$isAssetInstalled) { SafeRemoveFile -Path $ZipPath -Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot +Measure-Action "Setting up shell environment" { Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot } Say "Note that the script does not resolve dependencies during installation." Say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies" Say "Installed version is $($DownloadedLink.effectiveVersion)" Say "Installation finished" - # SIG # Begin signature block -# MIInzgYJKoZIhvcNAQcCoIInvzCCJ7sCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB7pzZ0nuEMd30h -# n1EcAYUQN+1clltqaLf9611TDrw/laCCDYUwggYDMIID66ADAgECAhMzAAACzfNk -# v/jUTF1RAAAAAALNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBhfTi3SRn7+vyy +# uCXKPjhiawegWZ493EcaOEycbgkZcKCCDXYwggX0MIID3KADAgECAhMzAAACy7d1 +# OfsCcUI2AAAAAALLMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3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QP7Ac1saIe1+gUFNcsYOLaMm/xl8E6kefWwZnm5Rhm606g1AC/ +# N5Wo08aAs0ymTPH91dEbmOURXLbA3vCyG7kbfgnhCs/j7oQHWaFDzEYuXDIA4ICT +# dxPUTltbq3OWdp0PAS8JSEKPQFaOoQEnPa4adrXWxMvOmel8IGqJiQ+BPOaLQG64 +# Qu2tMkH/5szb1fsEnCe8SJmy5ESF+kmpnLBtJ17Y9o+9nJHF5ddFmvzy+LUaIqDN +# cOfH # SIG # End signature block diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index ecb2b6cf1..bdaa67efa 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -1617,6 +1617,10 @@ do echo " $script_name -h|-?|--help" echo "" echo "$script_name is a simple command line interface for obtaining dotnet cli." + echo " Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" + echo " - The SDK needs to be installed without user interaction and without admin rights." + echo " - The SDK installation doesn't need to persist across multiple CI runs." + echo " To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer." echo "" echo "Options:" echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." @@ -1694,10 +1698,10 @@ do shift done -say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" -say "- The SDK needs to be installed without user interaction and without admin rights." -say "- The SDK installation doesn't need to persist across multiple CI runs." -say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" +say_verbose "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" +say_verbose "- The SDK needs to be installed without user interaction and without admin rights." +say_verbose "- The SDK installation doesn't need to persist across multiple CI runs." +say_verbose "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" if [ "$internal" = true ] && [ -z "$(echo $feed_credential)" ]; then message="Provide credentials via --feed-credential parameter." @@ -1731,4 +1735,4 @@ fi say "Note that the script does not resolve dependencies during installation." say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section." -say "Installation finished successfully." +say "Installation finished successfully." \ No newline at end of file From 82c778f22844f2adfdc50c5d55ba014808120534 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Thu, 11 May 2023 05:05:58 +0200 Subject: [PATCH 02/13] Keep different versions in different folders --- src/installer.ts | 83 +++++++++++++++++++++++---------------------- src/setup-dotnet.ts | 2 +- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index ef9e99304..2ac5c09f4 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -6,7 +6,6 @@ import * as hc from '@actions/http-client'; import {chmodSync} from 'fs'; import {readdir} from 'fs/promises'; import path from 'path'; -import os from 'os'; import semver from 'semver'; import {IS_LINUX, IS_WINDOWS} from './utils'; import {QualityOptions} from './setup-dotnet'; @@ -110,56 +109,59 @@ export class DotnetVersionResolver { 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; } -export class DotnetCoreInstaller { - private version: string; - private quality: QualityOptions; - - static { - const installationDirectoryWindows = path.join( +class InstallDir { + static base = { + windows: path.join( process.env['PROGRAMFILES'] + '', 'dotnet' - ); - const installationDirectoryLinux = '/usr/share/dotnet'; - const installationDirectoryMac = path.join( + ), + mac: path.join( process.env['HOME'] + '', '.dotnet' - ); - const dotnetInstallDir: string | undefined = - process.env['DOTNET_INSTALL_DIR']; - if (dotnetInstallDir) { - process.env['DOTNET_INSTALL_DIR'] = - this.convertInstallPathToAbsolute(dotnetInstallDir); - } else { - if (IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = installationDirectoryWindows; - } else { - process.env['DOTNET_INSTALL_DIR'] = IS_LINUX - ? installationDirectoryLinux - : installationDirectoryMac; - } + ), + linux: '/usr/share/dotnet' + } + + constructor(version = 'unspecified-version') { + if (IS_WINDOWS) { + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${version}`; + return; } + + if (IS_LINUX) { + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${version}`; + return; + } + + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}` + return; } + get path() { + if (process.env['DOTNET_INSTALL_DIR']) { + return process.env['DOTNET_INSTALL_DIR'] + } + + if (IS_WINDOWS) return InstallDir.base.windows + if (IS_LINUX) return InstallDir.base.linux + return InstallDir.base.mac + } +} + +export class DotnetCoreInstaller { + private version: string; + private quality: QualityOptions; + private installDir: InstallDir; + constructor(version: string, quality: QualityOptions) { this.version = version; this.quality = quality; + this.installDir = new InstallDir(version); } - private static convertInstallPathToAbsolute(installDir: string): string { - let transformedPath; - if (path.isAbsolute(installDir)) { - transformedPath = installDir; - } else { - transformedPath = installDir.startsWith('~') - ? path.join(os.homedir(), installDir.slice(1)) - : (transformedPath = path.join(process.cwd(), installDir)); - } - return path.normalize(transformedPath); - } - - static addToPath() { - core.addPath(process.env['DOTNET_INSTALL_DIR']!); - core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']); + public addToPath() { + core.addPath(this.installDir.path); + core.exportVariable('DOTNET_ROOT', this.installDir.path); } private setQuality( @@ -251,9 +253,8 @@ export class DotnetCoreInstaller { } private async outputDotnetVersion(version): Promise { - const installationPath = process.env['DOTNET_INSTALL_DIR']!; const versionsOnRunner: string[] = await readdir( - path.join(installationPath.replace(/'/g, ''), 'sdk') + path.join(this.installDir.path.replace(/'/g, ''), 'sdk') ); const installedVersion = semver.maxSatisfying(versionsOnRunner, version, { diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index 31c80a2dd..6820ef50c 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -66,10 +66,10 @@ export async function run() { const uniqueVersions = new Set(versions); for (const version of uniqueVersions) { dotnetInstaller = new DotnetCoreInstaller(version, quality); + dotnetInstaller.addToPath(); const installedVersion = await dotnetInstaller.installDotnet(); installedDotnetVersions.push(installedVersion); } - DotnetCoreInstaller.addToPath(); } const sourceUrl: string = core.getInput('source-url'); From 265b95338f9920d0e18bc135d0fa35b79d451355 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Thu, 11 May 2023 05:07:38 +0200 Subject: [PATCH 03/13] Keep different versions in different folders --- dist/index.js | 76 ++++++++++++++++++++++-------------------------- src/installer.ts | 26 +++++++---------- 2 files changed, 46 insertions(+), 56 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8e20d7f57..f7632e0d3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -229,7 +229,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; -var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DotnetCoreInstaller = exports.DotnetVersionResolver = void 0; // Load tempDirectory before it gets wiped by tool-cache @@ -240,7 +239,6 @@ const hc = __importStar(__nccwpck_require__(6255)); const fs_1 = __nccwpck_require__(7147); const promises_1 = __nccwpck_require__(3292); const path_1 = __importDefault(__nccwpck_require__(1017)); -const os_1 = __importDefault(__nccwpck_require__(2037)); const semver_1 = __importDefault(__nccwpck_require__(5911)); const utils_1 = __nccwpck_require__(918); class DotnetVersionResolver { @@ -314,26 +312,44 @@ class DotnetVersionResolver { } exports.DotnetVersionResolver = DotnetVersionResolver; DotnetVersionResolver.DotNetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; +class InstallDir { + constructor(version = 'unspecified-version') { + if (utils_1.IS_WINDOWS) { + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${version}`; + return; + } + if (utils_1.IS_LINUX) { + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${version}`; + return; + } + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}`; + return; + } + get path() { + if (process.env['DOTNET_INSTALL_DIR']) { + return process.env['DOTNET_INSTALL_DIR']; + } + if (utils_1.IS_WINDOWS) + return InstallDir.base.windows; + if (utils_1.IS_LINUX) + return InstallDir.base.linux; + return InstallDir.base.mac; + } +} +InstallDir.base = { + windows: path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet'), + mac: path_1.default.join(process.env['HOME'] + '', '.dotnet'), + linux: '/usr/share/dotnet' +}; class DotnetCoreInstaller { constructor(version, quality) { this.version = version; this.quality = quality; + this.installDir = new InstallDir(version); } - static convertInstallPathToAbsolute(installDir) { - let transformedPath; - if (path_1.default.isAbsolute(installDir)) { - transformedPath = installDir; - } - else { - transformedPath = installDir.startsWith('~') - ? path_1.default.join(os_1.default.homedir(), installDir.slice(1)) - : (transformedPath = path_1.default.join(process.cwd(), installDir)); - } - return path_1.default.normalize(transformedPath); - } - static addToPath() { - core.addPath(process.env['DOTNET_INSTALL_DIR']); - core.exportVariable('DOTNET_ROOT', process.env['DOTNET_INSTALL_DIR']); + addToPath() { + core.addPath(this.installDir.path); + core.exportVariable('DOTNET_ROOT', this.installDir.path); } setQuality(dotnetVersion, scriptArguments) { const option = utils_1.IS_WINDOWS ? '-Quality' : '--quality'; @@ -407,8 +423,7 @@ class DotnetCoreInstaller { } outputDotnetVersion(version) { return __awaiter(this, void 0, void 0, function* () { - const installationPath = process.env['DOTNET_INSTALL_DIR']; - const versionsOnRunner = yield (0, promises_1.readdir)(path_1.default.join(installationPath.replace(/'/g, ''), 'sdk')); + const versionsOnRunner = yield (0, promises_1.readdir)(path_1.default.join(this.installDir.path.replace(/'/g, ''), 'sdk')); const installedVersion = semver_1.default.maxSatisfying(versionsOnRunner, version, { includePrerelease: true }); @@ -417,27 +432,6 @@ class DotnetCoreInstaller { } } exports.DotnetCoreInstaller = DotnetCoreInstaller; -_a = DotnetCoreInstaller; -(() => { - const installationDirectoryWindows = path_1.default.join(process.env['PROGRAMFILES'] + '', 'dotnet'); - const installationDirectoryLinux = '/usr/share/dotnet'; - const installationDirectoryMac = path_1.default.join(process.env['HOME'] + '', '.dotnet'); - const dotnetInstallDir = process.env['DOTNET_INSTALL_DIR']; - if (dotnetInstallDir) { - process.env['DOTNET_INSTALL_DIR'] = - _a.convertInstallPathToAbsolute(dotnetInstallDir); - } - else { - if (utils_1.IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = installationDirectoryWindows; - } - else { - process.env['DOTNET_INSTALL_DIR'] = utils_1.IS_LINUX - ? installationDirectoryLinux - : installationDirectoryMac; - } - } -})(); /***/ }), @@ -539,10 +533,10 @@ function run() { const uniqueVersions = new Set(versions); for (const version of uniqueVersions) { dotnetInstaller = new installer_1.DotnetCoreInstaller(version, quality); + dotnetInstaller.addToPath(); const installedVersion = yield dotnetInstaller.installDotnet(); installedDotnetVersions.push(installedVersion); } - installer_1.DotnetCoreInstaller.addToPath(); } const sourceUrl = core.getInput('source-url'); const configFile = core.getInput('config-file'); diff --git a/src/installer.ts b/src/installer.ts index 2ac5c09f4..f6205535c 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -111,20 +111,16 @@ export class DotnetVersionResolver { class InstallDir { static base = { - windows: path.join( - process.env['PROGRAMFILES'] + '', - 'dotnet' - ), - mac: path.join( - process.env['HOME'] + '', - '.dotnet' - ), + windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet'), + mac: path.join(process.env['HOME'] + '', '.dotnet'), linux: '/usr/share/dotnet' - } + }; constructor(version = 'unspecified-version') { if (IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${version}`; + process.env[ + 'DOTNET_INSTALL_DIR' + ] = `${InstallDir.base.windows}\\${version}`; return; } @@ -133,18 +129,18 @@ class InstallDir { return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}` + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}`; return; } get path() { if (process.env['DOTNET_INSTALL_DIR']) { - return process.env['DOTNET_INSTALL_DIR'] + return process.env['DOTNET_INSTALL_DIR']; } - if (IS_WINDOWS) return InstallDir.base.windows - if (IS_LINUX) return InstallDir.base.linux - return InstallDir.base.mac + if (IS_WINDOWS) return InstallDir.base.windows; + if (IS_LINUX) return InstallDir.base.linux; + return InstallDir.base.mac; } } From 5715ea28c39b75110b330dc5ffd5e67dc33d989a Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:10:26 +0200 Subject: [PATCH 04/13] Add skipping of non-versioned files and use major tag for specifying directories --- src/installer.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index f6205535c..da4d2d33a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -116,20 +116,22 @@ class InstallDir { linux: '/usr/share/dotnet' }; - constructor(version = 'unspecified-version') { + constructor(version: string) { + const majorVersion = version.split('.').at(0); + if (IS_WINDOWS) { process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.windows}\\${version}`; + ] = `${InstallDir.base.windows}\\${majorVersion}`; return; } if (IS_LINUX) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${version}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${majorVersion}`; return; } @@ -195,7 +197,7 @@ export class DotnetCoreInstaller { const dotnetVersion = await versionResolver.createDotNetVersion(); if (IS_WINDOWS) { - scriptArguments = ['&', `'${escapedScript}'`]; + scriptArguments = ['&', '-SkipNonVersionedFiles', `'${escapedScript}'`]; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); @@ -219,7 +221,7 @@ export class DotnetCoreInstaller { } else { chmodSync(escapedScript, '777'); scriptPath = await io.which(escapedScript, true); - scriptArguments = []; + scriptArguments = ['--skip-non-versioned-files']; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); From 73c89fc348e0c607e6bdca93356773325e4bb044 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:11:25 +0200 Subject: [PATCH 05/13] Add skipping of non-versioned files and use major tag for specifying directories --- src/installer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index da4d2d33a..45048f3cd 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -127,11 +127,15 @@ class InstallDir { } if (IS_LINUX) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${majorVersion}`; + process.env[ + 'DOTNET_INSTALL_DIR' + ] = `${InstallDir.base.linux}/${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${majorVersion}`; + process.env[ + 'DOTNET_INSTALL_DIR' + ] = `${InstallDir.base.mac}/${majorVersion}`; return; } From 7a099da97cf0b10007ad54a0250bbdc76faca1ff Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:15:10 +0200 Subject: [PATCH 06/13] Build --- dist/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index f7632e0d3..b07d96393 100644 --- a/dist/index.js +++ b/dist/index.js @@ -313,16 +313,17 @@ class DotnetVersionResolver { exports.DotnetVersionResolver = DotnetVersionResolver; DotnetVersionResolver.DotNetCoreIndexUrl = 'https://dotnetcli.azureedge.net/dotnet/release-metadata/releases-index.json'; class InstallDir { - constructor(version = 'unspecified-version') { + constructor(version) { + const majorVersion = version.split('.').at(0); if (utils_1.IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${version}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${majorVersion}`; return; } if (utils_1.IS_LINUX) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${version}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${version}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${majorVersion}`; return; } get path() { @@ -380,7 +381,7 @@ class DotnetCoreInstaller { const versionResolver = new DotnetVersionResolver(this.version); const dotnetVersion = yield versionResolver.createDotNetVersion(); if (utils_1.IS_WINDOWS) { - scriptArguments = ['&', `'${escapedScript}'`]; + scriptArguments = ['&', '-SkipNonVersionedFiles', `'${escapedScript}'`]; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); } @@ -401,7 +402,7 @@ class DotnetCoreInstaller { else { (0, fs_1.chmodSync)(escapedScript, '777'); scriptPath = yield io.which(escapedScript, true); - scriptArguments = []; + scriptArguments = ['--skip-non-versioned-files']; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); } From d2b9a576aee4eb4eb163adbb4f562cd47112b745 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:23:31 +0200 Subject: [PATCH 07/13] Add flag to the correct position --- dist/index.js | 2 +- src/installer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b07d96393..d2317bffb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -381,7 +381,7 @@ class DotnetCoreInstaller { const versionResolver = new DotnetVersionResolver(this.version); const dotnetVersion = yield versionResolver.createDotNetVersion(); if (utils_1.IS_WINDOWS) { - scriptArguments = ['&', '-SkipNonVersionedFiles', `'${escapedScript}'`]; + scriptArguments = ['&', `'${escapedScript}'`, '-SkipNonVersionedFiles']; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); } diff --git a/src/installer.ts b/src/installer.ts index 45048f3cd..df48c1ddf 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -201,7 +201,7 @@ export class DotnetCoreInstaller { const dotnetVersion = await versionResolver.createDotNetVersion(); if (IS_WINDOWS) { - scriptArguments = ['&', '-SkipNonVersionedFiles', `'${escapedScript}'`]; + scriptArguments = ['&', `'${escapedScript}'`, '-SkipNonVersionedFiles']; if (dotnetVersion.type) { scriptArguments.push(dotnetVersion.type, dotnetVersion.value); From 16208039b68ec1e0c25846e9bda50918d51bf717 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:39:52 +0200 Subject: [PATCH 08/13] Use postfix instead of subdirectory --- dist/index.js | 7 +++---- src/installer.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index d2317bffb..afa596f87 100644 --- a/dist/index.js +++ b/dist/index.js @@ -316,15 +316,14 @@ class InstallDir { constructor(version) { const majorVersion = version.split('.').at(0); if (utils_1.IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}${majorVersion}`; return; } if (utils_1.IS_LINUX) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${majorVersion}`; - return; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}${majorVersion}`; } get path() { if (process.env['DOTNET_INSTALL_DIR']) { diff --git a/src/installer.ts b/src/installer.ts index df48c1ddf..ee9166c6e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -122,21 +122,20 @@ class InstallDir { if (IS_WINDOWS) { process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.windows}\\${majorVersion}`; + ] = `${InstallDir.base.windows}${majorVersion}`; return; } if (IS_LINUX) { process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.linux}/${majorVersion}`; + ] = `${InstallDir.base.linux}${majorVersion}`; return; } process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.mac}/${majorVersion}`; - return; + ] = `${InstallDir.base.mac}${majorVersion}`; } get path() { From a6e15ef0fd7d9441bdaeb308d68a554ffd793122 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 03:40:54 +0200 Subject: [PATCH 09/13] Format --- src/installer.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index ee9166c6e..21c306c0c 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -133,9 +133,7 @@ class InstallDir { return; } - process.env[ - 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.mac}${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}${majorVersion}`; } get path() { From 22431176b4f0874b2209deaa3a50d8706c6fa881 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 06:28:21 +0200 Subject: [PATCH 10/13] Revert "Use postfix instead of subdirectory" This reverts commit 16208039b68ec1e0c25846e9bda50918d51bf717. --- dist/index.js | 6 +++--- src/installer.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index afa596f87..06ad1531e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -316,14 +316,14 @@ class InstallDir { constructor(version) { const majorVersion = version.split('.').at(0); if (utils_1.IS_WINDOWS) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.windows}\\${majorVersion}`; return; } if (utils_1.IS_LINUX) { - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.linux}/${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}${majorVersion}`; + process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}/${majorVersion}`; } get path() { if (process.env['DOTNET_INSTALL_DIR']) { diff --git a/src/installer.ts b/src/installer.ts index 21c306c0c..3e2aecc38 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -122,18 +122,20 @@ class InstallDir { if (IS_WINDOWS) { process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.windows}${majorVersion}`; + ] = `${InstallDir.base.windows}\\${majorVersion}`; return; } if (IS_LINUX) { process.env[ 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.linux}${majorVersion}`; + ] = `${InstallDir.base.linux}/${majorVersion}`; return; } - process.env['DOTNET_INSTALL_DIR'] = `${InstallDir.base.mac}${majorVersion}`; + process.env[ + 'DOTNET_INSTALL_DIR' + ] = `${InstallDir.base.mac}/${majorVersion}`; } get path() { From 0626294cc6c382b7899ae86991bdb334c53b5d38 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 07:00:04 +0200 Subject: [PATCH 11/13] Update tests --- __tests__/installer.test.ts | 36 ++++++++++++++++++---------------- __tests__/setup-dotnet.test.ts | 8 +++++--- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 1a7e0248e..03af25b0f 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -21,6 +21,8 @@ if (IS_WINDOWS) { } const tempDir = path.join(__dirname, 'runner', 'temp'); +const getVersionedToolDir = (version: string) => path.join(toolDir + '', version); + process.env['RUNNER_TOOL_CACHE'] = toolDir; process.env['RUNNER_TEMP'] = tempDir; @@ -59,52 +61,52 @@ describe('DotnetCoreInstaller tests', () => { for (const version of versions) { await getDotnet(version); } - expect(fs.existsSync(path.join(toolDir, 'sdk', '2.2.207'))).toBe(true); - expect(fs.existsSync(path.join(toolDir, 'sdk', '3.1.120'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('2'), 'sdk', '2.2.207'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.120'))).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); } else { - expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); } expect(process.env.DOTNET_ROOT).toBeDefined(); expect(process.env.PATH).toBeDefined(); - expect(process.env.DOTNET_ROOT).toBe(toolDir); - expect(process.env.PATH?.startsWith(toolDir)).toBe(true); + expect(process.env.DOTNET_ROOT).toBe(getVersionedToolDir('3')); + expect(process.env.PATH?.startsWith(getVersionedToolDir('3'))).toBe(true); }, 600000); it('Acquires version of dotnet if no matching version is installed', async () => { await getDotnet('3.1.201'); - expect(fs.existsSync(path.join(toolDir, 'sdk', '3.1.201'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201'))).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); } else { - expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); } expect(process.env.DOTNET_ROOT).toBeDefined(); expect(process.env.PATH).toBeDefined(); - expect(process.env.DOTNET_ROOT).toBe(toolDir); - expect(process.env.PATH?.startsWith(toolDir)).toBe(true); + expect(process.env.DOTNET_ROOT).toBe(getVersionedToolDir('3')); + expect(process.env.PATH?.startsWith(getVersionedToolDir('3'))).toBe(true); }, 600000); //This needs some time to download on "slower" internet connections it('Acquires generic version of dotnet if no matching version is installed', async () => { await getDotnet('3.1'); const directory = fs - .readdirSync(path.join(toolDir, 'sdk')) + .readdirSync(path.join(getVersionedToolDir('3'), 'sdk')) .filter(fn => fn.startsWith('3.1.')); expect(directory.length > 0).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); } else { - expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); } expect(process.env.DOTNET_ROOT).toBeDefined(); expect(process.env.PATH).toBeDefined(); - expect(process.env.DOTNET_ROOT).toBe(toolDir); - expect(process.env.PATH?.startsWith(toolDir)).toBe(true); + expect(process.env.DOTNET_ROOT).toBe(getVersionedToolDir('3')); + expect(process.env.PATH?.startsWith(getVersionedToolDir('3'))).toBe(true); }, 600000); //This needs some time to download on "slower" internet connections it('Returns string with installed SDK version', async () => { @@ -293,6 +295,6 @@ async function getDotnet(version: string, quality = ''): Promise { quality as QualityOptions ); const installedVersion = await dotnetInstaller.installDotnet(); - installer.DotnetCoreInstaller.addToPath(); + dotnetInstaller.addToPath(); return installedVersion; } diff --git a/__tests__/setup-dotnet.test.ts b/__tests__/setup-dotnet.test.ts index 76c1da467..4b965a46f 100644 --- a/__tests__/setup-dotnet.test.ts +++ b/__tests__/setup-dotnet.test.ts @@ -18,6 +18,8 @@ if (IS_WINDOWS) { toolDir = path.join(process.env['HOME'] + '', '.dotnet'); } +const getVersionedToolDir = (version: string) => path.join(toolDir + '', version); + function createGlobalJsonPath(dotnetVersion: string) { const globalJsonPath = path.join(process.cwd(), 'global.json'); const jsonContents = `{${os.EOL}"sdk": {${os.EOL}"version": "${dotnetVersion}"${os.EOL}}${os.EOL}}`; @@ -64,11 +66,11 @@ describe('setup-dotnet tests', () => { createGlobalJsonPath('3.1.201'); await setup.run(); - expect(fs.existsSync(path.join(toolDir, 'sdk', '3.1.201'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201'))).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); } else { - expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); } }, 400000); From 2c0a5fbfe81a8563ccf1335926c730c9f16c4b9a Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 07:00:47 +0200 Subject: [PATCH 12/13] Format --- __tests__/installer.test.ts | 39 +++++++++++++++++++++++++--------- __tests__/setup-dotnet.test.ts | 15 +++++++++---- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 03af25b0f..0ccdc68ed 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -21,7 +21,8 @@ if (IS_WINDOWS) { } const tempDir = path.join(__dirname, 'runner', 'temp'); -const getVersionedToolDir = (version: string) => path.join(toolDir + '', version); +const getVersionedToolDir = (version: string) => + path.join(toolDir + '', version); process.env['RUNNER_TOOL_CACHE'] = toolDir; process.env['RUNNER_TEMP'] = tempDir; @@ -61,13 +62,21 @@ describe('DotnetCoreInstaller tests', () => { for (const version of versions) { await getDotnet(version); } - expect(fs.existsSync(path.join(getVersionedToolDir('2'), 'sdk', '2.2.207'))).toBe(true); - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.120'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('2'), 'sdk', '2.2.207')) + ).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.120')) + ).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe')) + ).toBe(true); } else { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe( + true + ); } expect(process.env.DOTNET_ROOT).toBeDefined(); @@ -78,11 +87,17 @@ describe('DotnetCoreInstaller tests', () => { it('Acquires version of dotnet if no matching version is installed', async () => { await getDotnet('3.1.201'); - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201')) + ).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe')) + ).toBe(true); } else { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe( + true + ); } expect(process.env.DOTNET_ROOT).toBeDefined(); @@ -98,9 +113,13 @@ describe('DotnetCoreInstaller tests', () => { .filter(fn => fn.startsWith('3.1.')); expect(directory.length > 0).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe')) + ).toBe(true); } else { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe( + true + ); } expect(process.env.DOTNET_ROOT).toBeDefined(); diff --git a/__tests__/setup-dotnet.test.ts b/__tests__/setup-dotnet.test.ts index 4b965a46f..5e180d9a8 100644 --- a/__tests__/setup-dotnet.test.ts +++ b/__tests__/setup-dotnet.test.ts @@ -18,7 +18,8 @@ if (IS_WINDOWS) { toolDir = path.join(process.env['HOME'] + '', '.dotnet'); } -const getVersionedToolDir = (version: string) => path.join(toolDir + '', version); +const getVersionedToolDir = (version: string) => + path.join(toolDir + '', version); function createGlobalJsonPath(dotnetVersion: string) { const globalJsonPath = path.join(process.cwd(), 'global.json'); @@ -66,11 +67,17 @@ describe('setup-dotnet tests', () => { createGlobalJsonPath('3.1.201'); await setup.run(); - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'sdk', '3.1.201')) + ).toBe(true); if (IS_WINDOWS) { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe'))).toBe(true); + expect( + fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet.exe')) + ).toBe(true); } else { - expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe(true); + expect(fs.existsSync(path.join(getVersionedToolDir('3'), 'dotnet'))).toBe( + true + ); } }, 400000); From 01c6d7d40308bd6d4ff5f2b3a809b8627c500978 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Fri, 12 May 2023 08:07:44 +0200 Subject: [PATCH 13/13] Refactor solution --- __tests__/installer.test.ts | 4 +- __tests__/setup-dotnet.test.ts | 4 +- src/installer.ts | 69 +++++++++++++++------------------- 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 0ccdc68ed..4137aef04 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -21,8 +21,8 @@ if (IS_WINDOWS) { } const tempDir = path.join(__dirname, 'runner', 'temp'); -const getVersionedToolDir = (version: string) => - path.join(toolDir + '', version); +const getVersionedToolDir = (majorVersion: string) => + path.join(toolDir + '', `${majorVersion}.x`); process.env['RUNNER_TOOL_CACHE'] = toolDir; process.env['RUNNER_TEMP'] = tempDir; diff --git a/__tests__/setup-dotnet.test.ts b/__tests__/setup-dotnet.test.ts index 5e180d9a8..99032757f 100644 --- a/__tests__/setup-dotnet.test.ts +++ b/__tests__/setup-dotnet.test.ts @@ -18,8 +18,8 @@ if (IS_WINDOWS) { toolDir = path.join(process.env['HOME'] + '', '.dotnet'); } -const getVersionedToolDir = (version: string) => - path.join(toolDir + '', version); +const getVersionedToolDir = (majorVersion: string) => + path.join(toolDir + '', `${majorVersion}.x`); function createGlobalJsonPath(dotnetVersion: string) { const globalJsonPath = path.join(process.cwd(), 'global.json'); diff --git a/src/installer.ts b/src/installer.ts index 3e2aecc38..3b1833932 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -110,59 +110,52 @@ export class DotnetVersionResolver { } class InstallDir { - static base = { - windows: path.join(process.env['PROGRAMFILES'] + '', 'dotnet'), - mac: path.join(process.env['HOME'] + '', '.dotnet'), - linux: '/usr/share/dotnet' - }; - - constructor(version: string) { - const majorVersion = version.split('.').at(0); - - if (IS_WINDOWS) { - process.env[ - 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.windows}\\${majorVersion}`; - return; - } - - if (IS_LINUX) { - process.env[ - 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.linux}/${majorVersion}`; - return; - } - - process.env[ - 'DOTNET_INSTALL_DIR' - ] = `${InstallDir.base.mac}/${majorVersion}`; + static base = IS_WINDOWS + ? path.join(process.env['PROGRAMFILES'] + '', 'dotnet') + : IS_LINUX + ? '/usr/share/dotnet' + : path.join(process.env['HOME'] + '', '.dotnet'); + + constructor(private version: string) { + /** + * Separation by major versions is required to ensure compatibility + * with non-versioned files such as dotnet.exe which are not overwritten + * during the installation + */ + const majorVersion = `${(this.version.match(/^\d+\./) || ['x.'])[0]}x`; + process.env['DOTNET_INSTALL_DIR'] = path.join( + InstallDir.base + '', + majorVersion + ); } - get path() { + public get path() { if (process.env['DOTNET_INSTALL_DIR']) { return process.env['DOTNET_INSTALL_DIR']; } - if (IS_WINDOWS) return InstallDir.base.windows; - if (IS_LINUX) return InstallDir.base.linux; - return InstallDir.base.mac; + return InstallDir.base; + } + + public addToPath() { + core.addPath(this.path); + core.exportVariable('DOTNET_ROOT', this.path); } } export class DotnetCoreInstaller { - private version: string; - private quality: QualityOptions; private installDir: InstallDir; - constructor(version: string, quality: QualityOptions) { - this.version = version; - this.quality = quality; - this.installDir = new InstallDir(version); + constructor( + private version: string, + private quality: QualityOptions, + installDir = new InstallDir(version) + ) { + this.installDir = installDir; } public addToPath() { - core.addPath(this.installDir.path); - core.exportVariable('DOTNET_ROOT', this.installDir.path); + this.installDir.addToPath(); } private setQuality(