Compare commits

...
8 Commits
Author SHA1 Message Date
Lars Kanis 80740b3b13 Add new RubyInstaller releases 4.0.1-1 and 3.2.10-1 2026-01-18 22:55:12 +01:00
Lars Kanis 5fcbc91943 Fix compatibility to ruby-3.2
... which is the default ruby version on Github Actions.
2026-01-18 22:55:12 +01:00
ruby-builder-bot 708024e6c9 Add ruby-3.2.10 2026-01-14 15:59:44 +01:00
Benoit Daloze 757ecf59ea Give a proper name to CI jobs checking generated files 2026-01-13 11:06:41 +01:00
Benoit Daloze 6963d48fc7 Use Regexp.escape to not need to manually escape (error-prone) 2026-01-13 11:06:41 +01:00
Benoit Daloze 3fc6249beb Match more strictly with \A and \z 2026-01-13 11:06:41 +01:00
なつき b939495830 Add restriction and validation for download urls 2026-01-13 11:06:41 +01:00
ruby-builder-bot 4fc31e1c82 Add ruby-4.0.1 2026-01-13 10:49:20 +01:00
7 changed files with 61 additions and 7 deletions
+14 -1
View File
@@ -369,7 +369,20 @@ jobs:
- name: C:/msys64/mingw64/bin/gcc.exe not installed
run: ruby -e "abort if File.exist?('C:/msys64/mingw64/bin/gcc.exe')"
lint:
validate-windows-versions:
name: "Check windows*versions.json are up-to-date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./
with:
ruby-version: ruby
- run: ruby generate-windows-versions.rb
- name: Check generated files are up to date
run: git diff --exit-code
check-dist-index:
name: "Check dist/index.js is up-to-date"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
+1 -1
View File
@@ -15,7 +15,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions |
| ----------- | -------- |
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 4.0.0, head, debug, mingw, mswin, ucrt |
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 4.0.1, head, debug, mingw, mswin, ucrt |
| `jruby` | 9.1.17.0 - 10.0.2.0, head |
| `truffleruby` | 19.3.0 - 33.0.0, head |
| `truffleruby+graalvm` | 21.2.0 - 33.0.0, head |
Generated Vendored
+3 -3
View File
File diff suppressed because one or more lines are too long
+27
View File
@@ -2,6 +2,31 @@ require 'open-uri'
require 'yaml'
require 'json'
# General rules:
# - All the static parts of the expected URL are checked literally.
# - Each path component must begin with [\w], or a more restrictive character set.
# - Percent (`%`) shall not be allowed to avoid any percent encoding.
WINDOWS_VERSIONS_URLS_REGEXPS = [
%r{\A#{Regexp.escape 'https://github.com/oneclick/rubyinstaller/releases/download'}/\w[\w.-]*/\w[\w.-]*\z},
%r{\A#{Regexp.escape 'https://github.com/oneclick/rubyinstaller2/releases/download'}/\w[\w.-]*/\w[\w.-]*\z},
%r{\A#{Regexp.escape 'https://github.com/MSP-Greg/ruby-loco/releases/download'}/\w[\w.-]*/\w[\w.-]*\z}
].freeze
WINDOWS_TOOLCHAIN_VERSIONS_URLS_REGEXPS = [
%r{\A#{Regexp.escape 'https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'}\z},
%r{\A#{Regexp.escape 'https://github.com/ruby/setup-msys2-gcc/releases/download'}/\w[\w.-]*/\w[\w@.-]*\z},
%r{\A#{Regexp.escape 'https://github.com/ruby/setup-msys2-gcc/releases/latest/download'}/\w[\w@.-]*\z}
].freeze
# Validate all the URLs in the versions json
def validate(versions, allowed_urls_regexps)
versions.values.flat_map(&:values).each do |url|
if allowed_urls_regexps.none? { |regexp| regexp.match? url.to_s }
raise SecurityError, "Unexpected URL: #{url}"
end
end
end
min_requirements = ['~> 2.0.0', '~> 2.1.9', '>= 2.2.6'].map { |req| Gem::Requirement.new(req) }
url = 'https://raw.githubusercontent.com/oneclick/rubyinstaller.org-website/master/_data/downloads.yaml'
@@ -48,6 +73,7 @@ versions['ucrt'] = {
'x64' => 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
}
validate(versions, WINDOWS_VERSIONS_URLS_REGEXPS)
File.binwrite 'windows-versions.json', "#{JSON.pretty_generate(versions)}\n"
base_url = 'https://github.com/ruby/setup-msys2-gcc/releases/latest/download/windows-toolchain.json'
@@ -90,4 +116,5 @@ versions.each do |raw_version, archs|
end
end
validate(versions, WINDOWS_TOOLCHAIN_VERSIONS_URLS_REGEXPS)
File.binwrite 'windows-toolchain-versions.json', "#{JSON.pretty_generate(versions)}\n"
+2 -2
View File
@@ -11,11 +11,11 @@
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", "2.7.6", "2.7.7", "2.7.8",
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7",
"3.1.0-preview1", "3.1.0", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7",
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1", "3.2.0", "3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.2.9",
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1", "3.2.0", "3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.2.9", "3.2.10",
"3.3.0-preview1", "3.3.0-preview2", "3.3.0-preview3", "3.3.0-rc1", "3.3.0", "3.3.1", "3.3.2", "3.3.3", "3.3.4", "3.3.5", "3.3.6", "3.3.7", "3.3.8", "3.3.9", "3.3.10",
"3.4.0-preview1", "3.4.0-preview2", "3.4.0-rc1", "3.4.0", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8",
"3.5.0-preview1",
"4.0.0-preview2", "4.0.0-preview3", "4.0.0",
"4.0.0-preview2", "4.0.0-preview3", "4.0.0", "4.0.1",
"head", "debug", "asan", "asan-release"
],
"jruby": [
+7
View File
@@ -206,6 +206,9 @@
"3.2.9": {
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
},
"3.2.10": {
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
},
"3.3.0": {
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64-mingw-w64@r688-gcc@14.7z"
},
@@ -275,6 +278,10 @@
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
},
"4.0.1": {
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
},
"head": {
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
+7
View File
@@ -206,6 +206,9 @@
"3.2.9": {
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.9-1/rubyinstaller-3.2.9-1-x64.7z"
},
"3.2.10": {
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.10-1/rubyinstaller-3.2.10-1-x64.7z"
},
"3.3.0": {
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.0-1/rubyinstaller-3.3.0-1-x64.7z"
},
@@ -275,6 +278,10 @@
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.0-1/rubyinstaller-4.0.0-1-arm.7z",
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.0-1/rubyinstaller-4.0.0-1-x64.7z"
},
"4.0.1": {
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.1-1/rubyinstaller-4.0.1-1-arm.7z",
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.1-1/rubyinstaller-4.0.1-1-x64.7z"
},
"head": {
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-arm.7z",
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"