dotnet: add support for prerelease versions #1470
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1469
This PR adds official support for installing dotnet prereleases by adding
-preview
or-daily
to the version.New configuration options
Supported configurations for
version
,additionalVersions
,dotnetRuntimeVersions
andaspnetCoreRuntimeVersions
:10.0-preview
10.0-daily
Supported configurations for
version
andadditionalVersions
only:10.0.1xx-preview
10.0.1xx-daily
I believe this change is fully backwards compatible.
Importantly, this syntax will always give you a prerelease version, even if a newer GA version is available. For example, a version spec like
"8.0.1xx-preview"
gives you a release candidate build of 8.0.0 (8.0.100-rc.2.23502.2
) while the latest GA is 8.0.19.High level implementation
dotnet-install.sh
) to the latest version from https://dot.net/v1/dotnet-install.shparse_version_and_quality()
which converts version specs to a version with a quality"10.0-preview"
=>"10.0 preview"
"10.0-daily"
=>"10.0 daily"
"10.0"
=>"10.0 GA"
"10.0.1xx"
=>"10.0.1xx GA"
"10.0.100"
=>"10.0.100"
read -r
is used to split the strings above into variablesclean_version
andquality
install_sdk
andinstall_runtime
to take an optionalquality
argument and pass it on to thedotnet-install.sh
script--channel
could be passed to the dotnet-install script (which worked but was certainly weird)2.3.0
to2.4.0
Tests
For testing, I added two new test scenarios:
install_dotnet_preview
: tests for10.0-preview
and10.0.1xx-preview
install_dotnet_daily
: tests for10.0-daily
and10.0.1xx-daily
Changes to existing test cases:
install_dotnet_multiple_versions
: change10.0-preview
to10.0
to ensure this also still worksinstall_dotnet_multiple_versions_preview
: removed because it is now redundantDocumentation
devcontainer-feature.json
.NOTES.md
Remarks
Note that
"version": "10.0"
currently resolves to a preview version, but this is an implementation detail of the underlyingdotnet-install
script and the expectation is that it will resolve to a GA build some time in November.