mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Replace macos-release by (parseInt(os.version()) - 9)
* That way we don't need to update that dependency to work with newer macOS releases.
This commit is contained in:
@@ -8,7 +8,6 @@ const core = require('@actions/core')
|
|||||||
const tc = require('@actions/tool-cache')
|
const tc = require('@actions/tool-cache')
|
||||||
const { performance } = require('perf_hooks')
|
const { performance } = require('perf_hooks')
|
||||||
const linuxOSInfo = require('linux-os-info')
|
const linuxOSInfo = require('linux-os-info')
|
||||||
import macosRelease from 'macos-release'
|
|
||||||
|
|
||||||
export const windows = (os.platform() === 'win32')
|
export const windows = (os.platform() === 'win32')
|
||||||
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
@@ -239,7 +238,9 @@ export function getOSVersion() {
|
|||||||
const info = linuxOSInfo({mode: 'sync'})
|
const info = linuxOSInfo({mode: 'sync'})
|
||||||
osVersion = info.version_id
|
osVersion = info.version_id
|
||||||
} else if (platform === 'darwin') {
|
} else if (platform === 'darwin') {
|
||||||
osVersion = macosRelease().version
|
// See https://github.com/sindresorhus/macos-release/blob/main/index.js
|
||||||
|
const darwinVersion = parseInt(os.release().match(/^\d+/)[0])
|
||||||
|
osVersion = `${darwinVersion - 9}`
|
||||||
} else if (platform === 'win32') {
|
} else if (platform === 'win32') {
|
||||||
osVersion = findWindowsVersion()
|
osVersion = findWindowsVersion()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+43
-86
@@ -17,7 +17,7 @@ const path = __nccwpck_require__(1017)
|
|||||||
const core = __nccwpck_require__(2186)
|
const core = __nccwpck_require__(2186)
|
||||||
const exec = __nccwpck_require__(1514)
|
const exec = __nccwpck_require__(1514)
|
||||||
const cache = __nccwpck_require__(7799)
|
const cache = __nccwpck_require__(7799)
|
||||||
const common = __nccwpck_require__(3143)
|
const common = __nccwpck_require__(4717)
|
||||||
|
|
||||||
const DEFAULT_CACHE_VERSION = '0'
|
const DEFAULT_CACHE_VERSION = '0'
|
||||||
|
|
||||||
@@ -280,98 +280,53 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 3143:
|
/***/ 4717:
|
||||||
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
// ESM COMPAT FLAG
|
|
||||||
__nccwpck_require__.r(__webpack_exports__);
|
__nccwpck_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
||||||
// EXPORTS
|
/* harmony export */ "windows": () => (/* binding */ windows),
|
||||||
__nccwpck_require__.d(__webpack_exports__, {
|
/* harmony export */ "drive": () => (/* binding */ drive),
|
||||||
"createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile),
|
/* harmony export */ "inputs": () => (/* binding */ inputs),
|
||||||
"drive": () => (/* binding */ drive),
|
/* harmony export */ "partition": () => (/* binding */ partition),
|
||||||
"floatVersion": () => (/* binding */ floatVersion),
|
/* harmony export */ "measure": () => (/* binding */ measure),
|
||||||
"getOSName": () => (/* binding */ getOSName),
|
/* harmony export */ "time": () => (/* binding */ time),
|
||||||
"getOSNameVersion": () => (/* binding */ getOSNameVersion),
|
/* harmony export */ "isHeadVersion": () => (/* binding */ isHeadVersion),
|
||||||
"getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch),
|
/* harmony export */ "isStableVersion": () => (/* binding */ isStableVersion),
|
||||||
"getOSVersion": () => (/* binding */ getOSVersion),
|
/* harmony export */ "hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem),
|
||||||
"getRunnerToolCache": () => (/* binding */ getRunnerToolCache),
|
/* harmony export */ "isBundler1Default": () => (/* binding */ isBundler1Default),
|
||||||
"getToolCachePath": () => (/* binding */ getToolCachePath),
|
/* harmony export */ "isBundler2Default": () => (/* binding */ isBundler2Default),
|
||||||
"getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix),
|
/* harmony export */ "isBundler2dot2Default": () => (/* binding */ isBundler2dot2Default),
|
||||||
"hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem),
|
/* harmony export */ "targetRubyVersion": () => (/* binding */ targetRubyVersion),
|
||||||
"hashFile": () => (/* binding */ hashFile),
|
/* harmony export */ "floatVersion": () => (/* binding */ floatVersion),
|
||||||
"inputs": () => (/* binding */ inputs),
|
/* harmony export */ "hashFile": () => (/* binding */ hashFile),
|
||||||
"isBundler1Default": () => (/* binding */ isBundler1Default),
|
/* harmony export */ "isSelfHostedRunner": () => (/* binding */ isSelfHostedRunner),
|
||||||
"isBundler2Default": () => (/* binding */ isBundler2Default),
|
/* harmony export */ "selfHostedRunnerReason": () => (/* binding */ selfHostedRunnerReason),
|
||||||
"isBundler2dot2Default": () => (/* binding */ isBundler2dot2Default),
|
/* harmony export */ "getOSName": () => (/* binding */ getOSName),
|
||||||
"isHeadVersion": () => (/* binding */ isHeadVersion),
|
/* harmony export */ "getOSVersion": () => (/* binding */ getOSVersion),
|
||||||
"isSelfHostedRunner": () => (/* binding */ isSelfHostedRunner),
|
/* harmony export */ "getOSNameVersion": () => (/* binding */ getOSNameVersion),
|
||||||
"isStableVersion": () => (/* binding */ isStableVersion),
|
/* harmony export */ "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch),
|
||||||
"measure": () => (/* binding */ measure),
|
/* harmony export */ "shouldUseToolCache": () => (/* binding */ shouldUseToolCache),
|
||||||
"partition": () => (/* binding */ partition),
|
/* harmony export */ "getToolCachePath": () => (/* binding */ getToolCachePath),
|
||||||
"selfHostedRunnerReason": () => (/* binding */ selfHostedRunnerReason),
|
/* harmony export */ "getRunnerToolCache": () => (/* binding */ getRunnerToolCache),
|
||||||
"setupPath": () => (/* binding */ setupPath),
|
/* harmony export */ "toolCacheFind": () => (/* binding */ toolCacheFind),
|
||||||
"shouldUseToolCache": () => (/* binding */ shouldUseToolCache),
|
/* harmony export */ "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix),
|
||||||
"targetRubyVersion": () => (/* binding */ targetRubyVersion),
|
/* harmony export */ "toolCacheCompleteFile": () => (/* binding */ toolCacheCompleteFile),
|
||||||
"time": () => (/* binding */ time),
|
/* harmony export */ "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile),
|
||||||
"toolCacheCompleteFile": () => (/* binding */ toolCacheCompleteFile),
|
/* harmony export */ "win2nix": () => (/* binding */ win2nix),
|
||||||
"toolCacheFind": () => (/* binding */ toolCacheFind),
|
/* harmony export */ "setupPath": () => (/* binding */ setupPath)
|
||||||
"win2nix": () => (/* binding */ win2nix),
|
/* harmony export */ });
|
||||||
"windows": () => (/* binding */ windows)
|
|
||||||
});
|
|
||||||
|
|
||||||
;// CONCATENATED MODULE: external "node:os"
|
|
||||||
const external_node_os_namespaceObject = require("node:os");
|
|
||||||
;// CONCATENATED MODULE: ./node_modules/macos-release/index.js
|
|
||||||
|
|
||||||
|
|
||||||
const nameMap = new Map([
|
|
||||||
[24, ['Sequoia', '15']],
|
|
||||||
[23, ['Sonoma', '14']],
|
|
||||||
[22, ['Ventura', '13']],
|
|
||||||
[21, ['Monterey', '12']],
|
|
||||||
[20, ['Big Sur', '11']],
|
|
||||||
[19, ['Catalina', '10.15']],
|
|
||||||
[18, ['Mojave', '10.14']],
|
|
||||||
[17, ['High Sierra', '10.13']],
|
|
||||||
[16, ['Sierra', '10.12']],
|
|
||||||
[15, ['El Capitan', '10.11']],
|
|
||||||
[14, ['Yosemite', '10.10']],
|
|
||||||
[13, ['Mavericks', '10.9']],
|
|
||||||
[12, ['Mountain Lion', '10.8']],
|
|
||||||
[11, ['Lion', '10.7']],
|
|
||||||
[10, ['Snow Leopard', '10.6']],
|
|
||||||
[9, ['Leopard', '10.5']],
|
|
||||||
[8, ['Tiger', '10.4']],
|
|
||||||
[7, ['Panther', '10.3']],
|
|
||||||
[6, ['Jaguar', '10.2']],
|
|
||||||
[5, ['Puma', '10.1']],
|
|
||||||
]);
|
|
||||||
|
|
||||||
function macosRelease(release) {
|
|
||||||
release = Number((release || external_node_os_namespaceObject.release()).split('.')[0]);
|
|
||||||
|
|
||||||
const [name, version] = nameMap.get(release) || ['Unknown', ''];
|
|
||||||
|
|
||||||
return {
|
|
||||||
name,
|
|
||||||
version,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
;// CONCATENATED MODULE: ./common.js
|
|
||||||
const os = __nccwpck_require__(2037)
|
const os = __nccwpck_require__(2037)
|
||||||
const path = __nccwpck_require__(1017)
|
const path = __nccwpck_require__(1017)
|
||||||
const fs = __nccwpck_require__(7147)
|
const fs = __nccwpck_require__(7147)
|
||||||
const util = __nccwpck_require__(3837)
|
const util = __nccwpck_require__(3837)
|
||||||
const stream = __nccwpck_require__(2781)
|
const stream = __nccwpck_require__(2781)
|
||||||
const common_crypto = __nccwpck_require__(6113)
|
const crypto = __nccwpck_require__(6113)
|
||||||
const core = __nccwpck_require__(2186)
|
const core = __nccwpck_require__(2186)
|
||||||
const tc = __nccwpck_require__(7784)
|
const tc = __nccwpck_require__(7784)
|
||||||
const { performance } = __nccwpck_require__(4074)
|
const { performance } = __nccwpck_require__(4074)
|
||||||
const linuxOSInfo = __nccwpck_require__(8487)
|
const linuxOSInfo = __nccwpck_require__(8487)
|
||||||
;
|
|
||||||
|
|
||||||
const windows = (os.platform() === 'win32')
|
const windows = (os.platform() === 'win32')
|
||||||
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
@@ -519,7 +474,7 @@ function floatVersion(rubyVersion) {
|
|||||||
|
|
||||||
async function hashFile(file) {
|
async function hashFile(file) {
|
||||||
// See https://github.com/actions/runner/blob/master/src/Misc/expressionFunc/hashFiles/src/hashFiles.ts
|
// See https://github.com/actions/runner/blob/master/src/Misc/expressionFunc/hashFiles/src/hashFiles.ts
|
||||||
const hash = common_crypto.createHash('sha256')
|
const hash = crypto.createHash('sha256')
|
||||||
const pipeline = util.promisify(stream.pipeline)
|
const pipeline = util.promisify(stream.pipeline)
|
||||||
await pipeline(fs.createReadStream(file), hash)
|
await pipeline(fs.createReadStream(file), hash)
|
||||||
return hash.digest('hex')
|
return hash.digest('hex')
|
||||||
@@ -602,7 +557,9 @@ function getOSVersion() {
|
|||||||
const info = linuxOSInfo({mode: 'sync'})
|
const info = linuxOSInfo({mode: 'sync'})
|
||||||
osVersion = info.version_id
|
osVersion = info.version_id
|
||||||
} else if (platform === 'darwin') {
|
} else if (platform === 'darwin') {
|
||||||
osVersion = macosRelease().version
|
// See https://github.com/sindresorhus/macos-release/blob/main/index.js
|
||||||
|
const darwinVersion = parseInt(os.release().match(/^\d+/)[0])
|
||||||
|
osVersion = `${darwinVersion - 9}`
|
||||||
} else if (platform === 'win32') {
|
} else if (platform === 'win32') {
|
||||||
osVersion = findWindowsVersion()
|
osVersion = findWindowsVersion()
|
||||||
} else {
|
} else {
|
||||||
@@ -64993,7 +64950,7 @@ const core = __nccwpck_require__(2186)
|
|||||||
const exec = __nccwpck_require__(1514)
|
const exec = __nccwpck_require__(1514)
|
||||||
const io = __nccwpck_require__(7436)
|
const io = __nccwpck_require__(7436)
|
||||||
const tc = __nccwpck_require__(7784)
|
const tc = __nccwpck_require__(7784)
|
||||||
const common = __nccwpck_require__(3143)
|
const common = __nccwpck_require__(4717)
|
||||||
const rubyBuilderVersions = __nccwpck_require__(5959)
|
const rubyBuilderVersions = __nccwpck_require__(5959)
|
||||||
|
|
||||||
const builderReleaseTag = 'toolcache'
|
const builderReleaseTag = 'toolcache'
|
||||||
@@ -65122,7 +65079,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
||||||
/* harmony export */ "rubygemsUpdate": () => (/* binding */ rubygemsUpdate)
|
/* harmony export */ "rubygemsUpdate": () => (/* binding */ rubygemsUpdate)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
const common = __nccwpck_require__(3143)
|
const common = __nccwpck_require__(4717)
|
||||||
const path = __nccwpck_require__(1017)
|
const path = __nccwpck_require__(1017)
|
||||||
const exec = __nccwpck_require__(1514)
|
const exec = __nccwpck_require__(1514)
|
||||||
const semver = __nccwpck_require__(1383)
|
const semver = __nccwpck_require__(1383)
|
||||||
@@ -65207,7 +65164,7 @@ const core = __nccwpck_require__(2186)
|
|||||||
const exec = __nccwpck_require__(1514)
|
const exec = __nccwpck_require__(1514)
|
||||||
const io = __nccwpck_require__(7436)
|
const io = __nccwpck_require__(7436)
|
||||||
const tc = __nccwpck_require__(7784)
|
const tc = __nccwpck_require__(7784)
|
||||||
const common = __nccwpck_require__(3143)
|
const common = __nccwpck_require__(4717)
|
||||||
const rubyInstallerVersions = __nccwpck_require__(6459)
|
const rubyInstallerVersions = __nccwpck_require__(6459)
|
||||||
|
|
||||||
const drive = common.drive
|
const drive = common.drive
|
||||||
@@ -65769,7 +65726,7 @@ const fs = __nccwpck_require__(7147)
|
|||||||
const path = __nccwpck_require__(1017)
|
const path = __nccwpck_require__(1017)
|
||||||
const core = __nccwpck_require__(2186)
|
const core = __nccwpck_require__(2186)
|
||||||
const exec = __nccwpck_require__(1514)
|
const exec = __nccwpck_require__(1514)
|
||||||
const common = __nccwpck_require__(3143)
|
const common = __nccwpck_require__(4717)
|
||||||
const rubygems = __nccwpck_require__(160)
|
const rubygems = __nccwpck_require__(160)
|
||||||
const bundler = __nccwpck_require__(1641)
|
const bundler = __nccwpck_require__(1641)
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
"@actions/io": "^1.1.2",
|
"@actions/io": "^1.1.2",
|
||||||
"@actions/tool-cache": "^2",
|
"@actions/tool-cache": "^2",
|
||||||
"linux-os-info": "^2.0.0",
|
"linux-os-info": "^2.0.0",
|
||||||
"macos-release": "^3.3.0",
|
|
||||||
"semver": "^7.3.7"
|
"semver": "^7.3.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -281,11 +281,6 @@ lru-cache@^6.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
yallist "^4.0.0"
|
yallist "^4.0.0"
|
||||||
|
|
||||||
macos-release@^3.3.0:
|
|
||||||
version "3.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-3.3.0.tgz#92cb67bc66d67c3fde4a9e14f5f909afa418b072"
|
|
||||||
integrity sha512-tPJQ1HeyiU2vRruNGhZ+VleWuMQRro8iFtJxYgnS4NQe+EukKF6aGiIT+7flZhISAt2iaXBCfFGvAyif7/f8nQ==
|
|
||||||
|
|
||||||
mime-db@1.52.0:
|
mime-db@1.52.0:
|
||||||
version "1.52.0"
|
version "1.52.0"
|
||||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
|
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
|
||||||
|
|||||||
Reference in New Issue
Block a user