Store the available Ruby versions in this repository

* That way it's always perfectly synchronized with the action. In
  practice querying another repository sometimes returned a stale copy.
* Avoids an extra HTTPS request.
* The axios dependency is no longer needed.
* Makes it possible to tweak the versions available according to the platform.
This commit is contained in:
Benoit Daloze
2020-01-25 18:03:33 +01:00
parent 07160f610f
commit 3551d3fbd4
8 changed files with 73 additions and 3303 deletions
+3 -6
View File
@@ -3,16 +3,13 @@ const path = require('path')
const core = require('@actions/core')
const io = require('@actions/io')
const tc = require('@actions/tool-cache')
const axios = require('axios')
const rubyBuilderVersions = require('./ruby-install-builder-versions')
const builderReleaseTag = 'builds-newer-openssl'
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
const metadataURL = 'https://raw.githubusercontent.com/eregon/ruby-install-builder/metadata'
export async function getAvailableVersions(engine) {
const response = await axios.get(`${metadataURL}/versions.json`)
const versions = response.data
return versions[engine]
export function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine]
}
export async function install(platform, ruby) {