Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use global.json to control .NET SDK version #2883

Open
Arthri opened this issue Dec 24, 2022 · 1 comment
Open

Use global.json to control .NET SDK version #2883

Arthri opened this issue Dec 24, 2022 · 1 comment

Comments

@Arthri
Copy link
Contributor

Arthri commented Dec 24, 2022

Is your feature request related to a problem? Please describe.
Currently, the NuGet CI and OTAPI CI use different versions of the .NET SDK. This is not a problem right now but someone might forget to update them in the future. Additionally, introducing a global.json ensures everyone is on the same SDK version and mitigates build problems

dotnet-version: '6.0.100'

dotnet-version: '6.0.100'

dotnet-version: 6.0.400

Describe the solution you'd like
Introduce a global.json at the repository's top level. This file controls which version of the .NET SDK MSBuild uses, but setup-dotnet(action used to setup .NET in CI) also supports it(in this case the dotnet-version should be removed):

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
  with:
    dotnet-version: '3.1.x'
- run: dotnet build <my project>

Warning: Unless a concrete version is specified in the global.json file, the latest .NET version installed on the runner (including preinstalled versions) will be used by default. Please refer to the documentation for the currently preinstalled .NET SDK versions.

The example config below specifies 6.0.100 as the SDK version, but allows a leniency of any version under 6.0.*. 6.0.404 passes, but 6.1.100 or 7.0.101 doesn't

{
    "sdk": {
        "version": "6.0.100",
        "rollForward": "latestFeature"
    }
}

Describe alternatives you've considered
none considered

Additional context
none

@csmir
Copy link
Contributor

csmir commented Dec 24, 2022

It should also be worth to implement the security patches that have been rolled out so far. Considering these patches range from remote code execution (112) to unintended privilege elevation (110), it should be quite important to keep up with them, even if they don't directly apply to the current codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants