From 8aad93f856d6f4f499e9ea72e7451171ce671b3f Mon Sep 17 00:00:00 2001 From: Zachary Eisinger Date: Mon, 21 Sep 2020 14:11:39 -0700 Subject: [PATCH 01/18] Action input text update --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f62d018..df5b215 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: color: green inputs: dotnet-version: - description: 'SDK version to use. Examples: 2.2.104, 3.1, 3.1.x' + description: 'Optional SDK version to use. If not provided, will install global.json version when available. Examples: 2.2.104, 3.1, 3.1.x' source-url: description: 'Optional package source for which to set up authentication. Will consult any existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the NUGET_AUTH_TOKEN environment variable as a ClearTextPassword' owner: From ce38f90a9a1180f9da601b2db51d29b769bc65ec Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 11:21:42 +0300 Subject: [PATCH 02/18] Update installer scripts --- externals/install-dotnet.ps1 | 101 ++++++++++++++++++++--------------- externals/install-dotnet.sh | 40 ++++++++++---- 2 files changed, 89 insertions(+), 52 deletions(-) diff --git a/externals/install-dotnet.ps1 b/externals/install-dotnet.ps1 index ff26a05..4646429 100644 --- a/externals/install-dotnet.ps1 +++ b/externals/install-dotnet.ps1 @@ -340,9 +340,8 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) { 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" + $VersionFileUrl = "$UncachedFeed/WindowsDesktop/$Channel/latest.version" } elseif (-not $Runtime) { $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" @@ -438,7 +437,16 @@ function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string $PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" } elseif ($Runtime -eq "windowsdesktop") { + # The windows desktop runtime is part of the core runtime layout prior to 5.0 $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" + if ($SpecificVersion -match '^(\d+)\.(.*)$') + { + $majorVersion = [int]$Matches[1] + if ($majorVersion -ge 5) + { + $PayloadURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/windowsdesktop-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" + } + } } elseif (-not $Runtime) { $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificProductVersion-win-$CLIArchitecture.zip" @@ -480,7 +488,16 @@ function Get-Product-Version([string]$AzureFeed, [string]$SpecificVersion) { $ProductVersionTxtURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/productVersion.txt" } elseif ($Runtime -eq "windowsdesktop") { + # The windows desktop runtime is part of the core runtime layout prior to 5.0 $ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt" + if ($SpecificVersion -match '^(\d+)\.(.*)') + { + $majorVersion = [int]$Matches[1] + if ($majorVersion -ge 5) + { + $ProductVersionTxtURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/productVersion.txt" + } + } } elseif (-not $Runtime) { $ProductVersionTxtURL = "$AzureFeed/Sdk/$SpecificVersion/productVersion.txt" @@ -885,10 +902,10 @@ Say "Note that the script does not resolve dependencies during installation." Say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install/windows#dependencies" Say "Installation finished" # SIG # Begin signature block -# MIIjkgYJKoZIhvcNAQcCoIIjgzCCI38CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIIjjwYJKoZIhvcNAQcCoIIjgDCCI3wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD2c707qnCLOLIC -# n6Mu5Gr4+Xp68foyZlGlTycnycc5l6CCDYEwggX/MIID56ADAgECAhMzAAABh3IX +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCNsnhcJvx/hXmM +# w8KjuvvIMDBFonhg9XJFc1QwfTyH4aCCDYEwggX/MIID56ADAgECAhMzAAABh3IX # chVZQMcJAAAAAAGHMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p @@ -960,29 +977,29 @@ Say "Installation finished" # xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 # eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 # r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I -# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIVZzCCFWMCAQEwgZUwfjELMAkG +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIVZDCCFWACAQEwgZUwfjELMAkG # A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx # HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z # b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAYdyF3IVWUDHCQAAAAABhzAN # BglghkgBZQMEAgEFAKCBrj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y # cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw @@ -1043,7 +1060,7 @@ Say "Installation finished" # cs0d9LiFAR6A+xuJKlQ5slvayA1VmXqHczsI5pgt6o3gMy4SKfXAL1QnIffIrE7a # KLixqduWsqdCosnPGUFN4Ib5KpqjEWYw07t0MkvfY3v1mYovG8chr1m1rtxEPJdQ # cdeh0sVV42neV8HR3jDA/czmTfsNv11P6Z0eGTgvvM9YBS7vDaBQNdrvCScc1bN+ -# NR4Iuto229Nfj950iEkSoYIC0jCCAjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYT +# NR4Iuto229Nfj950iEkSoYICzzCCAjgCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYT # AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD # VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBP # cGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo4 @@ -1052,27 +1069,27 @@ Say "Installation finished" # fjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH # UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD # Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIF -# AOOFYaowIhgPMjAyMDEyMTcwODQ4NDJaGA8yMDIwMTIxODA4NDg0MlowdzA9Bgor -# BgEEAYRZCgQBMS8wLTAKAgUA44VhqgIBADAKAgEAAgIoWgIB/zAHAgEAAgISJTAK -# AgUA44azKgIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIB -# AAIDB6EgoQowCAIBAAIDAYagMA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/0uFFh42hTM5XOoKdXevBaiSxmYK9Ilcn9nu5ZH +# 4TCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw +# DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x +# JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABLCKv +# RZd1+RvuAAAAAAEsMCIEIIfIM3YbzHswb/Kj/qq1l1cHA6QBl+gEXYanUNJomrpT +# MA0GCSqGSIb3DQEBCwUABIIBAAwdcXssUZGO7ho5+NHLjIxLtQk543aKGo+lrRMY +# Q9abE1h/AaaNJl0iGxX4IihNWyfovSfYL3L4eODUBAu68tWSxeceRfWNsb/ZZfUi +# v89hpLssI/Gf1BEgNMA4zCuIGQiC8okusVumEpAhhvCEbSiTTTtBdolTnU/CAKui +# oxaU3R9XkKh1F4oAM26+dJ1J2BLQXPs5afNvvedDsZWNQUPK1sFF3JRfzxiTrwBW +# EJRyflev9gyDoqCHzippgb+6+eti1WTkcA9Q49GIT11S6LOAVqkSC9N7Nqf8ksh8 +# ARdwT8jigpsm+mj7lrVU9upDkhVYhKeO8oiZq95Q53Zkteo= # SIG # End signature block diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index 753a45b..13d30ad 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -303,7 +303,7 @@ get_machine_architecture() { echo "arm" return 0 ;; - aarch64) + aarch64|arm64) echo "arm64" return 0 ;; @@ -744,13 +744,31 @@ download() { fi local failed=false - if machine_has "curl"; then - downloadcurl "$remote_path" "$out_path" || failed=true - elif machine_has "wget"; then - downloadwget "$remote_path" "$out_path" || failed=true - else - failed=true - fi + local attempts=0 + while [ $attempts -lt 3 ]; do + attempts=$((attempts+1)) + failed=false + if machine_has "curl"; then + downloadcurl "$remote_path" "$out_path" || failed=true + elif machine_has "wget"; then + downloadwget "$remote_path" "$out_path" || failed=true + else + unset http_code + download_error_msg="Missing dependency: neither curl nor wget was found." + break + fi + + if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then + break + fi + + say "Download attempt #$attempts has failed: $http_code $download_error_msg" + say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds." + sleep $((attempts*20)) + done + + + if [ "$failed" = true ]; then say_verbose "Download failed: $remote_path" return 1 @@ -761,6 +779,8 @@ download() { # Updates global variables $http_code and $download_error_msg downloadcurl() { eval $invocation + unset http_code + unset download_error_msg local remote_path="$1" local out_path="${2:-}" # Append feed_credential as late as possible before calling curl to avoid logging feed_credential @@ -789,6 +809,8 @@ downloadcurl() { # Updates global variables $http_code and $download_error_msg downloadwget() { eval $invocation + unset http_code + unset download_error_msg local remote_path="$1" local out_path="${2:-}" # Append feed_credential as late as possible before calling wget to avoid logging feed_credential @@ -882,7 +904,6 @@ install_dotnet() { say "Downloading primary link $download_link" # The download function will set variables $http_code and $download_error_msg in case of failure. - http_code=""; download_error_msg="" download "$download_link" "$zip_path" 2>&1 || download_failed=true primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" @@ -906,7 +927,6 @@ install_dotnet() { say "Downloading legacy link $download_link" # The download function will set variables $http_code and $download_error_msg in case of failure. - http_code=""; download_error_msg="" download "$download_link" "$zip_path" 2>&1 || download_failed=true legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" From 2d101adc9f90674027b2ceb789aafb94fa33ebc8 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 10 Feb 2021 19:12:20 +0300 Subject: [PATCH 03/18] restrict blank issues --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c78a361..2746c69 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a bug report title: '' -labels: bug +labels: bug, needs triage assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ac9f4b6..2a48739 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ -blank_issues_enabled: true +blank_issues_enabled: false contact_links: - name: .NET issues url: https://github.com/dotnet/runtime#filing-issues diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c05e753..2c9d47d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: feature request +labels: feature request, needs triage assignees: '' --- From 3c80e97cbdf5b47ad0207d8183c953c6eca77b5d Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 11 Feb 2021 10:32:14 +0300 Subject: [PATCH 04/18] Update Linux installer --- externals/install-dotnet.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index 13d30ad..8ffe169 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -489,7 +489,7 @@ get_specific_version_from_version() { local json_file="$5" if [ -z "$json_file" ]; then - if [[ "$version" == "latest" ]]; then + if [[ "$version" == "latest" ]]; then local version_info version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" @@ -522,7 +522,7 @@ construct_download_link() { local specific_version="${4//[$'\t\r\n']}" local specific_product_version="$(get_specific_product_version "$1" "$4")" local osname="$5" - + local download_link=null if [[ "$runtime" == "dotnet" ]]; then download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" @@ -542,7 +542,7 @@ construct_download_link() { # azure_feed - $1 # specific_version - $2 get_specific_product_version() { - # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents + # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents # to resolve the version of what's in the folder, superseding the specified version. eval $invocation @@ -753,9 +753,8 @@ download() { elif machine_has "wget"; then downloadwget "$remote_path" "$out_path" || failed=true else - unset http_code - download_error_msg="Missing dependency: neither curl nor wget was found." - break + say_err "Missing dependency: neither curl nor wget was found." + exit 1 fi if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then @@ -905,10 +904,10 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" # if the download fails, download the legacy_download_link if [ "$download_failed" = true ]; then + primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" case $primary_path_http_code in 404) say "The resource at $download_link is not available." @@ -928,9 +927,9 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" if [ "$download_failed" = true ]; then + legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" case $legacy_path_http_code in 404) say "The resource at $download_link is not available." @@ -1132,10 +1131,10 @@ do echo " --arch,-Architecture,-Arch" echo " Possible values: x64, arm, and arm64" echo " --os Specifies operating system to be used when selecting the installer." - echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." - echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." + echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." + echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." echo " Not supported for legacy links. Use --runtime-id to specify platform for legacy links." - echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." + echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." echo " --runtime Installs a shared runtime only, without the SDK." echo " -Runtime" echo " Possible values:" @@ -1160,7 +1159,7 @@ do echo " Installs just the shared runtime bits, not the entire SDK." echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." echo " -RuntimeId" The parameter is obsolete and may be removed in a future version of this script. Should be used only for versions below 2.1. - echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." + echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." echo "" echo "Install Location:" echo " Location is chosen in following order:" @@ -1197,7 +1196,7 @@ if [ "$dry_run" = true ]; then if [ "$valid_legacy_download_link" = true ]; then say "Legacy named payload URL: $legacy_download_link" fi - repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" + repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" if [[ "$runtime" == "dotnet" ]]; then repeatable_command+=" --runtime "\""dotnet"\""" elif [[ "$runtime" == "aspnetcore" ]]; then From 4f71fcfa8188d6a27457cb92dfead2109a4d8954 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Thu, 4 Mar 2021 21:24:09 +0300 Subject: [PATCH 05/18] Add @actions/virtual-environments-owners to CODEOWNERS file --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..e230aaa --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @actions/virtual-environments-owners From 36fa9877a93876f714083cf7deec26bbe66d0dbc Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 17 Mar 2021 12:38:57 +0300 Subject: [PATCH 06/18] try fixing 5.x issue --- dist/index.js | 16 +++++++++++----- src/installer.ts | 25 ++++++++++++++++++------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index 15f8a3b..aadf381 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16876,7 +16876,13 @@ class DotNetVersionInfo { this.throwInvalidVersionFormat(); } let major = this.getVersionNumberOrThrow(parts[0]); - let minor = this.getVersionNumberOrThrow(parts[1]); + let minor; + if (parts[1] === 'x') { + minor = parts[1]; + } + else { + minor = this.getVersionNumberOrThrow(parts[1]); + } this.fullversion = major + '.' + minor; } getVersionNumberOrThrow(input) { @@ -16894,7 +16900,7 @@ class DotNetVersionInfo { } } throwInvalidVersionFormat() { - throw 'Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*'; + throw new Error('Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*'); } /** * If true exacatly one version should be resolved @@ -16997,7 +17003,7 @@ class DotnetCoreInstaller { } console.log(process.env['PATH']); if (resultCode != 0) { - throw `Failed to install dotnet ${resultCode}. ${output}`; + throw new Error(`Failed to install dotnet ${resultCode}. ${output}`); } }); } @@ -17025,7 +17031,7 @@ class DotnetCoreInstaller { // Sort for latest version releasesInfo = releasesInfo.sort((a, b) => semver.rcompare(a['sdk']['version'], b['sdk']['version'])); if (releasesInfo.length == 0) { - throw `Could not find dotnet core version. Please ensure that specified version ${versionInfo.inputVersion} is valid.`; + throw new Error(`Could not find dotnet core version. Please ensure that specified version ${versionInfo.inputVersion} is valid.`); } let release = releasesInfo[0]; return release['sdk']['version']; @@ -17046,7 +17052,7 @@ class DotnetCoreInstaller { return versionParts[0] == sdkParts[0]; }); if (releasesInfo.length === 0) { - throw `Could not find info for version ${versionParts.join('.')} at ${DotNetCoreIndexUrl}`; + throw new Error(`Could not find info for version ${versionParts.join('.')} at ${DotNetCoreIndexUrl}`); } return releasesInfo[0]['releases.json']; }); diff --git a/src/installer.ts b/src/installer.ts index f0b48a2..12113e6 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -39,7 +39,12 @@ export class DotNetVersionInfo { } let major = this.getVersionNumberOrThrow(parts[0]); - let minor = this.getVersionNumberOrThrow(parts[1]); + let minor; + if (parts[1] === 'x') { + minor = parts[1]; + } else { + minor = this.getVersionNumberOrThrow(parts[1]); + } this.fullversion = major + '.' + minor; } @@ -60,7 +65,9 @@ export class DotNetVersionInfo { } private throwInvalidVersionFormat() { - throw 'Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*'; + throw new Error( + 'Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*' + ); } /** @@ -187,7 +194,7 @@ export class DotnetCoreInstaller { console.log(process.env['PATH']); if (resultCode != 0) { - throw `Failed to install dotnet ${resultCode}. ${output}`; + throw new Error(`Failed to install dotnet ${resultCode}. ${output}`); } } @@ -236,7 +243,9 @@ export class DotnetCoreInstaller { ); if (releasesInfo.length == 0) { - throw `Could not find dotnet core version. Please ensure that specified version ${versionInfo.inputVersion} is valid.`; + throw new Error( + `Could not find dotnet core version. Please ensure that specified version ${versionInfo.inputVersion} is valid.` + ); } let release = releasesInfo[0]; @@ -264,9 +273,11 @@ export class DotnetCoreInstaller { }); if (releasesInfo.length === 0) { - throw `Could not find info for version ${versionParts.join( - '.' - )} at ${DotNetCoreIndexUrl}`; + throw new Error( + `Could not find info for version ${versionParts.join( + '.' + )} at ${DotNetCoreIndexUrl}` + ); } return releasesInfo[0]['releases.json']; From 20afff9c90f1ba52c7fc7198759eba900832b4cf Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 17 Mar 2021 14:56:08 +0300 Subject: [PATCH 07/18] work on fixing test --- __tests__/versionutil.test.ts | 1 - dist/index.js | 12 +++--------- src/installer.ts | 11 +++-------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/__tests__/versionutil.test.ts b/__tests__/versionutil.test.ts index a238688..b816013 100644 --- a/__tests__/versionutil.test.ts +++ b/__tests__/versionutil.test.ts @@ -42,7 +42,6 @@ describe('version tests', () => { '.2.3', '.2.x', '1', - '2.x', '*.*.1', '*.1', '*.', diff --git a/dist/index.js b/dist/index.js index aadf381..9febcc2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16869,20 +16869,14 @@ class DotNetVersionInfo { return; } //Note: No support for previews when using generic - let parts = version.split('.'); + const parts = version.split('.'); if (parts.length < 2 || parts.length > 3) this.throwInvalidVersionFormat(); if (parts.length == 3 && parts[2] !== 'x' && parts[2] !== '*') { this.throwInvalidVersionFormat(); } - let major = this.getVersionNumberOrThrow(parts[0]); - let minor; - if (parts[1] === 'x') { - minor = parts[1]; - } - else { - minor = this.getVersionNumberOrThrow(parts[1]); - } + const major = this.getVersionNumberOrThrow(parts[0]); + const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); this.fullversion = major + '.' + minor; } getVersionNumberOrThrow(input) { diff --git a/src/installer.ts b/src/installer.ts index 12113e6..0f3fc42 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -30,7 +30,7 @@ export class DotNetVersionInfo { } //Note: No support for previews when using generic - let parts: string[] = version.split('.'); + const parts: string[] = version.split('.'); if (parts.length < 2 || parts.length > 3) this.throwInvalidVersionFormat(); @@ -38,13 +38,8 @@ export class DotNetVersionInfo { this.throwInvalidVersionFormat(); } - let major = this.getVersionNumberOrThrow(parts[0]); - let minor; - if (parts[1] === 'x') { - minor = parts[1]; - } else { - minor = this.getVersionNumberOrThrow(parts[1]); - } + const major = this.getVersionNumberOrThrow(parts[0]); + const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); this.fullversion = major + '.' + minor; } From 6930747f7f2406e54bf60cd86f4e425fb11b7b65 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 17 Mar 2021 14:58:04 +0300 Subject: [PATCH 08/18] create release --- dist/index.js | 4 +++- src/installer.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9febcc2..d80bc1e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16876,7 +16876,9 @@ class DotNetVersionInfo { this.throwInvalidVersionFormat(); } const major = this.getVersionNumberOrThrow(parts[0]); - const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); + const minor = ['x', '*'].includes(parts[1]) + ? parts[1] + : this.getVersionNumberOrThrow(parts[1]); this.fullversion = major + '.' + minor; } getVersionNumberOrThrow(input) { diff --git a/src/installer.ts b/src/installer.ts index 0f3fc42..d0bc4f4 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -39,7 +39,9 @@ export class DotNetVersionInfo { } const major = this.getVersionNumberOrThrow(parts[0]); - const minor = ['x', '*'].includes(parts[1]) ? parts[1] : this.getVersionNumberOrThrow(parts[1]); + const minor = ['x', '*'].includes(parts[1]) + ? parts[1] + : this.getVersionNumberOrThrow(parts[1]); this.fullversion = major + '.' + minor; } From 083d63a2ff6892d228bfb580ea7c7a6e0995c2bf Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 18 Mar 2021 10:18:52 +0300 Subject: [PATCH 09/18] add yesy cases --- __tests__/versionutil.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__tests__/versionutil.test.ts b/__tests__/versionutil.test.ts index b816013..1eb4697 100644 --- a/__tests__/versionutil.test.ts +++ b/__tests__/versionutil.test.ts @@ -13,6 +13,8 @@ describe('version tests', () => { ); each([ + ['3.x', '3.1'], + ['3.*', '3.1'], ['3.1.x', '3.1'], ['1.1.*', '1.1'], ['2.0', '2.0'] From 385512c5e5b7ecd4b4c3ad07e808b5a96c754f33 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 18 Mar 2021 11:07:32 +0300 Subject: [PATCH 10/18] fix test --- __tests__/versionutil.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/versionutil.test.ts b/__tests__/versionutil.test.ts index 1eb4697..69681da 100644 --- a/__tests__/versionutil.test.ts +++ b/__tests__/versionutil.test.ts @@ -13,8 +13,8 @@ describe('version tests', () => { ); each([ - ['3.x', '3.1'], - ['3.*', '3.1'], + ['3.x', '3.x'], + ['3.*', '3.*'], ['3.1.x', '3.1'], ['1.1.*', '1.1'], ['2.0', '2.0'] From 3707a44789a14a0c870cbc513c20b3d7d9f22960 Mon Sep 17 00:00:00 2001 From: GGG KILLER Date: Thu, 25 Mar 2021 20:07:28 -0300 Subject: [PATCH 11/18] Remove unsupported versions of .NET from README. .NET Core 2.2 and 3.0 are no longer supported and should not be in the examples. All versions were changed to pull in the latest revision as people might copy this without checking all accepted version formats and getting the latest revision is good security practice. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 66af02f..8eb074b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet: [ '2.2.103', '3.0', '3.1.x' ] + dotnet: [ '2.1.x', '3.1.x', '5.0.x' ] name: Dotnet ${{ matrix.dotnet }} sample steps: - uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v1 with: - dotnet-version: '2.2.103' + dotnet-version: '2.1.x' - name: Setup dotnet uses: actions/setup-dotnet@v1 with: @@ -113,7 +113,7 @@ build: - uses: actions/checkout@main - uses: actions/setup-dotnet@v1 with: - dotnet-version: '3.1.100' # SDK Version to use. + dotnet-version: '3.1.x' # SDK Version to use. ``` # License From 8dcf1ee9bc0f504f4e83b72cbb4b6401c9598b4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 22:18:10 +0000 Subject: [PATCH 12/18] Bump y18n from 4.0.0 to 4.0.1 Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index da3c738..e5a85ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5342,9 +5342,9 @@ "dev": true }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true }, "yaml": { From f2eb44dadd6e1963e97bf8633e8a2391ecd5167b Mon Sep 17 00:00:00 2001 From: Andreas Offenhaeuser Date: Mon, 5 Apr 2021 21:35:43 +0900 Subject: [PATCH 13/18] Update link to pre-installed runner Software --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66af02f..d876e29 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This action sets up a [dotnet core cli](https://github.com/dotnet/cli) environme Please Note: GitHub hosted runners have some versions of the .NET SDK preinstalled. Installed versions are subject to change. Please refer to the documentation -[software installed on github hosted runners](https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners) +[software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for .NET SDK versions that are currently available. # Usage From 632ccbdfb97bc4aa7484106496626056c0589dd2 Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 19 Apr 2021 14:25:42 +0300 Subject: [PATCH 14/18] Support nuget.config name formats --- src/authutil.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/authutil.ts b/src/authutil.ts index 463f0d3..e625f06 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -13,7 +13,7 @@ export function configAuthentication( ) { const existingNuGetConfig: string = path.resolve( processRoot, - existingFileLocation == '' ? 'nuget.config' : existingFileLocation + existingFileLocation == '' ? getExistingNugetConfig(processRoot) : existingFileLocation ); const tempNuGetConfig: string = path.resolve( @@ -25,6 +25,14 @@ export function configAuthentication( writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig); } +function getExistingNugetConfig(processRoot: string) { + const configFileNames = fs.readdirSync(processRoot).filter(filename => filename.toLowerCase() == 'nuget.config') + if (configFileNames.length) { + return configFileNames[0]; + } + return 'nuget.config'; +} + function writeFeedToFile( feedUrl: string, existingFileLocation: string, From d08d2193f9160552a35531296eb3fb6a8ce4027a Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 19 Apr 2021 14:26:05 +0300 Subject: [PATCH 15/18] Prettier --- src/authutil.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/authutil.ts b/src/authutil.ts index e625f06..54a2d3f 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -13,7 +13,9 @@ export function configAuthentication( ) { const existingNuGetConfig: string = path.resolve( processRoot, - existingFileLocation == '' ? getExistingNugetConfig(processRoot) : existingFileLocation + existingFileLocation == '' + ? getExistingNugetConfig(processRoot) + : existingFileLocation ); const tempNuGetConfig: string = path.resolve( @@ -26,7 +28,9 @@ export function configAuthentication( } function getExistingNugetConfig(processRoot: string) { - const configFileNames = fs.readdirSync(processRoot).filter(filename => filename.toLowerCase() == 'nuget.config') + const configFileNames = fs + .readdirSync(processRoot) + .filter(filename => filename.toLowerCase() == 'nuget.config'); if (configFileNames.length) { return configFileNames[0]; } From 07b4a80293787dc359f76a18cb064efc41b5719b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 19 Apr 2021 14:26:52 +0300 Subject: [PATCH 16/18] Build index.js --- dist/index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 15f8a3b..199f644 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4840,11 +4840,22 @@ const github = __importStar(__webpack_require__(469)); const xmlbuilder = __importStar(__webpack_require__(312)); const xmlParser = __importStar(__webpack_require__(989)); function configAuthentication(feedUrl, existingFileLocation = '', processRoot = process.cwd()) { - const existingNuGetConfig = path.resolve(processRoot, existingFileLocation == '' ? 'nuget.config' : existingFileLocation); + const existingNuGetConfig = path.resolve(processRoot, existingFileLocation == '' + ? getExistingNugetConfig(processRoot) + : existingFileLocation); const tempNuGetConfig = path.resolve(processRoot, '../', 'nuget.config'); writeFeedToFile(feedUrl, existingNuGetConfig, tempNuGetConfig); } exports.configAuthentication = configAuthentication; +function getExistingNugetConfig(processRoot) { + const configFileNames = fs + .readdirSync(processRoot) + .filter(filename => filename.toLowerCase() == 'nuget.config'); + if (configFileNames.length) { + return configFileNames[0]; + } + return 'nuget.config'; +} function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) { console.log(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`); let xml; From a8c97016ef885352c99d116af10e48786cda01ca Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 19 Apr 2021 16:11:14 +0300 Subject: [PATCH 17/18] Minor fix --- dist/index.js | 4 ++-- src/authutil.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 199f644..3b057b7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4840,7 +4840,7 @@ const github = __importStar(__webpack_require__(469)); const xmlbuilder = __importStar(__webpack_require__(312)); const xmlParser = __importStar(__webpack_require__(989)); function configAuthentication(feedUrl, existingFileLocation = '', processRoot = process.cwd()) { - const existingNuGetConfig = path.resolve(processRoot, existingFileLocation == '' + const existingNuGetConfig = path.resolve(processRoot, existingFileLocation === '' ? getExistingNugetConfig(processRoot) : existingFileLocation); const tempNuGetConfig = path.resolve(processRoot, '../', 'nuget.config'); @@ -4850,7 +4850,7 @@ exports.configAuthentication = configAuthentication; function getExistingNugetConfig(processRoot) { const configFileNames = fs .readdirSync(processRoot) - .filter(filename => filename.toLowerCase() == 'nuget.config'); + .filter(filename => filename.toLowerCase() === 'nuget.config'); if (configFileNames.length) { return configFileNames[0]; } diff --git a/src/authutil.ts b/src/authutil.ts index 54a2d3f..77d66f6 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -13,7 +13,7 @@ export function configAuthentication( ) { const existingNuGetConfig: string = path.resolve( processRoot, - existingFileLocation == '' + existingFileLocation === '' ? getExistingNugetConfig(processRoot) : existingFileLocation ); @@ -30,7 +30,7 @@ export function configAuthentication( function getExistingNugetConfig(processRoot: string) { const configFileNames = fs .readdirSync(processRoot) - .filter(filename => filename.toLowerCase() == 'nuget.config'); + .filter(filename => filename.toLowerCase() === 'nuget.config'); if (configFileNames.length) { return configFileNames[0]; } From 3edf2e9363275b7fcf1d3210aa362f26c07287ab Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Mon, 19 Apr 2021 16:16:44 +0300 Subject: [PATCH 18/18] Minor fix --- dist/index.js | 5 +++-- src/authutil.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3b057b7..28caa4a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4848,13 +4848,14 @@ function configAuthentication(feedUrl, existingFileLocation = '', processRoot = } exports.configAuthentication = configAuthentication; function getExistingNugetConfig(processRoot) { + const defaultConfigName = 'nuget.config'; const configFileNames = fs .readdirSync(processRoot) - .filter(filename => filename.toLowerCase() === 'nuget.config'); + .filter(filename => filename.toLowerCase() === defaultConfigName); if (configFileNames.length) { return configFileNames[0]; } - return 'nuget.config'; + return defaultConfigName; } function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) { console.log(`dotnet-auth: Finding any source references in ${existingFileLocation}, writing a new temporary configuration file with credentials to ${tempFileLocation}`); diff --git a/src/authutil.ts b/src/authutil.ts index 77d66f6..d8ddef0 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -28,13 +28,14 @@ export function configAuthentication( } function getExistingNugetConfig(processRoot: string) { + const defaultConfigName = 'nuget.config'; const configFileNames = fs .readdirSync(processRoot) - .filter(filename => filename.toLowerCase() === 'nuget.config'); + .filter(filename => filename.toLowerCase() === defaultConfigName); if (configFileNames.length) { return configFileNames[0]; } - return 'nuget.config'; + return defaultConfigName; } function writeFeedToFile(