From a7439cf424c9677922eee7cb72a848b9fd7fb3ff Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 16 May 2022 11:51:26 +0200 Subject: [PATCH] Add support for macos-12 --- .github/workflows/test.yml | 2 +- README.md | 4 ++-- common.js | 9 +++++++-- dist/index.js | 9 +++++++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c79cfc..822cb26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2019, windows-2022 ] + os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, macos-12, 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', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, truffleruby+graalvm, truffleruby+graalvm-head ] include: - { os: ubuntu-22.04, ruby: '3.1.0' } diff --git a/README.md b/README.md index ae2c87b..8bcb48b 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ The action works on these [GitHub-hosted runners](https://help.github.com/en/act | Operating System | Recommended | Other Supported Versions | | ----------- | -------- | -------- | -| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04` | -| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` | +| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-22.04` (beta, only `ruby: 3.1 - head`) | +| macOS | `macos-latest` (= `macos-11`) | `macos-10.15`, `macos-12` (beta) | | Windows | `windows-latest` (= `windows-2022`) | `windows-2019` | On `ubuntu-22.04` (beta), only `ruby: 3.1 - head` are supported, due to Ubuntu 22.04 only supporting OpenSSL 3. diff --git a/common.js b/common.js index 7a0d21f..0c87a76 100644 --- a/common.js +++ b/common.js @@ -103,7 +103,8 @@ export const supportedPlatforms = [ 'ubuntu-20.04', 'ubuntu-22.04', 'macos-10.15', - 'macos-11.0', + 'macos-11', + 'macos-12', 'windows-2019', 'windows-2022', ] @@ -118,7 +119,11 @@ export function getVirtualEnvironmentName() { match = imageOS.match(/^macos(\d{2})(\d+)?/) // e.g. macos1015, macos11 if (match) { - return `macos-${match[1]}.${match[2] || '0'}` + if (match[2]) { + return `macos-${match[1]}.${match[2]}` + } else { + return `macos-${match[1]}` + } } match = imageOS.match(/^win(\d+)/) // e.g. win19 diff --git a/dist/index.js b/dist/index.js index 452b154..744deae 100644 --- a/dist/index.js +++ b/dist/index.js @@ -372,7 +372,8 @@ const supportedPlatforms = [ 'ubuntu-20.04', 'ubuntu-22.04', 'macos-10.15', - 'macos-11.0', + 'macos-11', + 'macos-12', 'windows-2019', 'windows-2022', ] @@ -387,7 +388,11 @@ function getVirtualEnvironmentName() { match = imageOS.match(/^macos(\d{2})(\d+)?/) // e.g. macos1015, macos11 if (match) { - return `macos-${match[1]}.${match[2] || '0'}` + if (match[2]) { + return `macos-${match[1]}.${match[2]}` + } else { + return `macos-${match[1]}` + } } match = imageOS.match(/^win(\d+)/) // e.g. win19