Skip to content

Commit

Permalink
Move ruby_versions.rb into workflow code
Browse files Browse the repository at this point in the history
  • Loading branch information
uvlad7 committed Oct 29, 2023
1 parent fedcebf commit 17a6f31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ jobs:
shell: bash
run: |
: Run query
result="$(ruby ruby_versions.rb $GITHUB_WORKSPACE/xml2json.gemspec)"
result="$(ruby -e '
# frozen_string_literal: true
require "net/http"
require "json"
RUBY_VERSIONS_URL = "https://endoflife.date/api/ruby.json"
gemspec = Gem::Specification.load(ARGV[0])
puts(JSON.parse(Net::HTTP.get(URI(RUBY_VERSIONS_URL))).map do |ver|
ver["cycle"] if gemspec.required_ruby_version.satisfied_by?(Gem::Version.new(ver["cycle"]))
end.compact.join(","))
' $GITHUB_WORKSPACE/xml2json.gemspec)"
echo "result=$result" >> $GITHUB_OUTPUT
cross-gem:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/ruby_versions.rb

This file was deleted.

0 comments on commit 17a6f31

Please sign in to comment.