Skip to content
New issue

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

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

Already on GitHub? # to your account

Add ability to select to install matching version already available on the current image #19

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

nikolai-laevskii
Copy link

@nikolai-laevskii nikolai-laevskii commented Sep 4, 2023

Description:
Adds ability to set preference for already installed versions when setting up dotnet environment. If prefer-installed flag is active, action will attempt to check already installed versions with dotnet utility. If matching version exists on the runner, request for this specific version will be passed to the install-script, which has ability to verify already installed version and skip download if current installation is not broken.

Related issue:
actions#356

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dsame dsame self-assigned this Sep 6, 2023
* correct version number like '3.1.201', '3.1.201', '3.1.201', '3.1.201', '6.0.402'
*/
export const matchVersionToList = (version: string, versions: string[]) => {
if (!version || version === 'x' || version === '*') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not version argument is semver specification and semver matcher package can be used in order to match? Also version can be renamed to versionSpec then.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point, but semver doesn't seem to work correctly with 6.0.4xx version format, i.e:

semver.satisfies('6.0.402', '6.0.4xx') // -> false (should be true)

src/dotnet-utils.ts Outdated Show resolved Hide resolved
src/installer.ts Outdated Show resolved Hide resolved
src/installer.ts Outdated Show resolved Hide resolved
src/installer.ts Outdated Show resolved Hide resolved
- add explicit return type for findMatching version function
- force version argument to be defined in createVersionArgument
- make dotnetVersion and quality properties readonly
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants