name: JDK

on:
  push:
    paths:
    - '.github/workflows/jdks.yml'

jobs:

  jdk-15-ea:
    runs-on: ubuntu-latest
    steps:
    - run: wget -q https://download.java.net/java/early_access/jdk15/1/GPL/openjdk-15-ea+1_linux-x64_bin.tar.gz --output-document jdk.tar.gz
    - uses: actions/setup-java@v1
      with:
        java-version: '15-ea'
        jdkFile: jdk.tar.gz
    - run: java -version

  jdk-14-ea:
    runs-on: ubuntu-latest
    steps:
    - run: |
        mkdir .jdk
        wget https://github.com/docker-library/openjdk/raw/master/14/jdk/Dockerfile --output-document .jdk/Dockerfile14
        wget $(cat .jdk/Dockerfile14 | sed -n 's/ENV JAVA_URL //p') --output-document .jdk/jdk.tar.gz
        echo ::set-env name=JAVA_VERSION::$(cat .jdk/Dockerfile14 | sed -n 's/ENV JAVA_VERSION //p')
    - uses: actions/setup-java@v1
      with:
        java-version: '14-ea'
        jdkFile: .jdk/jdk.tar.gz
    - run: java -version

name: JDK

on:
  push:
    paths:
    - '.github/workflows/jdks.yml'

jobs:

  jdk-15-ea:
    runs-on: ubuntu-latest
    steps:
    - run: wget -q https://download.java.net/java/early_access/jdk15/1/GPL/openjdk-15-ea+1_linux-x64_bin.tar.gz --output-document jdk.tar.gz
    - uses: actions/setup-java@v1
      with:
        java-version: '15-ea'
        jdkFile: jdk.tar.gz
    - run: java -version

  jdk-14-ea:
    runs-on: ubuntu-latest
    steps:
    - run: |
        mkdir .jdk
        wget https://github.com/docker-library/openjdk/raw/master/14/jdk/Dockerfile --output-document .jdk/Dockerfile14
        wget $(cat .jdk/Dockerfile14 | sed -n 's/ENV JAVA_URL //p') --output-document .jdk/jdk.tar.gz
        echo ::set-env name=JAVA_VERSION::$(cat .jdk/Dockerfile14 | sed -n 's/ENV JAVA_VERSION //p')
    - uses: actions/setup-java@v1
      with:
        java-version: "${JAVA_VERSION}"
        jdkFile: .jdk/jdk.tar.gz
    - run: java -version

Read value from JAVA_VERSION environment variable
Read value from JAVA_VERSION environment variable
