actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
922 stars 454 forks source link

Support A.B.Cxx format #382

Closed craigktreasure closed 1 year ago

craigktreasure commented 1 year ago

Description:

It would be great if we could install the latest version from within a feature band (see here): A.B.Cxx. For example: 7.0.1xx.

Justification:

It's not uncommon to be broken by the latest feature band and to want to go back to the latest of a previous, but still supported, feature band. For example, dotnet format is currently broken on 7.0.200, but not on 7.0.103. I'd like to keep installing the latest within the 7.0.100 feature band (which is currently 7.0.103) without having to hard code the patch version.

Are you willing to submit a PR?

Possibly, but wouldn't happen soon.

panticmilos commented 1 year ago

hi @craigktreasure thank you for the report, we will take a look at it :)

ericsampson commented 1 year ago

That would indeed be nice :)

IvanZosimov commented 1 year ago

Hi, @craigktreasure and @ericsampson 👋 We just merged the pull request https://github.com/actions/setup-dotnet/pull/428 which adds support for A.B.Cxx syntax. You can try it using:

- uses: actions/setup-dotnet@v3

If you have any questions, feel free to ping me.

nojaf commented 1 year ago

Hi @IvanZosimov,

Should this be working now?

  - name: Setup .NET
    uses: actions/setup-dotnet@main
    with:
      dotnet-version: '7.0.4xx'
      dotnet-quality: 'preview'

Because I got:

"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command & 'D:\a\_actions\actions\setup-dotnet\main\externals\install-dotnet.ps1' -Channel 7.0.4xx -Quality preview
dotnet-install: Failed to locate the latest version in the channel '7.0.4xx' with 'preview' quality for 'dotnet-sdk', os: 'win', architecture: 'x64'.
dotnet-install: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support.
Exception: D:\a\_actions\actions\setup-dotnet\main\externals\install-dotnet.ps1:[10](https://github.com/nojaf/deterministic-fsharp-compiler/actions/runs/5067072459/jobs/9097657009#step:4:11)24
Line |
1024 |              throw "aka.ms link resolution failure"
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | aka.ms link resolution failure

Error: Failed to install dotnet, exit code: 1. dotnet-install: Failed to locate the latest version in the channel '7.0.4xx' with 'preview' quality for 'dotnet-sdk', os: 'win', architecture: 'x64'.
dotnet-install: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support.
Exception: D:\a\_actions\actions\setup-dotnet\main\externals\install-dotnet.ps1:1024
Line |
1024 |              throw "aka.ms link resolution failure"
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | aka.ms link resolution failure
IvanZosimov commented 1 year ago

Hi, @nojaf, thanks for the comment!

Unfortunately, there is no such version of .NET SDK in preview quality available on the MS side, you can check it using the link https://aka.ms/dotnet/7.0.4xx/preview/dotnet-sdk-win-x64.exe. For instance, for the 7.0.1xx such version is available and can be installed. Check MS link: https://aka.ms/dotnet/7.0.1xx/preview/dotnet-sdk-win-x64.exe, check successful action run here: https://github.com/IvanZosimov/TestRepo2/actions/runs/5068078813

nojaf commented 1 year ago

Well, the URL is slightly different if I look at https://github.com/dotnet/installer#table https://aka.ms/dotnet/7.0.4xx/daily/dotnet-sdk-win-x64.exe

Can I configure it to use daily somehow?

nojaf commented 1 year ago

Ah yes, using dotnet-quality: 'daily' works. Tremendous thanks for implementing this feature!

ericsampson commented 1 year ago

Thank you @IvanZosimov ! Cheers