diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a094cd..7e73bd1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,14 +4,15 @@ on: [push, pull_request] jobs: build: - runs-on: macos-latest + runs-on: ${{ matrix.os }} strategy: matrix: - java-version: [17, 20, 21] + os: [macos-14, macos-12] # M1 and Intel + java-version: [17, 20, 21, 22] distribution: ['', '-community'] env: CASK_NAME: 'graalvm${{ matrix.distribution }}-jdk${{ matrix.java-version }}' - name: Test graalvm${{ matrix.distribution }}-jdk${{ matrix.java-version }}.rb + name: Test graalvm${{ matrix.distribution }}-jdk${{ matrix.java-version }}.rb on ${{ matrix.os }} steps: - name: Clone repository uses: actions/checkout@v4 diff --git a/Casks/graalvm-community-jdk22.rb b/Casks/graalvm-community-jdk22.rb new file mode 100644 index 0000000..4dbfaff --- /dev/null +++ b/Casks/graalvm-community-jdk22.rb @@ -0,0 +1,48 @@ +cask "graalvm-community-jdk22" do + arch arm: "aarch64", intel: "x64" + + version "22" + sha256 arm: "87b111900c5f78f919bb55103978d3b9ff44789140bb20be1c59abd23871cc86", + intel: "691b71450bcfea19eb5a3564f7a159072f9bd51a7a901e3a4775127da24a10d1" + + installation_dir = "graalvm-community-openjdk-#{version}+36.1".freeze + jvms_dir = "/Library/Java/JavaVirtualMachines".freeze + target_dir = "#{jvms_dir}/graalvm-community-openjdk-#{version.split(".").first}".freeze + + # github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask + url "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-#{version}.0.0/graalvm-community-jdk-#{version}.0.0_macos-#{arch}_bin.tar.gz" + name "GraalVM Community Edition for JDK 22" + homepage "https://www.graalvm.org/" + + artifact installation_dir, target: target_dir + + postflight do + # Correct symlink + macos_dir = "#{target_dir}/Contents/MacOS" + libjli_filename = "libjli.dylib" + libjli_path = "#{target_dir}/Contents/Home/lib/#{libjli_filename}" + libjli_symlink_path = "#{macos_dir}/#{libjli_filename}" + system_command "/bin/mkdir", args: ["-p", macos_dir], sudo: true + system_command "/bin/ln", args: ["-s", "-f", libjli_path, libjli_symlink_path], sudo: true + end + + caveats <<~EOS + Installing GraalVM CE for JDK 22 in #{jvms_dir} requires root permission. + You may be asked to enter your password to proceed. + + On macOS Catalina or later, you may get a warning when you use the GraalVM + installation for the first time. This warning can be disabled by running the + following command: + xattr -r -d com.apple.quarantine "#{target_dir}" + + To use GraalVM, you may want to change your $JAVA_HOME: + export JAVA_HOME="#{target_dir}/Contents/Home" + + or you may want to add its `bin` directory to your $PATH: + export PATH="#{target_dir}/Contents/Home/bin:$PATH" + + GraalVM CE is licensed under the GPL 2 with Classpath exception: + https://github.com/oracle/graal/blob/master/LICENSE + + EOS +end diff --git a/Casks/graalvm-jdk22.rb b/Casks/graalvm-jdk22.rb new file mode 100644 index 0000000..8c86034 --- /dev/null +++ b/Casks/graalvm-jdk22.rb @@ -0,0 +1,48 @@ +cask "graalvm-jdk22" do + arch arm: "aarch64", intel: "x64" + + version "22" + sha256 arm: "61632065cfcdc4e121362f1fd25a543955836bbacd6c1aadbcbe0d469d5ab8a3", + intel: "5b83f20dbc4c636ed41f19c3309f09839d4f5c6442dba986f460589c494a476c" + + installation_dir = "graalvm-jdk-#{version}+36.1".freeze + jvms_dir = "/Library/Java/JavaVirtualMachines".freeze + target_dir = "#{jvms_dir}/graalvm-jdk-#{version.split(".").first}".freeze + + # download.oracle.com was verified as official when first introduced to the cask + url "https://download.oracle.com/graalvm/22/archive/graalvm-jdk-#{version}_macos-#{arch}_bin.tar.gz" + name "Oracle GraalVM for JDK 22" + homepage "https://www.graalvm.org/" + + artifact installation_dir, target: target_dir + + postflight do + # Correct symlink + macos_dir = "#{target_dir}/Contents/MacOS" + libjli_filename = "libjli.dylib" + libjli_path = "#{target_dir}/Contents/Home/lib/#{libjli_filename}" + libjli_symlink_path = "#{macos_dir}/#{libjli_filename}" + system_command "/bin/mkdir", args: ["-p", macos_dir], sudo: true + system_command "/bin/ln", args: ["-s", "-f", libjli_path, libjli_symlink_path], sudo: true + end + + caveats <<~EOS + Installing Oracle GraalVM for JDK 22 in #{jvms_dir} requires root permission. + You may be asked to enter your password to proceed. + + On macOS Catalina or later, you may get a warning when you use the GraalVM + installation for the first time. This warning can be disabled by running the + following command: + xattr -r -d com.apple.quarantine "#{target_dir}" + + To use GraalVM, you may want to change your $JAVA_HOME: + export JAVA_HOME="#{target_dir}/Contents/Home" + + or you may want to add its `bin` directory to your $PATH: + export PATH="#{target_dir}/Contents/Home/bin:$PATH" + + Oracle GraalVM is licensed under the GraalVM Free Terms and Conditions: + https://www.oracle.com/downloads/licenses/graal-free-license.html + + EOS +end