actions / setup-dotnet

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

feat: support global.json rollForward latest variants #481

Open the-avid-engineer opened 10 months ago

the-avid-engineer commented 10 months ago

Description: This PR adds support for all of the latest* variants of rollForward option in the global.json file

Related issue: https://github.com/actions/setup-dotnet/issues/448

Check list:


I'm not sure if it makes sense to add the same kind of test for latestMajor - it would break every time there's a new major release. If it weren't limited to regular expression checks, the test could provide an EOL sdk version such as 3.1.426, and the test could make sure that the resolved major version is greater than 3, but I'm not sure how to go about that.

the-avid-engineer commented 10 months ago

One concern I have is that the README states that using the partial version numbers will include prereleases (by default?).. which makes me think it should also support the allowPrerelease part of global.json as well.. I suppose it should force the quality to GA if it's false, but..

1) What's the best way to go about that? Parse the global.json file twice (once for version, once for quality)? Or refactor the code so that it's only parsed once and passed around as needed

2) That would force quality for all versions, not just the one from global.json :/ This doesn't affect me, but there might be people using multiple versions, including one from global.json?

n0099 commented 6 months ago

Also addressed https://github.com/actions/setup-dotnet/issues/397#issuecomment-1538041973

js6pak commented 6 months ago

Keep in mind because of the awful way github actions are distributed you have to run npm run build (you should run format and lint aswell) before every commit, which you didn't since the initial one.

3089bb1ebdea5c87c2358d4aab8cc7da657e74ad is pointless because the if (globalJson.sdk && globalJson.sdk.version) { check above rules out empty/null version anyway.

Also the CI is failing which you can't see because the workflow is only enabled for pull requests and no one approved it for this one yet. In my opinion you should just disable the branch filtering here, it won't hurt to always run the check.

I've pushed out actually working code here: https://github.com/js6pak/setup-dotnet/commits/feat/support-rollForward/

AlanRynne commented 3 months ago

This would be useful to us too at Speckle! ♥️ 🙌🏼