diff --git a/.github/actions/local-action/action.yml b/.github/actions/local-action/action.yml index be5f4c5..2b833d9 100644 --- a/.github/actions/local-action/action.yml +++ b/.github/actions/local-action/action.yml @@ -18,6 +18,10 @@ inputs: description: 'The Java version to use' required: true default: '17' + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' dummy_assets: description: 'Whether to use Dummy Assets or not' required: true @@ -43,7 +47,7 @@ runs: - uses: actions/setup-java@v4 with: java-version: ${{ inputs.java }} - distribution: adopt + distribution: ${{ inputs.java-distribution }} - name: Setup HeadlessMC directory run: mkdir HeadlessMC shell: bash diff --git a/.github/workflows/build-specific-reusable.yml b/.github/workflows/build-specific-reusable.yml index 1e6e0d2..64fe53b 100644 --- a/.github/workflows/build-specific-reusable.yml +++ b/.github/workflows/build-specific-reusable.yml @@ -27,6 +27,11 @@ on: required: true default: '17' type: string + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' + type: string jobs: build: @@ -36,7 +41,7 @@ jobs: - uses: actions/setup-java@v4 with: java-version: ${{ inputs.java }} - distribution: adopt + distribution: ${{ inputs.java-distribution }} - name: Grant execute permission for gradlew working-directory: ./${{ inputs.dir }} run: chmod +x gradlew diff --git a/.github/workflows/build-specific.yml b/.github/workflows/build-specific.yml index 209832c..93a16fd 100644 --- a/.github/workflows/build-specific.yml +++ b/.github/workflows/build-specific.yml @@ -22,6 +22,10 @@ on: description: 'The Java version to use' required: true default: '17' + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' jobs: build: @@ -31,7 +35,7 @@ jobs: - uses: actions/setup-java@v4 with: java-version: ${{ github.event.inputs.java }} - distribution: adopt + distribution: ${{ github.event.inputs.java-distribution }} - name: Grant execute permission for gradlew working-directory: ./${{ github.event.inputs.dir }} run: chmod +x gradlew diff --git a/.github/workflows/run-specific-reusable.yml b/.github/workflows/run-specific-reusable.yml index 36e1c7d..232a5d3 100644 --- a/.github/workflows/run-specific-reusable.yml +++ b/.github/workflows/run-specific-reusable.yml @@ -32,6 +32,11 @@ on: required: true default: '17' type: string + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' + type: string xvfb: description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' required: false @@ -51,7 +56,7 @@ jobs: - uses: actions/setup-java@v4 with: java-version: ${{ inputs.java }} - distribution: adopt + distribution: ${{ inputs.java-distribution }} - name: Grant execute permission for gradlew working-directory: ./${{ inputs.dir }} run: chmod +x gradlew diff --git a/.github/workflows/run-specific.yml b/.github/workflows/run-specific.yml index 1724a97..8ddfb7a 100644 --- a/.github/workflows/run-specific.yml +++ b/.github/workflows/run-specific.yml @@ -26,6 +26,10 @@ on: description: 'The Java version to use' required: true default: '17' + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' xvfb: description: 'Runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc.' required: false @@ -45,7 +49,7 @@ jobs: - uses: actions/setup-java@v4 with: java-version: ${{ github.event.inputs.java }} - distribution: adopt + distribution: ${{ github.event.inputs.java-distribution }} - name: Grant execute permission for gradlew working-directory: ./${{ github.event.inputs.dir }} run: chmod +x gradlew diff --git a/.github/workflows/verify-wrapper.yml b/.github/workflows/verify-wrapper.yml index 2c99a03..290244d 100644 --- a/.github/workflows/verify-wrapper.yml +++ b/.github/workflows/verify-wrapper.yml @@ -12,5 +12,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/wrapper-validation-action@v2 diff --git a/README.md b/README.md index ed54ee3..f3b1865 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ An example workflow in action can be found [here](https://github.com/3arthqu4ke/ - `mc`: The MC version to use, e.g. `1.20.4`. - `modloader`: The modloader to install with HeadlessMC (`forge`, `neoforge` or `fabric`). - `regex`: A Regex to match the MC version to launch (can in most cases just be `.*.*`, like `.*fabric.*`, very old versions of forge might start with an uppercase `Forge`). -- `java`: The Java version to use, e.g. `17`, we use the adopt distribution. +- `java`: The Java version to use, e.g. `17`. +- `java-distribution`: The [Java distribution](https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions) to use, by default we use the adopt distribution. - `dummy_assets`: HeadlessMC will use dummy assets to not download all the MC assets. Can be disabled by setting this to `false`. - `mc_runtime_test`: The MC-Runtime-Test jar to download (`none`, `lexforge`, `fabric` or `neoforge`). When using `none` you need to provide a way for the game to exit or the action will run indefinitely and time out. - `xvfb`: If `true` (default), runs the game with Xvfb, if false, you should probably use the -lwjgl option in headlessmc. diff --git a/action.yml b/action.yml index a4edba8..cf192da 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,10 @@ inputs: description: 'The Java version to use' required: true default: '17' + java-distribution: + description: 'The Java distribution to use' + required: false + default: 'adopt' dummy_assets: description: 'Whether to use Dummy Assets or not' required: true @@ -45,7 +49,7 @@ runs: - uses: actions/setup-java@v4 with: java-version: ${{ inputs.java }} - distribution: adopt + distribution: ${{ inputs.java-distribution }} - name: Setup HeadlessMC directory run: mkdir HeadlessMC shell: bash