Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java distribution option #6

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you document the option to set a distribution here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it good like this?

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
Loading