From 0ec4904dc738052acf9fd5c1bffe0f98861d640f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 25 Sep 2024 21:02:29 +0200 Subject: [PATCH 1/4] Better error for TruffleRuby on Windows * Fixes https://github.com/ruby/setup-ruby/issues/619 --- dist/index.js | 2 ++ index.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dist/index.js b/dist/index.js index 2cc1a627f..d8e2eaa8c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -65924,6 +65924,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe - { os: macos-13, ruby: '2.5' } But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) + } else if (engine === 'truffleruby' && platform.startsWith('windows')) { + throw new Error('TruffleRuby does not currently support Windows.') } return version diff --git a/index.js b/index.js index 85d20f616..599109dd4 100644 --- a/index.js +++ b/index.js @@ -190,6 +190,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe - { os: macos-13, ruby: '2.5' } But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`) + } else if (engine === 'truffleruby' && platform.startsWith('windows')) { + throw new Error('TruffleRuby does not currently support Windows.') } return version From 5496baa6dba5302bd9cf85284f3648efa7e83552 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 25 Sep 2024 21:38:59 +0200 Subject: [PATCH 2/4] Update macos-release to 3.3.0 so it recognizes macos-15 --- dist/index.js | 1 + package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index d8e2eaa8c..61c20642e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -325,6 +325,7 @@ const external_node_os_namespaceObject = require("node:os"); const nameMap = new Map([ + [24, ['Sequoia', '15']], [23, ['Sonoma', '14']], [22, ['Ventura', '13']], [21, ['Monterey', '12']], diff --git a/package.json b/package.json index 8d3b30a75..64eecc674 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@actions/io": "^1.1.2", "@actions/tool-cache": "^2", "linux-os-info": "^2.0.0", - "macos-release": "^3.1.0", + "macos-release": "^3.3.0", "semver": "^7.3.7" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c9b970e7f..f6db23796 100644 --- a/yarn.lock +++ b/yarn.lock @@ -281,10 +281,10 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -macos-release@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-3.2.0.tgz#dcee82b6a4932971b1538dbf6f3aabc4a903b613" - integrity sha512-fSErXALFNsnowREYZ49XCdOHF8wOPWuFOGQrAhP7x5J/BqQv+B02cNsTykGpDgRVx43EKg++6ANmTaGTtW+hUA== +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: version "1.52.0" From 17f5c914a0f34a07ade5922ce062548d079b665b Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 25 Sep 2024 21:05:14 +0200 Subject: [PATCH 3/4] Add support for macos-15 and all future macos runners * Fixes https://github.com/ruby/setup-ruby/issues/647 --- .github/workflows/test.yml | 11 ++++- common.js | 87 ++++++++++++++++++++++++------------- dist/index.js | 89 +++++++++++++++++++++++++------------- 3 files changed, 127 insertions(+), 60 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36354f7b4..a32251621 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-13, macos-14, windows-2019, windows-2022 ] + os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-12, macos-13, macos-14, macos-15, windows-2019, windows-2022 ] ruby: [ '1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', ruby-head, jruby, jruby-head, @@ -35,7 +35,7 @@ jobs: - { os: ubuntu-22.04, ruby: '2.2' } - { os: ubuntu-24.04, ruby: '1.9' } - { os: ubuntu-24.04, ruby: '2.2' } - # These old Rubies fail to compile on macos-14 (macOS 14, arm64), which is used for ruby/ruby-builder + # These old Rubies fail to compile on macOS arm64 - { os: macos-14, ruby: '1.9' } - { os: macos-14, ruby: '2.0' } - { os: macos-14, ruby: '2.1' } @@ -43,6 +43,13 @@ jobs: - { os: macos-14, ruby: '2.3' } - { os: macos-14, ruby: '2.4' } - { os: macos-14, ruby: '2.5' } + - { os: macos-15, ruby: '1.9' } + - { os: macos-15, ruby: '2.0' } + - { os: macos-15, ruby: '2.1' } + - { os: macos-15, ruby: '2.2' } + - { os: macos-15, ruby: '2.3' } + - { os: macos-15, ruby: '2.4' } + - { os: macos-15, ruby: '2.5' } # Windows - { os: windows-2019, ruby: '1.9' } - { os: windows-2019, ruby: debug } diff --git a/common.js b/common.js index 61d0021d1..cd4dd2766 100644 --- a/common.js +++ b/common.js @@ -162,73 +162,103 @@ export async function hashFile(file) { return hash.digest('hex') } +// macos is not listed explicitly, see below const GitHubHostedPlatforms = [ 'ubuntu-20.04-x64', 'ubuntu-22.04-x64', 'ubuntu-24.04-x64', - 'macos-12-x64', - 'macos-13-x64', - 'macos-13-arm64', - 'macos-14-x64', - 'macos-14-arm64', 'windows-2019-x64', 'windows-2022-x64', ] +// Precisely: whether we have builds for that platform and there are GitHub-hosted runners to test it +function isSupportedPlatform() { + const platform = getOSName() + switch (platform) { + case 'ubuntu': + return GitHubHostedPlatforms.includes(getOSNameVersionArch()) + case 'macos': + // See https://github.com/ruby/ruby-builder/blob/master/README.md#naming + // 13 on arm64 because of old macos-arm-oss runners + return (os.arch() === 'x64' && parseInt(getOSVersion()) >= 12) || + (os.arch() === 'arm64' && parseInt(getOSVersion()) >= 13) + case 'windows': + return GitHubHostedPlatforms.includes(getOSNameVersionArch()) + } +} + // Actually a self-hosted runner for which the OS and OS version does not correspond to a GitHub-hosted runner image, export function isSelfHostedRunner() { if (inputs.selfHosted === undefined) { throw new Error('inputs.selfHosted should have been already set') } - return inputs.selfHosted === 'true' || - !GitHubHostedPlatforms.includes(getOSNameVersionArch()) + return inputs.selfHosted === 'true' || !isSupportedPlatform() } export function selfHostedRunnerReason() { if (inputs.selfHosted === 'true') { return 'the self-hosted input was set' - } else if (!GitHubHostedPlatforms.includes(getOSNameVersionArch())) { + } else if (!isSupportedPlatform()) { return 'the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported)' } else { return 'unknown reason' } } -let osNameVersion = undefined +let osName = undefined +let osVersion = undefined -export function getOSNameVersion() { - if (osNameVersion !== undefined) { - return osNameVersion +export function getOSName() { + if (osName !== undefined) { + return osName } const platform = os.platform() - let osName - let osVersion if (platform === 'linux') { const info = linuxOSInfo({mode: 'sync'}) osName = info.id - osVersion = info.version_id } else if (platform === 'darwin') { osName = 'macos' - osVersion = macosRelease().version } else if (platform === 'win32') { osName = 'windows' + } else { + throw new Error(`Unknown platform ${platform}`) + } + + return osName +} + +export function getOSVersion() { + if (osVersion !== undefined) { + return osVersion + } + + const platform = os.platform() + if (platform === 'linux') { + const info = linuxOSInfo({mode: 'sync'}) + osVersion = info.version_id + } else if (platform === 'darwin') { + osVersion = macosRelease().version + } else if (platform === 'win32') { osVersion = findWindowsVersion() } else { throw new Error(`Unknown platform ${platform}`) } - osNameVersion = `${osName}-${osVersion}` - return osNameVersion + return osVersion +} + +export function getOSNameVersion() { + return `${getOSName()}-${getOSVersion()}` } export function getOSNameVersionArch() { - return `${getOSNameVersion()}-${os.arch()}` + return `${getOSName()}-${getOSVersion()}-${os.arch()}` } function findWindowsVersion() { - const version = os.version(); + const version = os.version() const match = version.match(/^Windows Server (\d+) Datacenter/) if (match) { return match[1] @@ -261,15 +291,14 @@ export function getRunnerToolCache() { // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE function getDefaultToolCachePath() { - const platform = getOSNameVersion() - if (platform.startsWith('ubuntu-')) { - return '/opt/hostedtoolcache' - } else if (platform.startsWith('macos-')) { - return '/Users/runner/hostedtoolcache' - } else if (platform.startsWith('windows-')) { - return 'C:\\hostedtoolcache\\windows' - } else { - throw new Error('Unknown platform') + const platform = getOSName() + switch (platform) { + case 'ubuntu': + return '/opt/hostedtoolcache' + case 'macos': + return '/Users/runner/hostedtoolcache' + case 'windows': + return 'C:\\hostedtoolcache\\windows' } } diff --git a/dist/index.js b/dist/index.js index 61c20642e..c7c936f22 100644 --- a/dist/index.js +++ b/dist/index.js @@ -292,8 +292,10 @@ __nccwpck_require__.d(__webpack_exports__, { "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), "drive": () => (/* binding */ drive), "floatVersion": () => (/* binding */ floatVersion), + "getOSName": () => (/* binding */ getOSName), "getOSNameVersion": () => (/* binding */ getOSNameVersion), "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), + "getOSVersion": () => (/* binding */ getOSVersion), "getRunnerToolCache": () => (/* binding */ getRunnerToolCache), "getToolCachePath": () => (/* binding */ getToolCachePath), "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix), @@ -523,73 +525,103 @@ async function hashFile(file) { return hash.digest('hex') } +// macos is not listed explicitly, see below const GitHubHostedPlatforms = [ 'ubuntu-20.04-x64', 'ubuntu-22.04-x64', 'ubuntu-24.04-x64', - 'macos-12-x64', - 'macos-13-x64', - 'macos-13-arm64', - 'macos-14-x64', - 'macos-14-arm64', 'windows-2019-x64', 'windows-2022-x64', ] +// Precisely: whether we have builds for that platform and there are GitHub-hosted runners to test it +function isSupportedPlatform() { + const platform = getOSName() + switch (platform) { + case 'ubuntu': + return GitHubHostedPlatforms.includes(getOSNameVersionArch()) + case 'macos': + // See https://github.com/ruby/ruby-builder/blob/master/README.md#naming + // 13 on arm64 because of old macos-arm-oss runners + return (os.arch() === 'x64' && parseInt(getOSVersion()) >= 12) || + (os.arch() === 'arm64' && parseInt(getOSVersion()) >= 13) + case 'windows': + return GitHubHostedPlatforms.includes(getOSNameVersionArch()) + } +} + // Actually a self-hosted runner for which the OS and OS version does not correspond to a GitHub-hosted runner image, function isSelfHostedRunner() { if (inputs.selfHosted === undefined) { throw new Error('inputs.selfHosted should have been already set') } - return inputs.selfHosted === 'true' || - !GitHubHostedPlatforms.includes(getOSNameVersionArch()) + return inputs.selfHosted === 'true' || !isSupportedPlatform() } function selfHostedRunnerReason() { if (inputs.selfHosted === 'true') { return 'the self-hosted input was set' - } else if (!GitHubHostedPlatforms.includes(getOSNameVersionArch())) { + } else if (!isSupportedPlatform()) { return 'the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported)' } else { return 'unknown reason' } } -let osNameVersion = undefined +let osName = undefined +let osVersion = undefined -function getOSNameVersion() { - if (osNameVersion !== undefined) { - return osNameVersion +function getOSName() { + if (osName !== undefined) { + return osName } const platform = os.platform() - let osName - let osVersion if (platform === 'linux') { const info = linuxOSInfo({mode: 'sync'}) osName = info.id - osVersion = info.version_id } else if (platform === 'darwin') { osName = 'macos' - osVersion = macosRelease().version } else if (platform === 'win32') { osName = 'windows' + } else { + throw new Error(`Unknown platform ${platform}`) + } + + return osName +} + +function getOSVersion() { + if (osVersion !== undefined) { + return osVersion + } + + const platform = os.platform() + if (platform === 'linux') { + const info = linuxOSInfo({mode: 'sync'}) + osVersion = info.version_id + } else if (platform === 'darwin') { + osVersion = macosRelease().version + } else if (platform === 'win32') { osVersion = findWindowsVersion() } else { throw new Error(`Unknown platform ${platform}`) } - osNameVersion = `${osName}-${osVersion}` - return osNameVersion + return osVersion +} + +function getOSNameVersion() { + return `${getOSName()}-${getOSVersion()}` } function getOSNameVersionArch() { - return `${getOSNameVersion()}-${os.arch()}` + return `${getOSName()}-${getOSVersion()}-${os.arch()}` } function findWindowsVersion() { - const version = os.version(); + const version = os.version() const match = version.match(/^Windows Server (\d+) Datacenter/) if (match) { return match[1] @@ -622,15 +654,14 @@ function getRunnerToolCache() { // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE function getDefaultToolCachePath() { - const platform = getOSNameVersion() - if (platform.startsWith('ubuntu-')) { - return '/opt/hostedtoolcache' - } else if (platform.startsWith('macos-')) { - return '/Users/runner/hostedtoolcache' - } else if (platform.startsWith('windows-')) { - return 'C:\\hostedtoolcache\\windows' - } else { - throw new Error('Unknown platform') + const platform = getOSName() + switch (platform) { + case 'ubuntu': + return '/opt/hostedtoolcache' + case 'macos': + return '/Users/runner/hostedtoolcache' + case 'windows': + return 'C:\\hostedtoolcache\\windows' } } From c04af2bb7258bb6a03df1d3c1865998ac9390972 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 25 Sep 2024 21:44:19 +0200 Subject: [PATCH 4/4] Replace macos-release by (parseInt(os.version()) - 9) * That way we don't need to update that dependency to work with newer macOS releases. --- common.js | 5 +- dist/index.js | 129 +++++++++++++++++--------------------------------- package.json | 1 - yarn.lock | 5 -- 4 files changed, 46 insertions(+), 94 deletions(-) diff --git a/common.js b/common.js index cd4dd2766..4a5d0e904 100644 --- a/common.js +++ b/common.js @@ -8,7 +8,6 @@ const core = require('@actions/core') const tc = require('@actions/tool-cache') const { performance } = require('perf_hooks') const linuxOSInfo = require('linux-os-info') -import macosRelease from 'macos-release' export const windows = (os.platform() === 'win32') // 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'}) osVersion = info.version_id } 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') { osVersion = findWindowsVersion() } else { diff --git a/dist/index.js b/dist/index.js index c7c936f22..75893a5b3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -17,7 +17,7 @@ const path = __nccwpck_require__(1017) const core = __nccwpck_require__(2186) const exec = __nccwpck_require__(1514) const cache = __nccwpck_require__(7799) -const common = __nccwpck_require__(3143) +const common = __nccwpck_require__(4717) 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__) => { "use strict"; -// ESM COMPAT FLAG __nccwpck_require__.r(__webpack_exports__); - -// EXPORTS -__nccwpck_require__.d(__webpack_exports__, { - "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), - "drive": () => (/* binding */ drive), - "floatVersion": () => (/* binding */ floatVersion), - "getOSName": () => (/* binding */ getOSName), - "getOSNameVersion": () => (/* binding */ getOSNameVersion), - "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), - "getOSVersion": () => (/* binding */ getOSVersion), - "getRunnerToolCache": () => (/* binding */ getRunnerToolCache), - "getToolCachePath": () => (/* binding */ getToolCachePath), - "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix), - "hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem), - "hashFile": () => (/* binding */ hashFile), - "inputs": () => (/* binding */ inputs), - "isBundler1Default": () => (/* binding */ isBundler1Default), - "isBundler2Default": () => (/* binding */ isBundler2Default), - "isBundler2dot2Default": () => (/* binding */ isBundler2dot2Default), - "isHeadVersion": () => (/* binding */ isHeadVersion), - "isSelfHostedRunner": () => (/* binding */ isSelfHostedRunner), - "isStableVersion": () => (/* binding */ isStableVersion), - "measure": () => (/* binding */ measure), - "partition": () => (/* binding */ partition), - "selfHostedRunnerReason": () => (/* binding */ selfHostedRunnerReason), - "setupPath": () => (/* binding */ setupPath), - "shouldUseToolCache": () => (/* binding */ shouldUseToolCache), - "targetRubyVersion": () => (/* binding */ targetRubyVersion), - "time": () => (/* binding */ time), - "toolCacheCompleteFile": () => (/* binding */ toolCacheCompleteFile), - "toolCacheFind": () => (/* binding */ toolCacheFind), - "win2nix": () => (/* binding */ win2nix), - "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 +/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { +/* harmony export */ "windows": () => (/* binding */ windows), +/* harmony export */ "drive": () => (/* binding */ drive), +/* harmony export */ "inputs": () => (/* binding */ inputs), +/* harmony export */ "partition": () => (/* binding */ partition), +/* harmony export */ "measure": () => (/* binding */ measure), +/* harmony export */ "time": () => (/* binding */ time), +/* harmony export */ "isHeadVersion": () => (/* binding */ isHeadVersion), +/* harmony export */ "isStableVersion": () => (/* binding */ isStableVersion), +/* harmony export */ "hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem), +/* harmony export */ "isBundler1Default": () => (/* binding */ isBundler1Default), +/* harmony export */ "isBundler2Default": () => (/* binding */ isBundler2Default), +/* harmony export */ "isBundler2dot2Default": () => (/* binding */ isBundler2dot2Default), +/* harmony export */ "targetRubyVersion": () => (/* binding */ targetRubyVersion), +/* harmony export */ "floatVersion": () => (/* binding */ floatVersion), +/* harmony export */ "hashFile": () => (/* binding */ hashFile), +/* harmony export */ "isSelfHostedRunner": () => (/* binding */ isSelfHostedRunner), +/* harmony export */ "selfHostedRunnerReason": () => (/* binding */ selfHostedRunnerReason), +/* harmony export */ "getOSName": () => (/* binding */ getOSName), +/* harmony export */ "getOSVersion": () => (/* binding */ getOSVersion), +/* harmony export */ "getOSNameVersion": () => (/* binding */ getOSNameVersion), +/* harmony export */ "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), +/* harmony export */ "shouldUseToolCache": () => (/* binding */ shouldUseToolCache), +/* harmony export */ "getToolCachePath": () => (/* binding */ getToolCachePath), +/* harmony export */ "getRunnerToolCache": () => (/* binding */ getRunnerToolCache), +/* harmony export */ "toolCacheFind": () => (/* binding */ toolCacheFind), +/* harmony export */ "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix), +/* harmony export */ "toolCacheCompleteFile": () => (/* binding */ toolCacheCompleteFile), +/* harmony export */ "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), +/* harmony export */ "win2nix": () => (/* binding */ win2nix), +/* harmony export */ "setupPath": () => (/* binding */ setupPath) +/* harmony export */ }); const os = __nccwpck_require__(2037) const path = __nccwpck_require__(1017) const fs = __nccwpck_require__(7147) const util = __nccwpck_require__(3837) const stream = __nccwpck_require__(2781) -const common_crypto = __nccwpck_require__(6113) +const crypto = __nccwpck_require__(6113) const core = __nccwpck_require__(2186) const tc = __nccwpck_require__(7784) const { performance } = __nccwpck_require__(4074) const linuxOSInfo = __nccwpck_require__(8487) -; const windows = (os.platform() === 'win32') // 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) { // 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) await pipeline(fs.createReadStream(file), hash) return hash.digest('hex') @@ -602,7 +557,9 @@ function getOSVersion() { const info = linuxOSInfo({mode: 'sync'}) osVersion = info.version_id } 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') { osVersion = findWindowsVersion() } else { @@ -64993,7 +64950,7 @@ const core = __nccwpck_require__(2186) const exec = __nccwpck_require__(1514) const io = __nccwpck_require__(7436) const tc = __nccwpck_require__(7784) -const common = __nccwpck_require__(3143) +const common = __nccwpck_require__(4717) const rubyBuilderVersions = __nccwpck_require__(5959) const builderReleaseTag = 'toolcache' @@ -65122,7 +65079,7 @@ __nccwpck_require__.r(__webpack_exports__); /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "rubygemsUpdate": () => (/* binding */ rubygemsUpdate) /* harmony export */ }); -const common = __nccwpck_require__(3143) +const common = __nccwpck_require__(4717) const path = __nccwpck_require__(1017) const exec = __nccwpck_require__(1514) const semver = __nccwpck_require__(1383) @@ -65207,7 +65164,7 @@ const core = __nccwpck_require__(2186) const exec = __nccwpck_require__(1514) const io = __nccwpck_require__(7436) const tc = __nccwpck_require__(7784) -const common = __nccwpck_require__(3143) +const common = __nccwpck_require__(4717) const rubyInstallerVersions = __nccwpck_require__(6459) const drive = common.drive @@ -65769,7 +65726,7 @@ const fs = __nccwpck_require__(7147) const path = __nccwpck_require__(1017) const core = __nccwpck_require__(2186) const exec = __nccwpck_require__(1514) -const common = __nccwpck_require__(3143) +const common = __nccwpck_require__(4717) const rubygems = __nccwpck_require__(160) const bundler = __nccwpck_require__(1641) diff --git a/package.json b/package.json index 64eecc674..016861d3f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "@actions/io": "^1.1.2", "@actions/tool-cache": "^2", "linux-os-info": "^2.0.0", - "macos-release": "^3.3.0", "semver": "^7.3.7" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index f6db23796..07a6a4cba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -281,11 +281,6 @@ lru-cache@^6.0.0: dependencies: 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: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"