Skip to content

Commit

Permalink
Merge pull request #6 from Ai2473/main
Browse files Browse the repository at this point in the history
Java distribution option
  • Loading branch information
3arthqu4ke authored Apr 10, 2024
2 parents 620f5a0 + 9c2989a commit 5ab257a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/actions/local-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build-specific-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/run-specific-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/run-specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `.*<modloader>.*`, 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.
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5ab257a

Please sign in to comment.