Compare commits

..

9 commits

Author SHA1 Message Date
dependabot[bot]
1d018f9b8b
Bump minimatch from 3.1.2 to 3.1.5 (#984)
Some checks failed
Validate Java e2e / jetbrains 17 (jre+jcef-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / jetbrains 21 (jre+jcef-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / jetbrains 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / jetbrains 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / jetbrains 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / liberica 21 (jdk+fx-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / liberica 11 (jre+fx-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / liberica 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / liberica 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / liberica 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / sapmachine 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / sapmachine 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / sapmachine 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / semeru 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / semeru 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / semeru 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / temurin 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / temurin 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / temurin 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / zulu 21.0 (jdk+fx-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / zulu 21 (jre+fx-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / zulu 17.0 (jre-x64) - macos-15-intel (push) Has been cancelled
Validate Java e2e / zulu 17.0 (jre-x64) - ubuntu-latest (push) Has been cancelled
Validate Java e2e / zulu 17.0 (jre-x64) - windows-latest (push) Has been cancelled
Validate Java e2e / corretto 11 (jdk-) - ubuntu-22.04 (push) Has been cancelled
Validate Java e2e / corretto 11 (jdk-) - windows-latest (push) Has been cancelled
Validate Java e2e / liberica 11 (jdk-) - ubuntu-22.04 (push) Has been cancelled
Validate Java e2e / liberica 11 (jdk-) - windows-latest (push) Has been cancelled
Validate Java e2e / zulu 11 (jdk-) - ubuntu-22.04 (push) Has been cancelled
Validate Java e2e / zulu 11 (jdk-) - windows-latest (push) Has been cancelled
* Bump minimatch from 3.1.2 to 3.1.5

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Check failure fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gowridurgad <gowridurgad@gmail.com>
2026-03-02 15:50:04 -06:00
ian zhang
fe779bf55e
feat(readme): update Java version to 25 in setup examples (#969)
Updated the Java version in the README setup examples from 21 to 25
to reflect the latest supported version. This change ensures that
users are guided to use the most current Java version for their
projects.

- Updated all instances of 'java-version: 21' to 'java-version: 25'
- Modified supported version syntax to include '25'
2026-02-19 11:38:18 -06:00
mahabaleshwars
be666c2fcd
Chore: Version Update and Checkout Update to v6 (#973)
* version update and checkout updated to v6

* version updated
2026-01-21 20:39:03 -06:00
dependabot[bot]
f7a6fefba9
Bump actions/checkout from 5 to 6 (#961)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-21 20:37:24 -06:00
Salman Chishti
d81c4e45f3
Upgrade @actions/cache to v5 (#968)
* Upgrade @actions/cache to v5

- Bump @actions/cache from 4.0.3 to 5.0.0
- Update license cache files for new/updated dependencies
- Rebuild dist bundles
- Mark @actions/http-client as reviewed in licensed config (MIT license text present but detected as 'other')

* chore: Update version to 5.0.1 in package.json and package-lock.json

* upgrade actions/cache to 5.0.1

---------

Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2026-01-20 09:24:36 -06:00
priya-kinthali
1b1bbe1085
readme update (#972) 2026-01-19 20:46:13 -06:00
Piotr Findeisen
5d7b214633
Retry on HTTP 522 Connection timed out (#964)
This is supposed to be CloudFlare specific 522 Connection timed out HTTP
error code.
2025-12-23 16:49:17 -06:00
dependabot[bot]
f2beeb24e1
Bump actions/publish-action from 0.3.0 to 0.4.0 (#912)
Bumps [actions/publish-action](https://github.com/actions/publish-action) from 0.3.0 to 0.4.0.
- [Commits](https://github.com/actions/publish-action/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: actions/publish-action
  dependency-version: 0.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-03 20:46:45 -06:00
guicamest
4e7e684fbb
feat: Add support for .sdkmanrc file in java-version-file parameter (#736)
* chore(e2e-versions): Add e2e test scenario on `setup-java-version-from-file-major-minor-patch-with-dist` for `.sdkmanrc`

* chore(e2e-versions): Update `setup-java-version-from-file-major-minor-patch-with-dist` test to include the file name of the java-version-file that is used

* feat: Add support for `.sdkmanrc` as *Java Version File*

* chore: Add test for the latest known sdkman java versions

* docs(advanced-usage): Document support for `.sdkmanrc` as java-version-file

* chore(docs): Anyone can contribute and maintain 🤷

* Update advanced-usage.md

Add example step/file for `.sdkmanrc`

* Update advanced-usage.md

* Update util.ts

* chore: format and rebuild

* chore: untouch toolchains.ts

* fix check dist error

---------

Co-authored-by: mahabaleshwars <147705296+mahabaleshwars@users.noreply.github.com>
2025-11-25 13:36:29 -06:00
87 changed files with 150329 additions and 102875 deletions

View file

@ -24,7 +24,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for gradle - name: Run setup-java with the cache for gradle
uses: ./ uses: ./
id: setup-java id: setup-java
@ -51,7 +51,7 @@ jobs:
needs: gradle1-save needs: gradle1-save
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for gradle - name: Run setup-java with the cache for gradle
uses: ./ uses: ./
id: setup-java id: setup-java
@ -76,7 +76,7 @@ jobs:
needs: gradle1-save needs: gradle1-save
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for gradle - name: Run setup-java with the cache for gradle
uses: ./ uses: ./
id: setup-java id: setup-java

View file

@ -24,7 +24,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-latest] os: [macos-15-intel, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for gradle - name: Run setup-java with the cache for gradle
uses: ./ uses: ./
id: setup-java id: setup-java
@ -50,7 +50,7 @@ jobs:
needs: gradle-save needs: gradle-save
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for gradle - name: Run setup-java with the cache for gradle
uses: ./ uses: ./
id: setup-java id: setup-java
@ -73,7 +73,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-latest] os: [macos-15-intel, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for maven - name: Run setup-java with the cache for maven
uses: ./ uses: ./
id: setup-java id: setup-java
@ -97,7 +97,7 @@ jobs:
needs: maven-save needs: maven-save
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for maven - name: Run setup-java with the cache for maven
uses: ./ uses: ./
id: setup-java id: setup-java
@ -124,7 +124,7 @@ jobs:
os: [macos-15-intel, windows-latest, ubuntu-22.04] os: [macos-15-intel, windows-latest, ubuntu-22.04]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for sbt - name: Run setup-java with the cache for sbt
uses: ./ uses: ./
id: setup-java id: setup-java
@ -174,7 +174,7 @@ jobs:
needs: sbt-save needs: sbt-save
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run setup-java with the cache for sbt - name: Run setup-java with the cache for sbt
uses: ./ uses: ./
id: setup-java id: setup-java

View file

@ -21,7 +21,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Download Adopt OpenJDK file - name: Download Adopt OpenJDK file
run: | run: |
if ($IsLinux) { if ($IsLinux) {
@ -58,7 +58,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Download Zulu OpenJDK file - name: Download Zulu OpenJDK file
run: | run: |
if ($IsLinux) { if ($IsLinux) {
@ -95,7 +95,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Download Eclipse Temurin file - name: Download Eclipse Temurin file
run: | run: |
if ($IsLinux) { if ($IsLinux) {

View file

@ -25,7 +25,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -60,7 +60,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create fake settings.xml - name: Create fake settings.xml
run: | run: |
$xmlDirectory = Join-Path $HOME ".m2" $xmlDirectory = Join-Path $HOME ".m2"
@ -96,7 +96,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create fake settings.xml - name: Create fake settings.xml
run: | run: |
$xmlDirectory = Join-Path $HOME ".m2" $xmlDirectory = Join-Path $HOME ".m2"
@ -133,7 +133,7 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java

View file

@ -73,7 +73,7 @@ jobs:
version: '24-ea' version: '24-ea'
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -123,7 +123,7 @@ jobs:
version: '17.0.7' version: '17.0.7'
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -158,7 +158,7 @@ jobs:
os: macos-latest os: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -194,7 +194,7 @@ jobs:
os: macos-latest os: macos-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -233,7 +233,7 @@ jobs:
version: ['17-ea', '15.0.0-ea.14'] version: ['17-ea', '15.0.0-ea.14']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -255,7 +255,7 @@ jobs:
version: ['17-ea'] version: ['17-ea']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -277,7 +277,7 @@ jobs:
version: ['17-ea', '21-ea'] version: ['17-ea', '21-ea']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -364,7 +364,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -392,7 +392,7 @@ jobs:
version: ['11'] version: ['11']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java
@ -415,7 +415,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions'] java-version-file: ['.java-version', '.tool-versions']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create .java-version file - name: Create .java-version file
shell: bash shell: bash
run: echo "17" > .java-version run: echo "17" > .java-version
@ -444,7 +444,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions'] java-version-file: ['.java-version', '.tool-versions']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create .java-version file - name: Create .java-version file
shell: bash shell: bash
run: echo "11" > .java-version run: echo "11" > .java-version
@ -472,7 +472,7 @@ jobs:
java-version-file: ['.java-version', '.tool-versions'] java-version-file: ['.java-version', '.tool-versions']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create .java-version file - name: Create .java-version file
shell: bash shell: bash
run: echo "17.0.10" > .java-version run: echo "17.0.10" > .java-version
@ -490,23 +490,26 @@ jobs:
shell: bash shell: bash
setup-java-version-from-file-major-minor-patch-with-dist: setup-java-version-from-file-major-minor-patch-with-dist:
name: ${{ matrix.distribution }} version from file 'openjdk64-17.0.10' - ${{ matrix.os }} name: ${{ matrix.distribution }} version from file '${{ matrix.java-version-file }}' - ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['adopt', 'zulu', 'liberica'] distribution: ['adopt', 'zulu', 'liberica']
java-version-file: ['.java-version', '.tool-versions'] java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Create .java-version file - name: Create .java-version file
shell: bash shell: bash
run: echo "openjdk64-17.0.10" > .java-version run: echo "openjdk64-17.0.10" > .java-version
- name: Create .tool-versions file - name: Create .tool-versions file
shell: bash shell: bash
run: echo "java openjdk64-17.0.10" > .tool-versions run: echo "java openjdk64-17.0.10" > .tool-versions
- name: Create .sdkmanrc file
shell: bash
run: echo "java=17.0.10-tem" > .sdkmanrc
- name: setup-java - name: setup-java
uses: ./ uses: ./
id: setup-java id: setup-java

View file

@ -15,7 +15,7 @@ jobs:
steps: steps:
- name: Checking out - name: Checking out
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Publish - name: Publish
id: publish id: publish
uses: actions/publish-immutable-action@v0.0.4 uses: actions/publish-immutable-action@v0.0.4

View file

@ -23,7 +23,7 @@ jobs:
steps: steps:
- name: Update the ${{ env.TAG_NAME }} tag - name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag id: update-major-tag
uses: actions/publish-action@v0.3.0 uses: actions/publish-action@v0.4.0
with: with:
source-tag: ${{ env.TAG_NAME }} source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }} slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View file

@ -12,4 +12,5 @@ allowed:
- unlicense - unlicense
reviewed: reviewed:
npm: npm:
- "@actions/http-client" # MIT (license text present), but detected as "other"

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@actions/io-2.0.0.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/debug.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -78,28 +78,28 @@ For information about the latest releases, recent updates, and newly supported d
#### Eclipse Temurin #### Eclipse Temurin
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' # See 'Supported distributions' for available options distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21' java-version: '25'
- run: java HelloWorldApp.java - run: java HelloWorldApp.java
``` ```
#### Azul Zulu OpenJDK #### Azul Zulu OpenJDK
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'zulu' # See 'Supported distributions' for available options distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '21' java-version: '25'
- run: java HelloWorldApp.java - run: java HelloWorldApp.java
``` ```
#### Supported version syntax #### Supported version syntax
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation: The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation:
- major versions: `8`, `11`, `16`, `17`, `21` - major versions: `8`, `11`, `16`, `17`, `21`, `25`
- more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0` - more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0`
- early access (EA) versions: `15-ea`, `15.0.0-ea` - early access (EA) versions: `15-ea`, `15.0.0-ea`
@ -145,26 +145,31 @@ The cache input is optional, and caching is turned off by default.
#### Caching gradle dependencies #### Caching gradle dependencies
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '25'
cache: 'gradle' cache: 'gradle'
cache-dependency-path: | # optional cache-dependency-path: | # optional
sub-project/*.gradle* sub-project/*.gradle*
sub-project/**/gradle-wrapper.properties sub-project/**/gradle-wrapper.properties
- run: ./gradlew build --no-daemon - run: ./gradlew build --no-daemon
``` ```
Using the `cache: gradle` provides a simple and effective way to cache Gradle dependencies with minimal configuration.
For projects that require more advanced `Gradle` caching features, such as caching build outputs, support for Gradle configuration cache, encrypted cache storage, fine-grained cache control (including options to enable or disable the cache, set it to read-only or write-only, perform automated cleanup, and define custom cache rules), or optimized performance for complex CI workflows, consider using [`gradle/actions/setup-gradle`](https://github.com/gradle/actions/tree/main/setup-gradle).
For setup details and a comprehensive overview of all available features, visit the [setup-gradle documentation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md).
#### Caching maven dependencies #### Caching maven dependencies
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '25'
cache: 'maven' cache: 'maven'
cache-dependency-path: 'sub-project/pom.xml' # optional cache-dependency-path: 'sub-project/pom.xml' # optional
- name: Build with Maven - name: Build with Maven
@ -174,11 +179,11 @@ steps:
#### Caching sbt dependencies #### Caching sbt dependencies
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '25'
cache: 'sbt' cache: 'sbt'
cache-dependency-path: | # optional cache-dependency-path: | # optional
sub-project/build.sbt sub-project/build.sbt
@ -194,11 +199,11 @@ Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a
env: env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5' SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '25'
cache: 'gradle' cache: 'gradle'
- run: ./gradlew build --no-daemon - run: ./gradlew build --no-daemon
``` ```
@ -214,11 +219,11 @@ For Java distributions that are not cached on Hosted images, `check-latest` alwa
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '25'
check-latest: true check-latest: true
- run: java HelloWorldApp.java - run: java HelloWorldApp.java
``` ```
@ -230,10 +235,10 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
java: [ '8', '11', '17', '21' ] java: [ '8', '11', '17', '21', '25' ]
name: Java ${{ matrix.Java }} sample name: Java ${{ matrix.Java }} sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Setup java - name: Setup java
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:

View file

@ -0,0 +1,135 @@
6.0.119-zulu, 6.0.119
7.0.352-zulu, 7.0.352
8.0.282-trava, 8.0.282
8.0.432-albba, 8.0.432
8.0.432-amzn, 8.0.432
8.0.432-kona, 8.0.432
8.0.432-librca, 8.0.432
8.0.432-sem, 8.0.432
8.0.432-tem, 8.0.432
8.0.432-zulu, 8.0.432
8.0.432.fx-librca, 8.0.432
8.0.432.fx-zulu, 8.0.432
8.0.442-amzn, 8.0.442
8.0.442-librca, 8.0.442
8.0.442-tem, 8.0.442
8.0.442-zulu, 8.0.442
8.0.442.fx-librca, 8.0.442
8.0.442.fx-zulu, 8.0.442
11.0.14.1-jbr, 11.0.14
11.0.15-trava, 11.0.15
11.0.25-albba, 11.0.25
11.0.25-amzn, 11.0.25
11.0.25-kona, 11.0.25
11.0.25-librca, 11.0.25
11.0.25-ms, 11.0.25
11.0.25-sapmchn, 11.0.25
11.0.25-sem, 11.0.25
11.0.25-tem, 11.0.25
11.0.25-zulu, 11.0.25
11.0.25.fx-librca, 11.0.25
11.0.25.fx-zulu, 11.0.25
11.0.26-amzn, 11.0.26
11.0.26-librca, 11.0.26
11.0.26-ms, 11.0.26
11.0.26-sapmchn, 11.0.26
11.0.26-zulu, 11.0.26
11.0.26.fx-librca, 11.0.26
11.0.26.fx-zulu, 11.0.26
17.0.12-graal, 17.0.12
17.0.12-jbr, 17.0.12
17.0.12-oracle, 17.0.12
17.0.13-albba, 17.0.13
17.0.13-amzn, 17.0.13
17.0.13-kona, 17.0.13
17.0.13-librca, 17.0.13
17.0.13-ms, 17.0.13
17.0.13-sapmchn, 17.0.13
17.0.13-sem, 17.0.13
17.0.13-tem, 17.0.13
17.0.13-zulu, 17.0.13
17.0.13.crac-librca, 17.0.13
17.0.13.crac-zulu, 17.0.13
17.0.13.fx-librca, 17.0.13
17.0.13.fx-zulu, 17.0.13
17.0.14-amzn, 17.0.14
17.0.14-librca, 17.0.14
17.0.14-ms, 17.0.14
17.0.14-sapmchn, 17.0.14
17.0.14-zulu, 17.0.14
17.0.14.fx-librca, 17.0.14
17.0.14.fx-zulu, 17.0.14
17.0.9-graalce, 17.0.9
21.0.2-graalce, 21.0.2
21.0.2-open, 21.0.2
21.0.5-amzn, 21.0.5
21.0.5-graal, 21.0.5
21.0.5-jbr, 21.0.5
21.0.5-kona, 21.0.5
21.0.5-librca, 21.0.5
21.0.5-ms, 21.0.5
21.0.5-oracle, 21.0.5
21.0.5-sapmchn, 21.0.5
21.0.5-sem, 21.0.5
21.0.5-tem, 21.0.5
21.0.5-zulu, 21.0.5
21.0.5.crac-librca, 21.0.5
21.0.5.crac-zulu, 21.0.5
21.0.5.fx-librca, 21.0.5
21.0.5.fx-zulu, 21.0.5
21.0.6-amzn, 21.0.6
21.0.6-graal, 21.0.6
21.0.6-librca, 21.0.6
21.0.6-ms, 21.0.6
21.0.6-oracle, 21.0.6
21.0.6-sapmchn, 21.0.6
21.0.6-tem, 21.0.6
21.0.6-zulu, 21.0.6
21.0.6.fx-librca, 21.0.6
21.0.6.fx-zulu, 21.0.6
22.0.2-oracle, 22.0.2
22.1.0.1.r11-gln, 22.1.0
22.1.0.1.r17-gln, 22.1.0
22.3.5.r11-nik, 22.3.5
22.3.5.r17-mandrel, 22.3.5
22.3.5.r17-nik, 22.3.5
23-open, 23
23.0.1-amzn, 23.0.1
23.0.1-graal, 23.0.1
23.0.1-graalce, 23.0.1
23.0.1-librca, 23.0.1
23.0.1-open, 23.0.1
23.0.1-oracle, 23.0.1
23.0.1-sapmchn, 23.0.1
23.0.1-tem, 23.0.1
23.0.1-zulu, 23.0.1
23.0.1.crac-zulu, 23.0.1
23.0.1.fx-librca, 23.0.1
23.0.1.fx-zulu, 23.0.1
23.0.2-amzn, 23.0.2
23.0.2-graal, 23.0.2
23.0.2-graalce, 23.0.2
23.0.2-librca, 23.0.2
23.0.2-oracle, 23.0.2
23.0.2-sapmchn, 23.0.2
23.0.2-tem, 23.0.2
23.0.2-zulu, 23.0.2
23.0.2.fx-librca, 23.0.2
23.0.2.fx-zulu, 23.0.2
23.0.6.fx-nik, 23.0.6
23.0.6.r17-mandrel, 23.0.6
23.0.6.r17-nik, 23.0.6
23.1.5.fx-nik, 23.1.5
23.1.5.r21-mandrel, 23.1.5
23.1.5.r21-nik, 23.1.5
24.0.2.r22-mandrel, 24.0.2
24.ea.27-graal, 24.0.0
24.ea.28-graal, 24.0.0
24.ea.31-open, 24.0.0
24.ea.32-open, 24.0.0
24.1.1.r23-mandrel, 24.1.1
24.1.1.r23-nik, 24.1.1
25.ea.4-graal, 25.0.0
25.ea.5-graal, 25.0.0
25.ea.5-open, 25.0.0
25.ea.6-open, 25.0.0
1 6.0.119-zulu 6.0.119
2 7.0.352-zulu 7.0.352
3 8.0.282-trava 8.0.282
4 8.0.432-albba 8.0.432
5 8.0.432-amzn 8.0.432
6 8.0.432-kona 8.0.432
7 8.0.432-librca 8.0.432
8 8.0.432-sem 8.0.432
9 8.0.432-tem 8.0.432
10 8.0.432-zulu 8.0.432
11 8.0.432.fx-librca 8.0.432
12 8.0.432.fx-zulu 8.0.432
13 8.0.442-amzn 8.0.442
14 8.0.442-librca 8.0.442
15 8.0.442-tem 8.0.442
16 8.0.442-zulu 8.0.442
17 8.0.442.fx-librca 8.0.442
18 8.0.442.fx-zulu 8.0.442
19 11.0.14.1-jbr 11.0.14
20 11.0.15-trava 11.0.15
21 11.0.25-albba 11.0.25
22 11.0.25-amzn 11.0.25
23 11.0.25-kona 11.0.25
24 11.0.25-librca 11.0.25
25 11.0.25-ms 11.0.25
26 11.0.25-sapmchn 11.0.25
27 11.0.25-sem 11.0.25
28 11.0.25-tem 11.0.25
29 11.0.25-zulu 11.0.25
30 11.0.25.fx-librca 11.0.25
31 11.0.25.fx-zulu 11.0.25
32 11.0.26-amzn 11.0.26
33 11.0.26-librca 11.0.26
34 11.0.26-ms 11.0.26
35 11.0.26-sapmchn 11.0.26
36 11.0.26-zulu 11.0.26
37 11.0.26.fx-librca 11.0.26
38 11.0.26.fx-zulu 11.0.26
39 17.0.12-graal 17.0.12
40 17.0.12-jbr 17.0.12
41 17.0.12-oracle 17.0.12
42 17.0.13-albba 17.0.13
43 17.0.13-amzn 17.0.13
44 17.0.13-kona 17.0.13
45 17.0.13-librca 17.0.13
46 17.0.13-ms 17.0.13
47 17.0.13-sapmchn 17.0.13
48 17.0.13-sem 17.0.13
49 17.0.13-tem 17.0.13
50 17.0.13-zulu 17.0.13
51 17.0.13.crac-librca 17.0.13
52 17.0.13.crac-zulu 17.0.13
53 17.0.13.fx-librca 17.0.13
54 17.0.13.fx-zulu 17.0.13
55 17.0.14-amzn 17.0.14
56 17.0.14-librca 17.0.14
57 17.0.14-ms 17.0.14
58 17.0.14-sapmchn 17.0.14
59 17.0.14-zulu 17.0.14
60 17.0.14.fx-librca 17.0.14
61 17.0.14.fx-zulu 17.0.14
62 17.0.9-graalce 17.0.9
63 21.0.2-graalce 21.0.2
64 21.0.2-open 21.0.2
65 21.0.5-amzn 21.0.5
66 21.0.5-graal 21.0.5
67 21.0.5-jbr 21.0.5
68 21.0.5-kona 21.0.5
69 21.0.5-librca 21.0.5
70 21.0.5-ms 21.0.5
71 21.0.5-oracle 21.0.5
72 21.0.5-sapmchn 21.0.5
73 21.0.5-sem 21.0.5
74 21.0.5-tem 21.0.5
75 21.0.5-zulu 21.0.5
76 21.0.5.crac-librca 21.0.5
77 21.0.5.crac-zulu 21.0.5
78 21.0.5.fx-librca 21.0.5
79 21.0.5.fx-zulu 21.0.5
80 21.0.6-amzn 21.0.6
81 21.0.6-graal 21.0.6
82 21.0.6-librca 21.0.6
83 21.0.6-ms 21.0.6
84 21.0.6-oracle 21.0.6
85 21.0.6-sapmchn 21.0.6
86 21.0.6-tem 21.0.6
87 21.0.6-zulu 21.0.6
88 21.0.6.fx-librca 21.0.6
89 21.0.6.fx-zulu 21.0.6
90 22.0.2-oracle 22.0.2
91 22.1.0.1.r11-gln 22.1.0
92 22.1.0.1.r17-gln 22.1.0
93 22.3.5.r11-nik 22.3.5
94 22.3.5.r17-mandrel 22.3.5
95 22.3.5.r17-nik 22.3.5
96 23-open 23
97 23.0.1-amzn 23.0.1
98 23.0.1-graal 23.0.1
99 23.0.1-graalce 23.0.1
100 23.0.1-librca 23.0.1
101 23.0.1-open 23.0.1
102 23.0.1-oracle 23.0.1
103 23.0.1-sapmchn 23.0.1
104 23.0.1-tem 23.0.1
105 23.0.1-zulu 23.0.1
106 23.0.1.crac-zulu 23.0.1
107 23.0.1.fx-librca 23.0.1
108 23.0.1.fx-zulu 23.0.1
109 23.0.2-amzn 23.0.2
110 23.0.2-graal 23.0.2
111 23.0.2-graalce 23.0.2
112 23.0.2-librca 23.0.2
113 23.0.2-oracle 23.0.2
114 23.0.2-sapmchn 23.0.2
115 23.0.2-tem 23.0.2
116 23.0.2-zulu 23.0.2
117 23.0.2.fx-librca 23.0.2
118 23.0.2.fx-zulu 23.0.2
119 23.0.6.fx-nik 23.0.6
120 23.0.6.r17-mandrel 23.0.6
121 23.0.6.r17-nik 23.0.6
122 23.1.5.fx-nik 23.1.5
123 23.1.5.r21-mandrel 23.1.5
124 23.1.5.r21-nik 23.1.5
125 24.0.2.r22-mandrel 24.0.2
126 24.ea.27-graal 24.0.0
127 24.ea.28-graal 24.0.0
128 24.ea.31-open 24.0.0
129 24.ea.32-open 24.0.0
130 24.1.1.r23-mandrel 24.1.1
131 24.1.1.r23-nik 24.1.1
132 25.ea.4-graal 25.0.0
133 25.ea.5-graal 25.0.0
134 25.ea.5-open 25.0.0
135 25.ea.6-open 25.0.0

View file

@ -1,7 +1,10 @@
import * as cache from '@actions/cache'; import * as cache from '@actions/cache';
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as fs from 'fs';
import * as path from 'path';
import { import {
convertVersionToSemver, convertVersionToSemver,
getVersionFromFileContent,
isVersionSatisfies, isVersionSatisfies,
isCacheFeatureAvailable, isCacheFeatureAvailable,
isGhes isGhes
@ -82,6 +85,43 @@ describe('convertVersionToSemver', () => {
}); });
}); });
describe('getVersionFromFileContent', () => {
describe('.sdkmanrc', () => {
it.each([
['java=11.0.20.1-tem', '11.0.20'],
['java = 11.0.20.1-tem', '11.0.20'],
['java=11.0.20.1-tem # a comment in sdkmanrc', '11.0.20'],
['java=11.0.20.1-tem\n#java=21.0.20.1-tem\n', '11.0.20'], // choose first match
['java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '11.0.20'], // choose first match
['#java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '21.0.20'] // first one is 'commented' in .sdkmanrc
])('parsing %s should return %s', (content: string, expected: string) => {
const actual = getVersionFromFileContent(content, 'openjdk', '.sdkmanrc');
expect(actual).toBe(expected);
});
describe('known versions', () => {
const csv = fs.readFileSync(
path.join(__dirname, 'data/sdkman-java-versions.csv'),
'utf8'
);
const versions = csv.split('\n').map(r => r.split(', '));
it.each(versions)(
'parsing %s should return %s',
(sdkmanJavaVersion: string, expected: string) => {
const asContent = `java=${sdkmanJavaVersion}`;
const actual = getVersionFromFileContent(
asContent,
'openjdk',
'.sdkmanrc'
);
expect(actual).toBe(expected);
}
);
});
});
});
describe('isGhes', () => { describe('isGhes', () => {
const pristineEnv = process.env; const pristineEnv = process.env;

126657
dist/cleanup/index.js vendored

File diff suppressed because one or more lines are too long

124775
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -31,7 +31,7 @@ Inputs `java-version` and `distribution` are mandatory and needs to be provided.
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
@ -44,7 +44,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'adopt-hotspot' distribution: 'adopt-hotspot'
@ -56,7 +56,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'zulu' distribution: 'zulu'
@ -69,7 +69,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'liberica' distribution: 'liberica'
@ -82,7 +82,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'microsoft' distribution: 'microsoft'
@ -111,7 +111,7 @@ If the runner is not able to access github.com, any Java versions requested duri
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'corretto' distribution: 'corretto'
@ -124,7 +124,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'oracle' distribution: 'oracle'
@ -137,7 +137,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'dragonwell' distribution: 'dragonwell'
@ -149,7 +149,7 @@ steps:
**NOTE:** An OpenJDK release maintained and supported by SAP **NOTE:** An OpenJDK release maintained and supported by SAP
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'sapmachine' distribution: 'sapmachine'
@ -162,7 +162,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'graalvm' distribution: 'graalvm'
@ -181,7 +181,7 @@ For example, `11.0.24` is not available but `11.0.16` is.
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'jetbrains' distribution: 'jetbrains'
@ -194,7 +194,7 @@ GitHub token to the action to increase the rate limit. Set the `GITHUB_TOKEN` en
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'jetbrains' distribution: 'jetbrains'
@ -219,7 +219,7 @@ The available package types are:
## Installing custom Java package type ## Installing custom Java package type
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: '<distribution>' distribution: '<distribution>'
@ -232,7 +232,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: '<distribution>' distribution: '<distribution>'
@ -296,7 +296,7 @@ jobs:
java: [ '8', '11' ] java: [ '8', '11' ]
name: Java ${{ matrix.Java }} (${{ matrix.distribution }}) sample name: Java ${{ matrix.Java }} (${{ matrix.distribution }}) sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Setup java - name: Setup java
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:
@ -316,7 +316,7 @@ jobs:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
name: Java ${{ matrix.Java }} (${{ matrix.os }}) sample name: Java ${{ matrix.Java }} (${{ matrix.os }}) sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Setup java - name: Setup java
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:
@ -333,7 +333,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Set up JDK 11 - name: Set up JDK 11
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:
@ -446,7 +446,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Set up JDK 11 for Shared Runner - name: Set up JDK 11 for Shared Runner
uses: actions/setup-java@v5 uses: actions/setup-java@v5
with: with:
@ -472,7 +472,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Set up JDK 11 - name: Set up JDK 11
uses: actions/setup-java@v5 uses: actions/setup-java@v5
@ -574,7 +574,7 @@ Each JDK provider will receive a default `id` based on the combination of `distr
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-java@v5 - uses: actions/setup-java@v5
with: with:
distribution: 'temurin' distribution: 'temurin'
@ -601,14 +601,29 @@ steps:
## Java version file ## Java version file
If the `java-version-file` input is specified, the action will extract the version from the file and install it. If the `java-version-file` input is specified, the action will extract the version from the file and install it.
Supported files are .java-version and .tool-versions. Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
In .java-version file, only the version should be specified (e.g., 17.0.7). * In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
In .tool-versions file, java version should be preceded by the java keyword (e.g., java 17.0.7). * In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv). Similarly, the `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)). * In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
If both java-version and java-version-file inputs are provided, the java-version input will be used.
Valid entry options:
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
**Example step using `Sdkman!`**:
```yml
- name: Setup java
uses: actions/setup-java@v5
with:
java-version-file: '.sdkmanrc'
distribution: 'temurin'
```
**Example `.sdkmanrc`**:
```
java=17.0.7-tem
```
Valid entry options (does not apply to `.sdkmanrc`):
``` ```
major versions: 8, 11, 16, 17, 21 major versions: 8, 11, 16, 17, 21
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0 more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
@ -619,4 +634,4 @@ LTS versions : temurin-21.0.5+11.0.LTS
If the file contains multiple versions, only the first one will be recognized. If the file contains multiple versions, only the first one will be recognized.
***NOTE***: ***NOTE***:
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10). For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).

View file

@ -68,7 +68,7 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
Adding or changing tests is an integral part of making a change to the code. Adding or changing tests is an integral part of making a change to the code.
Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml). Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml).
- The contributor can add various types of tests (like unit tests or end-to-end tests), which, in his opinion, will be necessary and sufficient for testing new or changed functionality - The contributor can add various types of tests (like unit tests or end-to-end tests), which, in their opinion, will be necessary and sufficient for testing new or changed functionality
- Tests should cover a successful execution, as well as some edge cases and possible errors - Tests should cover a successful execution, as well as some edge cases and possible errors
- As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request - As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request
@ -76,7 +76,7 @@ Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workf
- CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem - CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem
- Maintainers will review your pull request - Maintainers will review your pull request
- If a maintainer requests changes, first of all, try to think about his request critically and only after that implement and request another review - If a maintainer requests changes, first of all, try to think about their request critically and only after that implement and request another review
- If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag - If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag
> Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart: > Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart:

1387
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "setup-java", "name": "setup-java",
"version": "5.0.0", "version": "5.2.0",
"private": true, "private": true,
"description": "setup java action", "description": "setup java action",
"main": "dist/setup/index.js", "main": "dist/setup/index.js",
@ -29,7 +29,7 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^4.0.3", "@actions/cache": "^5.0.1",
"@actions/core": "^1.10.0", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.4", "@actions/exec": "^1.0.4",
"@actions/glob": "^0.5.0", "@actions/glob": "^0.5.0",
@ -46,7 +46,7 @@
"@typescript-eslint/eslint-plugin": "^8.35.1", "@typescript-eslint/eslint-plugin": "^8.35.1",
"@typescript-eslint/parser": "^8.35.1", "@typescript-eslint/parser": "^8.35.1",
"@vercel/ncc": "^0.38.1", "@vercel/ncc": "^0.38.1",
"eslint": "^9.39.1", "eslint": "^8.57.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^29.0.1", "eslint-plugin-jest": "^29.0.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
@ -60,4 +60,4 @@
"url": "https://github.com/actions/setup-java/issues" "url": "https://github.com/actions/setup-java/issues"
}, },
"homepage": "https://github.com/actions/setup-java#readme" "homepage": "https://github.com/actions/setup-java#readme"
} }

View file

@ -83,7 +83,7 @@ export abstract class JavaBase {
const isRetryable = const isRetryable =
(error instanceof tc.HTTPError && (error instanceof tc.HTTPError &&
error.httpStatusCode && error.httpStatusCode &&
[429, 502, 503, 504].includes(error.httpStatusCode)) || [429, 502, 503, 504, 522].includes(error.httpStatusCode)) ||
retryableCodes.includes(error?.code) || retryableCodes.includes(error?.code) ||
(error?.errors && (error?.errors &&
Array.isArray(error.errors) && Array.isArray(error.errors) &&

View file

@ -134,20 +134,24 @@ export function getVersionFromFileContent(
if (versionFileName == '.tool-versions') { if (versionFileName == '.tool-versions') {
javaVersionRegExp = javaVersionRegExp =
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im; /^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
} else if (versionFileName == '.sdkmanrc') {
javaVersionRegExp = /^java\s*=\s*(?<version>[^-]+)/m;
} else { } else {
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/; javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
} }
const fileContent = content.match(javaVersionRegExp)?.groups?.version const capturedVersion = content.match(javaVersionRegExp)?.groups?.version
? (content.match(javaVersionRegExp)?.groups?.version as string) ? (content.match(javaVersionRegExp)?.groups?.version as string)
: ''; : '';
if (!fileContent) {
core.debug(
`Parsed version '${capturedVersion}' from file '${versionFileName}'`
);
if (!capturedVersion) {
return null; return null;
} }
core.debug(`Version from file '${fileContent}'`); const tentativeVersion = avoidOldNotation(capturedVersion);
const tentativeVersion = avoidOldNotation(fileContent);
const rawVersion = tentativeVersion.split('-')[0]; const rawVersion = tentativeVersion.split('-')[0];
let version = semver.validRange(rawVersion) let version = semver.validRange(rawVersion)