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

Reading version from .ruby-version and Windows support #4

Closed
gencer opened this issue Jan 5, 2020 · 5 comments
Closed

Reading version from .ruby-version and Windows support #4

gencer opened this issue Jan 5, 2020 · 5 comments
Assignees

Comments

@gencer
Copy link

gencer commented Jan 5, 2020

What is the best way of reading ruby version from .ruby-version file?

Something like:

      - uses: eregon/use-ruby-action@master
        with:
          ruby-version: "$(cat .ruby-version)" # or similar

Also, I didn't want to open an another issue for this but do you plan to support Windows? It would be awesome if we can get the windows builds. Windows support is live. Thank you.

@gencer gencer changed the title Reading version from .ruby-version and Windows support Reading version from .ruby-version and Windows support Jan 5, 2020
@eregon
Copy link
Member

eregon commented Jan 5, 2020

Unfortunately I think that syntax doesn't work and GitHub Actions is fairly restrictive on values for with:.
Did you try it to see what happens? I guess the String is passed as-is.

Maybe I should add a special value like ".ruby-version", or I think simpler if ruby-version: is unset look if there is a .ruby-version in the current directory and use that?

@eregon eregon self-assigned this Jan 5, 2020
@gencer
Copy link
Author

gencer commented Jan 6, 2020

For the first question, as you presumed it didn't worked.

And for .ruby-version support will be awesome because, we constantly update our ruby versions and it will be great to see it sync on each CI runs. This way, dependabot and other pull requests that uses another version (outdated) will still work even if we upgrade on master.

P.S.: Thank you so much for this great action and taking care of building ruby for us!

@eregon
Copy link
Member

eregon commented Jan 6, 2020

Could you give me an example of the format you use for .ruby-version?
Something like ruby-2.6.5?

@eregon eregon closed this as completed in a61be15 Jan 6, 2020
@eregon
Copy link
Member

eregon commented Jan 6, 2020

It works with a61be15, thank you for the suggestion.
I updated the README to document this.

Using

    - uses: eregon/use-ruby-action@master

should be enough if there is a .ruby-version file.

You can also set it explicitly to .ruby-version:

    - uses: eregon/use-ruby-action@master
      with:
        ruby-version: .ruby-version

@gencer
Copy link
Author

gencer commented Jan 7, 2020

@eregon Thank you one more time for quick solution on this case. First option is the most cleaner. I always have .ruby-version on root.

Have a nice week!

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

No branches or pull requests

2 participants