sormuras / download-jdk

FUP2 https://github.com/oracle-actions/setup-java

Home Page:https://github.com/oracle-actions/setup-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Mac OS

sormuras opened this issue · comments

@joschi -- what about, as quick & dirty work-around that will stay forever, repackaging the .tar.gz downloaded from java.net to conform the expectations of actions/setup-java?

That would certainly be possible, but I'm not sure that you would want to maintain this.

There's a new type of action: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/creating-a-composite-run-steps-action

Composite run steps actions
A composite run steps action allows you to combine multiple workflow run steps within one action. For example, you can use this feature to bundle together multiple run commands into an action, and then have a workflow that executes the bundled commands a single step using that action.

As this action type is supported on all platforms, I consider porting this action from JavaScript to "composite-run-steps".

Mac OS archive loaded from https://jdk.java.net/16

  • openjdk-16-ea+19_osx-x64_bin.tar.gz
  • openjdk-16-ea+19_osx-x64_bin.tar
  • .
  • jdk-16.jdk
  • Contents
  • Home
  • bin/java

Mac OS archive loaded from https://www.azul.com/downloads/zulu-community and supported by actions/setup-java

  • zulu16.0.39-ea-jdk16.0.0-ea.18-macosx_x64.tar.gz
  • zulu16.0.39-ea-jdk16.0.0-ea.18-macosx_x64.tar
  • zulu16.0.39-ea-jdk16.0.0-ea.18-macosx_x64
  • bin/java
        if [ "$RUNNER_OS" == "macOS" ]; then
          JDK_EXTRACTED=${HOME}/downloaded-jdk-${{ inputs.feature }}
          mkdir ${JDK_EXTRACTED}
          tar --extract --file ${JDK_FILE} -C ${JDK_EXTRACTED} --strip-components 4
          rm ${JDK_FILE}
          tar --create --file ${JDK_FILE} -C ${HOME} downloaded-jdk-${{ inputs.feature }}          
        fi

Seems to work: https://github.com/sormuras/download-jdk/runs/1230435109?check_suite_focus=true#step:3:1

Almost!

On Mac OS and Java 9..13 the setup-java actions errors with:

Error: no such file or directory: /Users/runner/work/_temp/temp_241785471/downloaded-jdk-13/libjli.dylib

image

Due to...

image