mirror of
https://github.com/actions/setup-java.git
synced 2026-08-24 19:32:58 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd06d9cba3 | |||
| 59b3450628 | |||
| b96213d9d2 | |||
| 1dbac3c9e1 | |||
| 11741d6cfa | |||
| ff99aa1c87 |
@@ -24,6 +24,7 @@ jobs:
|
|||||||
warm-caches:
|
warm-caches:
|
||||||
name: Warm ${{ matrix.tool }} ${{ matrix.profile }} caches (${{ matrix.os }})
|
name: Warm ${{ matrix.tool }} ${{ matrix.profile }} caches (${{ matrix.os }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -65,6 +66,7 @@ jobs:
|
|||||||
name: Benchmark ${{ matrix.tool }} ${{ matrix.profile }} (${{ matrix.os }})
|
name: Benchmark ${{ matrix.tool }} ${{ matrix.profile }} (${{ matrix.os }})
|
||||||
needs: warm-caches
|
needs: warm-caches
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ defaults:
|
|||||||
jobs:
|
jobs:
|
||||||
gradle-save:
|
gradle-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -48,6 +49,7 @@ jobs:
|
|||||||
bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
||||||
gradle-restore:
|
gradle-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -72,6 +74,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
||||||
maven-save:
|
maven-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -97,6 +100,7 @@ jobs:
|
|||||||
bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
||||||
maven-restore:
|
maven-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -121,6 +125,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
||||||
sbt-save:
|
sbt-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -160,6 +165,7 @@ jobs:
|
|||||||
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
sbt-restore:
|
sbt-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -194,6 +200,7 @@ jobs:
|
|||||||
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
gradle1-save:
|
gradle1-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -222,6 +229,7 @@ jobs:
|
|||||||
bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
||||||
gradle1-restore:
|
gradle1-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -246,6 +254,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
|
||||||
gradle2-restore:
|
gradle2-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -268,6 +277,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.gradle/caches" absent
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/caches" absent
|
||||||
maven1-save:
|
maven1-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -294,6 +304,7 @@ jobs:
|
|||||||
bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
||||||
maven1-restore:
|
maven1-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -318,6 +329,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
|
||||||
maven2-restore:
|
maven2-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -342,6 +354,7 @@ jobs:
|
|||||||
run: bash __tests__/check-dir.sh "$HOME/.m2/repository" absent
|
run: bash __tests__/check-dir.sh "$HOME/.m2/repository" absent
|
||||||
sbt1-save:
|
sbt1-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: write-only
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -382,6 +395,7 @@ jobs:
|
|||||||
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
sbt1-restore:
|
sbt1-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -416,6 +430,7 @@ jobs:
|
|||||||
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
sbt2-restore:
|
sbt2-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
cache-mode: read
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -450,6 +465,7 @@ jobs:
|
|||||||
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" absent
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" absent
|
||||||
custom-maven-path-save:
|
custom-maven-path-save:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
cache-mode: write-only
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -474,6 +490,7 @@ jobs:
|
|||||||
bash __tests__/check-dir.sh "$RUNNER_TEMP/setup-java-custom-maven-repository"
|
bash __tests__/check-dir.sh "$RUNNER_TEMP/setup-java-custom-maven-repository"
|
||||||
custom-maven-path-restore:
|
custom-maven-path-restore:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
cache-mode: read
|
||||||
needs: custom-maven-path-save
|
needs: custom-maven-path-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
version: 25
|
version: 25
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-15-intel
|
os: macos-15-intel
|
||||||
version: 17
|
version: 21
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
version: 21
|
version: 21
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: fast-xml-parser
|
name: fast-xml-parser
|
||||||
version: 5.10.1
|
version: 5.11.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: strnum
|
name: strnum
|
||||||
version: 2.4.1
|
version: 2.4.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: Parse String to Number based on configuration
|
summary: Parse String to Number based on configuration
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
@@ -9,22 +9,13 @@ Set up Java for GitHub Actions workflows. `setup-java` installs a requested Java
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> V6 is still in development on the `main` branch and is not yet recommended for production workflows. To use it, you must explicitly reference the `main` branch in your workflow, as in
|
|
||||||
>
|
|
||||||
> ```yaml
|
|
||||||
> - uses: actions/setup-java@main
|
|
||||||
> ```
|
|
||||||
>
|
|
||||||
> For production workflows, it is recommended to use the latest stable release `v5`.
|
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [What it does](#what-it-does)
|
- [What it does](#what-it-does)
|
||||||
@@ -54,15 +45,16 @@ steps:
|
|||||||
|
|
||||||
## What's new
|
## What's new
|
||||||
|
|
||||||
### V6 (in development)
|
### V6
|
||||||
|
|
||||||
- Migrated the action implementation to ESM to support the latest `@actions/*` packages.
|
- Migrated the action implementation to ESM to support the latest `@actions/*` packages.
|
||||||
- Added the `oracle-openjdk` distribution for OpenJDK builds from Oracle.
|
- Added the `oracle-openjdk`, `redhat`, and `liberica-nik` distributions.
|
||||||
- Added `java-version: latest` to resolve the newest stable GA release from the distribution's remote metadata.
|
- Added `java-version: latest` to resolve the newest stable GA release from the distribution's remote metadata.
|
||||||
- JDK downloads now automatically verify authoritative checksums for [supported distributions](#download-integrity-and-signatures).
|
- JDK downloads now automatically verify authoritative checksums, and package signature verification defaults to enabled for Temurin and Microsoft builds.
|
||||||
- Added `force-download: true` to bypass the tool cache and perform a reproducible fresh install.
|
- Added `force-download: true` to bypass the tool cache and perform a reproducible fresh install.
|
||||||
- Dependency caching now supports custom paths with `cache-path` and restore-only operation with `cache-read-only: true`.
|
- Dependency caching now supports custom paths with `cache-path` and restore-only operation with `cache-read-only: true`.
|
||||||
- Downloaded JDKs are now [cached](#caching-jdk-installations) automatically when `cache` is set; use `cache-jdk` to enable or disable it independently.
|
- Downloaded JDKs are now [cached](#caching-jdk-installations) automatically when `cache` is set; use `cache-jdk` to enable or disable it independently.
|
||||||
|
- Maven configuration now supports multiple server credentials and custom dependency-resolution repositories.
|
||||||
- Set `problem-matcher: false` to disable Java compiler and uncaught-exception annotations.
|
- Set `problem-matcher: false` to disable Java compiler and uncaught-exception annotations.
|
||||||
- GraalVM distributions now set `GRAALVM_HOME` in addition to `JAVA_HOME`.
|
- GraalVM distributions now set `GRAALVM_HOME` in addition to `JAVA_HOME`.
|
||||||
- Invalid boolean values, unsupported distribution/package/platform combinations, and mismatched Maven toolchain ID counts now fail with targeted errors.
|
- Invalid boolean values, unsupported distribution/package/platform combinations, and mismatched Maven toolchain ID counts now fail with targeted errors.
|
||||||
@@ -89,7 +81,7 @@ steps:
|
|||||||
### Older versions
|
### Older versions
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> `actions/setup-java` versions `v1` through `v4` are deprecated. Upgrade workflows to `actions/setup-java@v5`, the latest stable release.
|
> `actions/setup-java` versions `v1` through `v4` are deprecated. Upgrade workflows to `actions/setup-java@v6`, the latest stable release.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -98,7 +90,7 @@ steps:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -110,7 +102,7 @@ steps:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: microsoft
|
distribution: microsoft
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -122,7 +114,7 @@ steps:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version-file: .java-version
|
java-version-file: .java-version
|
||||||
@@ -136,7 +128,7 @@ Supported version files are `.java-version`, `.tool-versions`, and `.sdkmanrc`.
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: latest
|
java-version: latest
|
||||||
@@ -159,7 +151,7 @@ steps:
|
|||||||
| `force-download` | Always download Java and replace any matching version in the tool cache. | `false` |
|
| `force-download` | Always download Java and replace any matching version in the tool cache. | `false` |
|
||||||
| `set-default` | Add Java to `PATH` and set `JAVA_HOME`. When `false`, only version-specific `JAVA_HOME_<major>_<arch>` variables are set. | `true` |
|
| `set-default` | Add Java to `PATH` and set `JAVA_HOME`. When `false`, only version-specific `JAVA_HOME_<major>_<arch>` variables are set. | `true` |
|
||||||
| `problem-matcher` | Register Java compiler and uncaught exception problem matchers. | `true` |
|
| `problem-matcher` | Register Java compiler and uncaught exception problem matchers. | `true` |
|
||||||
| `verify-signature` | Verify downloaded Java package signatures when supported. Currently supported for `temurin` and `microsoft`. | `false` |
|
| `verify-signature` | Verify downloaded Java package signatures when supported. Defaults to `true` for `temurin` and `microsoft`, and `false` for other distributions. | Automatically enabled for `temurin` and `microsoft` |
|
||||||
| `verify-signature-public-key` | ASCII-armored GPG public key to use for signature verification. Overrides the bundled key. | |
|
| `verify-signature-public-key` | ASCII-armored GPG public key to use for signature verification. Overrides the bundled key. | |
|
||||||
| `token` | Token for fetching GitHub.com-hosted version manifests, useful on GitHub Enterprise Server when unauthenticated requests are rate-limited. | `${{ github.token }}` on GitHub.com; empty string on GHES |
|
| `token` | Token for fetching GitHub.com-hosted version manifests, useful on GitHub Enterprise Server when unauthenticated requests are rate-limited. | `${{ github.token }}` on GitHub.com; empty string on GHES |
|
||||||
| `cache` | Enable dependency caching for `maven`, `gradle`, or `sbt`. | |
|
| `cache` | Enable dependency caching for `maven`, `gradle`, or `sbt`. | |
|
||||||
@@ -267,7 +259,7 @@ Set `cache` to `maven`, `gradle`, or `sbt` to cache dependencies with minimal co
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -286,7 +278,7 @@ The primary dependency cache key is `setup-java-<runner-os>-<node-arch>-<package
|
|||||||
Use `cache-dependency-path` to override the files used for key hashing, especially in monorepos:
|
Use `cache-dependency-path` to override the files used for key hashing, especially in monorepos:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -299,7 +291,7 @@ Use `cache-dependency-path` to override the files used for key hashing, especial
|
|||||||
Use `cache-path` when the build tool stores dependencies outside the default location:
|
Use `cache-path` when the build tool stores dependencies outside the default location:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -338,7 +330,7 @@ The JDK cache stores the downloaded JDK installation so later runs skip the down
|
|||||||
Set `cache-read-only: true` to restore dependency, wrapper, and JDK caches without saving changes in the post action. This is useful for pull requests, merge queues, short-lived branches, and matrix fan-out jobs that should only consume caches produced elsewhere.
|
Set `cache-read-only: true` to restore dependency, wrapper, and JDK caches without saving changes in the post action. This is useful for pull requests, merge queues, short-lived branches, and matrix fan-out jobs that should only consume caches produced elsewhere.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -354,7 +346,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -369,7 +361,7 @@ jobs:
|
|||||||
goal: [test, verify, package]
|
goal: [test, verify, package]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -387,7 +379,7 @@ env:
|
|||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -401,7 +393,7 @@ Install multiple Java versions by providing a multiline `java-version` value. Al
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: |
|
java-version: |
|
||||||
@@ -428,7 +420,7 @@ jobs:
|
|||||||
name: Java ${{ matrix.java }}
|
name: Java ${{ matrix.java }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
@@ -445,7 +437,7 @@ jobs:
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -467,7 +459,7 @@ required. See [Resolving Maven dependencies from custom repositories](docs/advan
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -522,7 +514,7 @@ The scripts and documentation in this project are released under the [MIT Licens
|
|||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
|
||||||
Contributions are welcome. See our [Contributor's Guide](docs/contributors.md).
|
Contributions are welcome. See our [Contributor's Guide](docs/CONTRIBUTING.md).
|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ function response(
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
|
jest.setTimeout(10_000);
|
||||||
|
|
||||||
let spyHttpClient: any;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: any;
|
let spyCoreError: any;
|
||||||
const originalGitHubToken = process.env.GITHUB_TOKEN;
|
const originalGitHubToken = process.env.GITHUB_TOKEN;
|
||||||
|
|||||||
@@ -398,13 +398,12 @@ describe('downloadTool', () => {
|
|||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('verifies signature when enabled', async () => {
|
it('verifies signatures by default', async () => {
|
||||||
const signedDistribution = new MicrosoftDistributions({
|
const signedDistribution = new MicrosoftDistributions({
|
||||||
version: '17',
|
version: '17',
|
||||||
architecture: 'x64',
|
architecture: 'x64',
|
||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false,
|
checkLatest: false
|
||||||
verifySignature: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await signedDistribution['downloadTool']({
|
await signedDistribution['downloadTool']({
|
||||||
|
|||||||
@@ -457,14 +457,13 @@ describe('downloadTool', () => {
|
|||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('verifies signature when enabled', async () => {
|
it('verifies signatures by default', async () => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{
|
||||||
version: '17',
|
version: '17',
|
||||||
architecture: 'x64',
|
architecture: 'x64',
|
||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false,
|
checkLatest: false
|
||||||
verifySignature: true
|
|
||||||
},
|
},
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
@@ -482,6 +481,27 @@ describe('downloadTool', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not verify signatures when explicitly disabled', async () => {
|
||||||
|
const distribution = new TemurinDistribution(
|
||||||
|
{
|
||||||
|
version: '17',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false,
|
||||||
|
verifySignature: false
|
||||||
|
},
|
||||||
|
TemurinImplementation.Hotspot
|
||||||
|
);
|
||||||
|
|
||||||
|
await distribution['downloadTool']({
|
||||||
|
version: '17.0.14+7',
|
||||||
|
url: 'https://example.com/jdk.tar.gz',
|
||||||
|
signatureUrl: 'https://example.com/jdk.tar.gz.sig'
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(spyVerifySignature).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
it('downloads and adds matching JMODs to the JDK', async () => {
|
it('downloads and adds matching JMODs to the JDK', async () => {
|
||||||
spyDownloadTool
|
spyDownloadTool
|
||||||
.mockResolvedValueOnce('/tmp/jdk.tar.gz')
|
.mockResolvedValueOnce('/tmp/jdk.tar.gz')
|
||||||
@@ -499,7 +519,8 @@ describe('downloadTool', () => {
|
|||||||
version: '25',
|
version: '25',
|
||||||
architecture: 'x64',
|
architecture: 'x64',
|
||||||
packageType: 'jdk+jmods',
|
packageType: 'jdk+jmods',
|
||||||
checkLatest: false
|
checkLatest: false,
|
||||||
|
verifySignature: false
|
||||||
},
|
},
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -161,6 +161,37 @@ describe('setup action orchestration', () => {
|
|||||||
expect(factory.getJavaDistribution).not.toHaveBeenCalled();
|
expect(factory.getJavaDistribution).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
['temurin', undefined, undefined],
|
||||||
|
['zulu', undefined, undefined],
|
||||||
|
['temurin', false, false],
|
||||||
|
['zulu', true, true]
|
||||||
|
])(
|
||||||
|
'passes signature verification input for %s with explicit value %s as %s',
|
||||||
|
async (distribution, explicitValue, expectedValue) => {
|
||||||
|
inputs.set('distribution', distribution);
|
||||||
|
multilineInputs.set('java-version', ['21']);
|
||||||
|
if (explicitValue !== undefined) {
|
||||||
|
inputs.set('verify-signature', String(explicitValue));
|
||||||
|
booleanInputs.set('verify-signature', explicitValue);
|
||||||
|
}
|
||||||
|
(factory.getJavaDistribution as jest.Mock).mockReturnValue({
|
||||||
|
setupJava: jest.fn(async () => ({
|
||||||
|
version: '21.0.4+7',
|
||||||
|
path: '/opt/java/21'
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
|
||||||
|
await run();
|
||||||
|
|
||||||
|
expect(factory.getJavaDistribution).toHaveBeenCalledWith(
|
||||||
|
distribution,
|
||||||
|
expect.objectContaining({verifySignature: expectedValue}),
|
||||||
|
''
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it('requires distribution when it cannot be inferred from the version file', async () => {
|
it('requires distribution when it cannot be inferred from the version file', async () => {
|
||||||
inputs.set('java-version-file', '.java-version');
|
inputs.set('java-version-file', '.java-version');
|
||||||
(fs.readFileSync as jest.Mock).mockReturnValue(Buffer.from('21'));
|
(fs.readFileSync as jest.Mock).mockReturnValue(Buffer.from('21'));
|
||||||
@@ -200,7 +231,6 @@ describe('setup action orchestration', () => {
|
|||||||
booleanInputs.set('check-latest', true);
|
booleanInputs.set('check-latest', true);
|
||||||
booleanInputs.set('force-download', true);
|
booleanInputs.set('force-download', true);
|
||||||
booleanInputs.set('set-default', false);
|
booleanInputs.set('set-default', false);
|
||||||
booleanInputs.set('verify-signature', true);
|
|
||||||
inputs.set('verify-signature-public-key', 'public-key');
|
inputs.set('verify-signature-public-key', 'public-key');
|
||||||
(fs.readFileSync as jest.Mock).mockReturnValue(
|
(fs.readFileSync as jest.Mock).mockReturnValue(
|
||||||
Buffer.from('java=21.0.5-tem')
|
Buffer.from('java=21.0.5-tem')
|
||||||
@@ -232,7 +262,7 @@ describe('setup action orchestration', () => {
|
|||||||
forceDownload: true,
|
forceDownload: true,
|
||||||
cacheJdk: false,
|
cacheJdk: false,
|
||||||
setDefault: false,
|
setDefault: false,
|
||||||
verifySignature: true,
|
verifySignature: undefined,
|
||||||
verifySignaturePublicKey: 'public-key'
|
verifySignaturePublicKey: 'public-key'
|
||||||
},
|
},
|
||||||
'/tmp/java.tar.gz'
|
'/tmp/java.tar.gz'
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ inputs:
|
|||||||
verify-signature:
|
verify-signature:
|
||||||
description: 'Verify downloaded Java package signatures when supported by the selected distribution'
|
description: 'Verify downloaded Java package signatures when supported by the selected distribution'
|
||||||
required: false
|
required: false
|
||||||
default: false
|
|
||||||
verify-signature-public-key:
|
verify-signature-public-key:
|
||||||
description: 'ASCII-armored GPG public key used to verify the downloaded package signature. Overrides the default bundled key for the selected distribution.'
|
description: 'ASCII-armored GPG public key used to verify the downloaded package signature. Overrides the default bundled key for the selected distribution.'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
Vendored
+58
-3
@@ -18680,12 +18680,26 @@ class XmlNode {
|
|||||||
this.child.push({ [node.tagname]: node.child });
|
this.child.push({ [node.tagname]: node.child });
|
||||||
}
|
}
|
||||||
// if requested, add the startIndex
|
// if requested, add the startIndex
|
||||||
|
this.addStartIndex(startIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
addStartIndex(startIndex) {
|
||||||
if (startIndex !== undefined) {
|
if (startIndex !== undefined) {
|
||||||
// Note: for now we just overwrite the metadata. If we had more complex metadata,
|
// Note: for now we just overwrite the metadata. If we had more complex metadata,
|
||||||
// we might need to do an object append here: metadata = { ...metadata, startIndex }
|
// we might need to do an object append here: metadata = { ...metadata, startIndex }
|
||||||
this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };
|
this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addEndIndex(endIndex) {
|
||||||
|
const lastChild = this.child[this.child.length - 1];
|
||||||
|
// endIndex is write-once: when updateTag drops a node, the last child is a
|
||||||
|
// previously completed sibling whose endIndex must not be overwritten
|
||||||
|
if (lastChild !== undefined && lastChild[METADATA_SYMBOL] !== undefined
|
||||||
|
&& lastChild[METADATA_SYMBOL].endIndex === undefined) {
|
||||||
|
lastChild[METADATA_SYMBOL].endIndex = endIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
/** symbol used for metadata */
|
/** symbol used for metadata */
|
||||||
static getMetaDataSymbol() {
|
static getMetaDataSymbol() {
|
||||||
return METADATA_SYMBOL;
|
return METADATA_SYMBOL;
|
||||||
@@ -18718,8 +18732,23 @@ class DocTypeReader {
|
|||||||
i = i + 9;
|
i = i + 9;
|
||||||
let angleBracketsCount = 1;
|
let angleBracketsCount = 1;
|
||||||
let hasBody = false, comment = false;
|
let hasBody = false, comment = false;
|
||||||
|
let quoteChar = null; // tracks an open SYSTEM/PUBLIC literal before the '[' body
|
||||||
let exp = "";
|
let exp = "";
|
||||||
for (; i < xmlData.length; i++) {
|
for (; i < xmlData.length; i++) {
|
||||||
|
// Inside a quoted external-identifier literal — XML allows '<'
|
||||||
|
// and '>' as plain data here, so they must not be interpreted
|
||||||
|
// as DOCTYPE structure until the matching quote closes.
|
||||||
|
if (quoteChar !== null) {
|
||||||
|
if (xmlData[i] === quoteChar) quoteChar = null;
|
||||||
|
exp += xmlData[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!hasBody && !comment && (xmlData[i] === '"' || xmlData[i] === "'")) {
|
||||||
|
quoteChar = xmlData[i];
|
||||||
|
exp += xmlData[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
||||||
if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
|
if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
|
||||||
i += 7;
|
i += 7;
|
||||||
@@ -18774,7 +18803,7 @@ class DocTypeReader {
|
|||||||
exp += xmlData[i];
|
exp += xmlData[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (angleBracketsCount !== 0) {
|
if (quoteChar !== null || angleBracketsCount !== 0) {
|
||||||
throw new Error(`Unclosed DOCTYPE`);
|
throw new Error(`Unclosed DOCTYPE`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -19489,7 +19518,11 @@ function resolveEnotation(str, trimmedStr, options) {
|
|||||||
*/
|
*/
|
||||||
function trimZeros(numStr) {
|
function trimZeros(numStr) {
|
||||||
if (numStr && numStr.indexOf(".") !== -1) {//float
|
if (numStr && numStr.indexOf(".") !== -1) {//float
|
||||||
numStr = numStr.replace(/0+$/, ""); //remove ending zeros
|
//remove ending zeros without the O(n^2) backtracking that /0+$/ hits
|
||||||
|
//when the string doesn't end in 0 but has a long internal zero-run
|
||||||
|
let end = numStr.length;
|
||||||
|
while (end > 0 && numStr.charCodeAt(end - 1) === 48 /* '0' */) end--;
|
||||||
|
numStr = numStr.slice(0, end);
|
||||||
if (numStr === ".") numStr = "0";
|
if (numStr === ".") numStr = "0";
|
||||||
else if (numStr[0] === ".") numStr = "0" + numStr;
|
else if (numStr[0] === ".") numStr = "0" + numStr;
|
||||||
else if (numStr[numStr.length - 1] === ".") numStr = numStr.substring(0, numStr.length - 1);
|
else if (numStr[numStr.length - 1] === ".") numStr = numStr.substring(0, numStr.length - 1);
|
||||||
@@ -22965,7 +22998,12 @@ const parseXml = function (xmlData) {
|
|||||||
this.matcher.pop();
|
this.matcher.pop();
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag when closing tag
|
this.isCurrentNodeStopNode = false; // Reset flag when closing tag
|
||||||
|
|
||||||
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
//a closing tag with no matching opening tag leaves the stack empty
|
||||||
|
currentNode = this.tagsNodeStack.pop() || xmlObj;//avoid recursion, set the parent tag scope
|
||||||
|
|
||||||
|
if (options.captureMetaData && currentNode) {
|
||||||
|
currentNode.addEndIndex(closeIndex + 1);
|
||||||
|
}
|
||||||
textData = "";
|
textData = "";
|
||||||
i = closeIndex;
|
i = closeIndex;
|
||||||
} else if (c1 === 63) { //'?'
|
} else if (c1 === 63) { //'?'
|
||||||
@@ -22991,6 +23029,11 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = attsMap
|
childNode[":@"] = attsMap
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
// closeIndex points at '?' of the closing '?>'
|
||||||
|
currentNode.addEndIndex(tagData.closeIndex + 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -23155,6 +23198,10 @@ const parseXml = function (xmlData) {
|
|||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
|
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(i + 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//selfClosing tag
|
//selfClosing tag
|
||||||
if (isSelfClosing) {
|
if (isSelfClosing) {
|
||||||
@@ -23165,6 +23212,10 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = prefixedAttrs;
|
childNode[":@"] = prefixedAttrs;
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(closeIndex + 1);
|
||||||
|
}
|
||||||
this.matcher.pop(); // Pop self-closing tag
|
this.matcher.pop(); // Pop self-closing tag
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
}
|
}
|
||||||
@@ -23174,6 +23225,10 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = prefixedAttrs;
|
childNode[":@"] = prefixedAttrs;
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(result.closeIndex + 1);
|
||||||
|
}
|
||||||
this.matcher.pop(); // Pop unpaired tag
|
this.matcher.pop(); // Pop unpaired tag
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
i = result.closeIndex;
|
i = result.closeIndex;
|
||||||
|
|||||||
Vendored
+3
-4
@@ -35575,6 +35575,9 @@ function _unique(values) {
|
|||||||
/******/ __nccwpck_require__.m = __webpack_modules__;
|
/******/ __nccwpck_require__.m = __webpack_modules__;
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/asset-relocator-loader */
|
||||||
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = decodeURIComponent(new URL('.', import.meta.url).pathname).slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
|
||||||
|
/******/
|
||||||
/******/ /* webpack/runtime/compat get default export */
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
@@ -35667,10 +35670,6 @@ function _unique(values) {
|
|||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
/******/ /* webpack/runtime/compat */
|
|
||||||
/******/
|
|
||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
|
|
||||||
/******/
|
|
||||||
/******/ /* webpack/runtime/import chunk loading */
|
/******/ /* webpack/runtime/import chunk loading */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // no baseURI
|
/******/ // no baseURI
|
||||||
|
|||||||
Vendored
+2
-1
@@ -244,7 +244,8 @@ class JavaBase {
|
|||||||
installerOptions.setDefault !== undefined
|
installerOptions.setDefault !== undefined
|
||||||
? installerOptions.setDefault
|
? installerOptions.setDefault
|
||||||
: true;
|
: true;
|
||||||
this.verifySignature = installerOptions.verifySignature ?? false;
|
this.verifySignature =
|
||||||
|
installerOptions.verifySignature ?? this.supportsSignatureVerification();
|
||||||
this.verifySignaturePublicKey = installerOptions.verifySignaturePublicKey;
|
this.verifySignaturePublicKey = installerOptions.verifySignaturePublicKey;
|
||||||
}
|
}
|
||||||
async downloadAndVerify(javaRelease) {
|
async downloadAndVerify(javaRelease) {
|
||||||
|
|||||||
Vendored
+58
-3
@@ -741,12 +741,26 @@ class XmlNode {
|
|||||||
this.child.push({ [node.tagname]: node.child });
|
this.child.push({ [node.tagname]: node.child });
|
||||||
}
|
}
|
||||||
// if requested, add the startIndex
|
// if requested, add the startIndex
|
||||||
|
this.addStartIndex(startIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
addStartIndex(startIndex) {
|
||||||
if (startIndex !== undefined) {
|
if (startIndex !== undefined) {
|
||||||
// Note: for now we just overwrite the metadata. If we had more complex metadata,
|
// Note: for now we just overwrite the metadata. If we had more complex metadata,
|
||||||
// we might need to do an object append here: metadata = { ...metadata, startIndex }
|
// we might need to do an object append here: metadata = { ...metadata, startIndex }
|
||||||
this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };
|
this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addEndIndex(endIndex) {
|
||||||
|
const lastChild = this.child[this.child.length - 1];
|
||||||
|
// endIndex is write-once: when updateTag drops a node, the last child is a
|
||||||
|
// previously completed sibling whose endIndex must not be overwritten
|
||||||
|
if (lastChild !== undefined && lastChild[METADATA_SYMBOL] !== undefined
|
||||||
|
&& lastChild[METADATA_SYMBOL].endIndex === undefined) {
|
||||||
|
lastChild[METADATA_SYMBOL].endIndex = endIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
/** symbol used for metadata */
|
/** symbol used for metadata */
|
||||||
static getMetaDataSymbol() {
|
static getMetaDataSymbol() {
|
||||||
return METADATA_SYMBOL;
|
return METADATA_SYMBOL;
|
||||||
@@ -781,8 +795,23 @@ class DocTypeReader {
|
|||||||
i = i + 9;
|
i = i + 9;
|
||||||
let angleBracketsCount = 1;
|
let angleBracketsCount = 1;
|
||||||
let hasBody = false, comment = false;
|
let hasBody = false, comment = false;
|
||||||
|
let quoteChar = null; // tracks an open SYSTEM/PUBLIC literal before the '[' body
|
||||||
let exp = "";
|
let exp = "";
|
||||||
for (; i < xmlData.length; i++) {
|
for (; i < xmlData.length; i++) {
|
||||||
|
// Inside a quoted external-identifier literal — XML allows '<'
|
||||||
|
// and '>' as plain data here, so they must not be interpreted
|
||||||
|
// as DOCTYPE structure until the matching quote closes.
|
||||||
|
if (quoteChar !== null) {
|
||||||
|
if (xmlData[i] === quoteChar) quoteChar = null;
|
||||||
|
exp += xmlData[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!hasBody && !comment && (xmlData[i] === '"' || xmlData[i] === "'")) {
|
||||||
|
quoteChar = xmlData[i];
|
||||||
|
exp += xmlData[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
||||||
if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
|
if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
|
||||||
i += 7;
|
i += 7;
|
||||||
@@ -837,7 +866,7 @@ class DocTypeReader {
|
|||||||
exp += xmlData[i];
|
exp += xmlData[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (angleBracketsCount !== 0) {
|
if (quoteChar !== null || angleBracketsCount !== 0) {
|
||||||
throw new Error(`Unclosed DOCTYPE`);
|
throw new Error(`Unclosed DOCTYPE`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1552,7 +1581,11 @@ function resolveEnotation(str, trimmedStr, options) {
|
|||||||
*/
|
*/
|
||||||
function trimZeros(numStr) {
|
function trimZeros(numStr) {
|
||||||
if (numStr && numStr.indexOf(".") !== -1) {//float
|
if (numStr && numStr.indexOf(".") !== -1) {//float
|
||||||
numStr = numStr.replace(/0+$/, ""); //remove ending zeros
|
//remove ending zeros without the O(n^2) backtracking that /0+$/ hits
|
||||||
|
//when the string doesn't end in 0 but has a long internal zero-run
|
||||||
|
let end = numStr.length;
|
||||||
|
while (end > 0 && numStr.charCodeAt(end - 1) === 48 /* '0' */) end--;
|
||||||
|
numStr = numStr.slice(0, end);
|
||||||
if (numStr === ".") numStr = "0";
|
if (numStr === ".") numStr = "0";
|
||||||
else if (numStr[0] === ".") numStr = "0" + numStr;
|
else if (numStr[0] === ".") numStr = "0" + numStr;
|
||||||
else if (numStr[numStr.length - 1] === ".") numStr = numStr.substring(0, numStr.length - 1);
|
else if (numStr[numStr.length - 1] === ".") numStr = numStr.substring(0, numStr.length - 1);
|
||||||
@@ -5032,7 +5065,12 @@ const parseXml = function (xmlData) {
|
|||||||
this.matcher.pop();
|
this.matcher.pop();
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag when closing tag
|
this.isCurrentNodeStopNode = false; // Reset flag when closing tag
|
||||||
|
|
||||||
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
//a closing tag with no matching opening tag leaves the stack empty
|
||||||
|
currentNode = this.tagsNodeStack.pop() || xmlObj;//avoid recursion, set the parent tag scope
|
||||||
|
|
||||||
|
if (options.captureMetaData && currentNode) {
|
||||||
|
currentNode.addEndIndex(closeIndex + 1);
|
||||||
|
}
|
||||||
textData = "";
|
textData = "";
|
||||||
i = closeIndex;
|
i = closeIndex;
|
||||||
} else if (c1 === 63) { //'?'
|
} else if (c1 === 63) { //'?'
|
||||||
@@ -5058,6 +5096,11 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = attsMap
|
childNode[":@"] = attsMap
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
// closeIndex points at '?' of the closing '?>'
|
||||||
|
currentNode.addEndIndex(tagData.closeIndex + 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -5222,6 +5265,10 @@ const parseXml = function (xmlData) {
|
|||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
|
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(i + 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//selfClosing tag
|
//selfClosing tag
|
||||||
if (isSelfClosing) {
|
if (isSelfClosing) {
|
||||||
@@ -5232,6 +5279,10 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = prefixedAttrs;
|
childNode[":@"] = prefixedAttrs;
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(closeIndex + 1);
|
||||||
|
}
|
||||||
this.matcher.pop(); // Pop self-closing tag
|
this.matcher.pop(); // Pop self-closing tag
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
}
|
}
|
||||||
@@ -5241,6 +5292,10 @@ const parseXml = function (xmlData) {
|
|||||||
childNode[":@"] = prefixedAttrs;
|
childNode[":@"] = prefixedAttrs;
|
||||||
}
|
}
|
||||||
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
|
||||||
|
|
||||||
|
if (options.captureMetaData) {
|
||||||
|
currentNode.addEndIndex(result.closeIndex + 1);
|
||||||
|
}
|
||||||
this.matcher.pop(); // Pop unpaired tag
|
this.matcher.pop(); // Pop unpaired tag
|
||||||
this.isCurrentNodeStopNode = false; // Reset flag
|
this.isCurrentNodeStopNode = false; // Reset flag
|
||||||
i = result.closeIndex;
|
i = result.closeIndex;
|
||||||
|
|||||||
Vendored
+10
-5
@@ -36065,6 +36065,9 @@ function _unique(values) {
|
|||||||
/******/ __nccwpck_require__.m = __webpack_modules__;
|
/******/ __nccwpck_require__.m = __webpack_modules__;
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/asset-relocator-loader */
|
||||||
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = decodeURIComponent(new URL('.', import.meta.url).pathname).slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
|
||||||
|
/******/
|
||||||
/******/ /* webpack/runtime/compat get default export */
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
@@ -36157,10 +36160,6 @@ function _unique(values) {
|
|||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
/******/ /* webpack/runtime/compat */
|
|
||||||
/******/
|
|
||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
|
|
||||||
/******/
|
|
||||||
/******/ /* webpack/runtime/import chunk loading */
|
/******/ /* webpack/runtime/import chunk loading */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // no baseURI
|
/******/ // no baseURI
|
||||||
@@ -36376,7 +36375,6 @@ async function run() {
|
|||||||
const checkLatest = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_CHECK_LATEST */.YM, false);
|
const checkLatest = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_CHECK_LATEST */.YM, false);
|
||||||
const forceDownload = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_FORCE_DOWNLOAD */.I9, false);
|
const forceDownload = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_FORCE_DOWNLOAD */.I9, false);
|
||||||
const setDefault = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_SET_DEFAULT */.E8, true);
|
const setDefault = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_SET_DEFAULT */.E8, true);
|
||||||
const verifySignature = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_VERIFY_SIGNATURE */.qy, false);
|
|
||||||
const verifySignaturePublicKey = setup_java_core/* getInput */.V4(constants/* INPUT_VERIFY_SIGNATURE_PUBLIC_KEY */.u) || undefined;
|
const verifySignaturePublicKey = setup_java_core/* getInput */.V4(constants/* INPUT_VERIFY_SIGNATURE_PUBLIC_KEY */.u) || undefined;
|
||||||
const toolchainIds = setup_java_core/* getMultilineInput */.q3(constants/* INPUT_MVN_TOOLCHAIN_ID */.nr);
|
const toolchainIds = setup_java_core/* getMultilineInput */.q3(constants/* INPUT_MVN_TOOLCHAIN_ID */.nr);
|
||||||
let actionError;
|
let actionError;
|
||||||
@@ -36404,6 +36402,7 @@ async function run() {
|
|||||||
else if (!distributionName) {
|
else if (!distributionName) {
|
||||||
throw new Error('distribution input is required when not specified in the version file');
|
throw new Error('distribution input is required when not specified in the version file');
|
||||||
}
|
}
|
||||||
|
const verifySignature = getVerifySignatureInput();
|
||||||
const installerInputsOptions = {
|
const installerInputsOptions = {
|
||||||
architecture,
|
architecture,
|
||||||
packageType,
|
packageType,
|
||||||
@@ -36428,6 +36427,7 @@ async function run() {
|
|||||||
if (!distributionName) {
|
if (!distributionName) {
|
||||||
throw new Error('distribution input is required');
|
throw new Error('distribution input is required');
|
||||||
}
|
}
|
||||||
|
const verifySignature = getVerifySignatureInput();
|
||||||
const installerInputsOptions = {
|
const installerInputsOptions = {
|
||||||
architecture,
|
architecture,
|
||||||
packageType,
|
packageType,
|
||||||
@@ -36492,6 +36492,11 @@ function getJdkFileInput() {
|
|||||||
}
|
}
|
||||||
return jdkFile || deprecatedJdkFile;
|
return jdkFile || deprecatedJdkFile;
|
||||||
}
|
}
|
||||||
|
function getVerifySignatureInput() {
|
||||||
|
return setup_java_core/* getInput */.V4(constants/* INPUT_VERIFY_SIGNATURE */.qy).trim()
|
||||||
|
? (0,util/* getBooleanInput */.Vt)(constants/* INPUT_VERIFY_SIGNATURE */.qy)
|
||||||
|
: undefined;
|
||||||
|
}
|
||||||
async function installVersion(version, options, toolchainId = 0) {
|
async function installVersion(version, options, toolchainId = 0) {
|
||||||
const { distributionName, jdkFile, architecture, packageType, checkLatest, forceDownload, cacheJdk, setDefault, verifySignature, verifySignaturePublicKey, toolchainIds } = options;
|
const { distributionName, jdkFile, architecture, packageType, checkLatest, forceDownload, cacheJdk, setDefault, verifySignature, verifySignaturePublicKey, toolchainIds } = options;
|
||||||
const installerOptions = {
|
const installerOptions = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Contributors
|
# Contributing
|
||||||
|
|
||||||
Thank you for contributing!
|
Thank you for contributing!
|
||||||
|
|
||||||
@@ -39,15 +39,6 @@
|
|||||||
|
|
||||||
See [action.yml](../action.yml) for more details on task inputs.
|
See [action.yml](../action.yml) for more details on task inputs.
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> The examples on this page reference `actions/setup-java@v6`, which is still in
|
|
||||||
> development on the `main` branch and is not yet published as a release tag. To
|
|
||||||
> try the V6 features documented here (`cache-jdk`, `force-download`,
|
|
||||||
> `problem-matcher`, `cache-path`, `cache-read-only`, `java-version: latest`,
|
|
||||||
> `oracle-openjdk`, and the `*-env-var` input names), reference
|
|
||||||
> `actions/setup-java@main`. For production workflows use the latest stable
|
|
||||||
> release, `actions/setup-java@v5`, as shown in the [README](../README.md).
|
|
||||||
|
|
||||||
## Selecting a Java distribution
|
## Selecting a Java distribution
|
||||||
`java-version` and `distribution` select what gets installed. `java-version` may be replaced by `java-version-file`, and `distribution` is optional only when `java-version-file` points to a `.sdkmanrc` or `.tool-versions` file that carries a recognized vendor identifier. In every other case both inputs must be provided. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
`java-version` and `distribution` select what gets installed. `java-version` may be replaced by `java-version-file`, and `distribution` is optional only when `java-version-file` points to a `.sdkmanrc` or `.tool-versions` file that carries a recognized vendor identifier. In every other case both inputs must be provided. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
||||||
|
|
||||||
|
|||||||
Generated
+24
-24
@@ -16,21 +16,21 @@
|
|||||||
"@actions/http-client": "^4.0.1",
|
"@actions/http-client": "^4.0.1",
|
||||||
"@actions/io": "^3.0.2",
|
"@actions/io": "^3.0.2",
|
||||||
"@actions/tool-cache": "^4.0.0",
|
"@actions/tool-cache": "^4.0.0",
|
||||||
"fast-xml-parser": "^5.10.1",
|
"fast-xml-parser": "^5.11.0",
|
||||||
"semver": "^7.8.5"
|
"semver": "^7.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@jest/globals": "^30.4.1",
|
"@jest/globals": "^30.4.1",
|
||||||
"@types/node": "^26.1.1",
|
"@types/node": "^26.2.0",
|
||||||
"@types/semver": "^7.8.0",
|
"@types/semver": "^7.8.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
||||||
"@typescript-eslint/parser": "^8.65.0",
|
"@typescript-eslint/parser": "^8.65.0",
|
||||||
"@vercel/ncc": "^0.44.0",
|
"@vercel/ncc": "^0.45.0",
|
||||||
"eslint": "^10.7.0",
|
"eslint": "^10.7.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-jest": "^29.15.4",
|
"eslint-plugin-jest": "^29.16.1",
|
||||||
"eslint-plugin-n": "^18.2.2",
|
"eslint-plugin-n": "^18.3.0",
|
||||||
"globals": "^17.9.0",
|
"globals": "^17.9.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jest": "^30.4.2",
|
"jest": "^30.4.2",
|
||||||
@@ -1726,9 +1726,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "26.1.2",
|
"version": "26.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz",
|
||||||
"integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==",
|
"integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2364,9 +2364,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@vercel/ncc": {
|
"node_modules/@vercel/ncc": {
|
||||||
"version": "0.44.1",
|
"version": "0.45.0",
|
||||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.44.1.tgz",
|
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.45.0.tgz",
|
||||||
"integrity": "sha512-cUjIE5P2YY1n+Kt9rFIazMMpGoPn1Fic04rOmTkElMkiDP5oszGfERMpo2shVkFKDL7rVppdM2pqJKC59shQWQ==",
|
"integrity": "sha512-8zPi1yO2mHpoKTD+e+Bf0ZT3e+sWHSOyGapm9s7b5R0gxJi3CiFTqmeQiMEyu6ejrz2s09M8JkEoUaTWjBJPQQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -3123,9 +3123,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-jest": {
|
"node_modules/eslint-plugin-jest": {
|
||||||
"version": "29.16.0",
|
"version": "29.16.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.1.tgz",
|
||||||
"integrity": "sha512-0WFBxDHlT2ratGQfnFQEVIsgQJ5cfd+0IV8Kc6U3X2onB8ATLG23voD2Ch5G9fCkEpCPmCMuzW0tbS0kYb8biw==",
|
"integrity": "sha512-tfxOIsjzaBud+f74aLbBMRcnrztt5eCIgnAdeoGdnzMAQ4IdAa/s/p8Ls55mk9MC79N3j2jbv4Qetz6Hclbcfw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3153,9 +3153,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-n": {
|
"node_modules/eslint-plugin-n": {
|
||||||
"version": "18.2.2",
|
"version": "18.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.3.0.tgz",
|
||||||
"integrity": "sha512-gOO0lIqwEjZ750kv9/SptCWArUoAZXJoBr0vYWTO2dCBxctHUXlBIigiC8xuxxr/NKqgIT6Ehz1xRcilj8a5cA==",
|
"integrity": "sha512-cPVguuDe6DrIPb/qUXHf8P89MaVTUmiYWwpt5gX5AILsvRIiZAxMFXcFR6QHYBksqKJpjfUBlL/RleCJUWcD7w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3463,9 +3463,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-xml-parser": {
|
"node_modules/fast-xml-parser": {
|
||||||
"version": "5.10.1",
|
"version": "5.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.11.0.tgz",
|
||||||
"integrity": "sha512-IEMIf7298kXuZSRFoGfMYrl7is8LpavODgbNz1cwIudv7KwVFnuU+UsMporfq6PD6aXSlawZlARiA3UywCTfMw==",
|
"integrity": "sha512-9IGxMqvqLOnqP+Egi1nqDHKv5k8aZ7r9n558enxcucmyVGEBNPAU+MOg/8jPIS7rO7sSq4gFm1/nHtiaubMruw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -3478,7 +3478,7 @@
|
|||||||
"fast-xml-builder": "^1.2.0",
|
"fast-xml-builder": "^1.2.0",
|
||||||
"is-unsafe": "^2.0.0",
|
"is-unsafe": "^2.0.0",
|
||||||
"path-expression-matcher": "^1.6.2",
|
"path-expression-matcher": "^1.6.2",
|
||||||
"strnum": "^2.4.1",
|
"strnum": "^2.4.2",
|
||||||
"xml-naming": "^0.3.0"
|
"xml-naming": "^0.3.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -5530,9 +5530,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/strnum": {
|
"node_modules/strnum": {
|
||||||
"version": "2.4.1",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.2.tgz",
|
||||||
"integrity": "sha512-M9eUSMT2dCB2cTNPG7UYj6KuK7RJR2SN2+yCV/fTW3xzTCS6EaGZ5pSMgDIjB7r8zSfTGk+dvvn9rTjpVS9Mwg==",
|
"integrity": "sha512-rDG3Ah4TV0k1hWvLSzkZtMmLN9+eS+h3knq4MP6A42Y3Yh5qGNnOUs1jJkoSr8FG5dsL28c7KgkIBzSEykqtuw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
|
|||||||
+5
-5
@@ -49,21 +49,21 @@
|
|||||||
"@actions/http-client": "^4.0.1",
|
"@actions/http-client": "^4.0.1",
|
||||||
"@actions/io": "^3.0.2",
|
"@actions/io": "^3.0.2",
|
||||||
"@actions/tool-cache": "^4.0.0",
|
"@actions/tool-cache": "^4.0.0",
|
||||||
"fast-xml-parser": "^5.10.1",
|
"fast-xml-parser": "^5.11.0",
|
||||||
"semver": "^7.8.5"
|
"semver": "^7.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@jest/globals": "^30.4.1",
|
"@jest/globals": "^30.4.1",
|
||||||
"@types/node": "^26.1.1",
|
"@types/node": "^26.2.0",
|
||||||
"@types/semver": "^7.8.0",
|
"@types/semver": "^7.8.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
||||||
"@typescript-eslint/parser": "^8.65.0",
|
"@typescript-eslint/parser": "^8.65.0",
|
||||||
"@vercel/ncc": "^0.44.0",
|
"@vercel/ncc": "^0.45.0",
|
||||||
"eslint": "^10.7.0",
|
"eslint": "^10.7.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-jest": "^29.15.4",
|
"eslint-plugin-jest": "^29.16.1",
|
||||||
"eslint-plugin-n": "^18.2.2",
|
"eslint-plugin-n": "^18.3.0",
|
||||||
"globals": "^17.9.0",
|
"globals": "^17.9.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jest": "^30.4.2",
|
"jest": "^30.4.2",
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ export abstract class JavaBase {
|
|||||||
installerOptions.setDefault !== undefined
|
installerOptions.setDefault !== undefined
|
||||||
? installerOptions.setDefault
|
? installerOptions.setDefault
|
||||||
: true;
|
: true;
|
||||||
this.verifySignature = installerOptions.verifySignature ?? false;
|
this.verifySignature =
|
||||||
|
installerOptions.verifySignature ?? this.supportsSignatureVerification();
|
||||||
this.verifySignaturePublicKey = installerOptions.verifySignaturePublicKey;
|
this.verifySignaturePublicKey = installerOptions.verifySignaturePublicKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -29,10 +29,6 @@ export async function run() {
|
|||||||
const checkLatest = getBooleanInput(constants.INPUT_CHECK_LATEST, false);
|
const checkLatest = getBooleanInput(constants.INPUT_CHECK_LATEST, false);
|
||||||
const forceDownload = getBooleanInput(constants.INPUT_FORCE_DOWNLOAD, false);
|
const forceDownload = getBooleanInput(constants.INPUT_FORCE_DOWNLOAD, false);
|
||||||
const setDefault = getBooleanInput(constants.INPUT_SET_DEFAULT, true);
|
const setDefault = getBooleanInput(constants.INPUT_SET_DEFAULT, true);
|
||||||
const verifySignature = getBooleanInput(
|
|
||||||
constants.INPUT_VERIFY_SIGNATURE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
const verifySignaturePublicKey =
|
const verifySignaturePublicKey =
|
||||||
core.getInput(constants.INPUT_VERIFY_SIGNATURE_PUBLIC_KEY) || undefined;
|
core.getInput(constants.INPUT_VERIFY_SIGNATURE_PUBLIC_KEY) || undefined;
|
||||||
const toolchainIds = core.getMultilineInput(constants.INPUT_MVN_TOOLCHAIN_ID);
|
const toolchainIds = core.getMultilineInput(constants.INPUT_MVN_TOOLCHAIN_ID);
|
||||||
@@ -80,6 +76,8 @@ export async function run() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const verifySignature = getVerifySignatureInput();
|
||||||
|
|
||||||
const installerInputsOptions: installerInputsOptions = {
|
const installerInputsOptions: installerInputsOptions = {
|
||||||
architecture,
|
architecture,
|
||||||
packageType,
|
packageType,
|
||||||
@@ -107,6 +105,8 @@ export async function run() {
|
|||||||
throw new Error('distribution input is required');
|
throw new Error('distribution input is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const verifySignature = getVerifySignatureInput();
|
||||||
|
|
||||||
const installerInputsOptions: installerInputsOptions = {
|
const installerInputsOptions: installerInputsOptions = {
|
||||||
architecture,
|
architecture,
|
||||||
packageType,
|
packageType,
|
||||||
@@ -192,6 +192,12 @@ function getJdkFileInput(): string {
|
|||||||
return jdkFile || deprecatedJdkFile;
|
return jdkFile || deprecatedJdkFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getVerifySignatureInput(): boolean | undefined {
|
||||||
|
return core.getInput(constants.INPUT_VERIFY_SIGNATURE).trim()
|
||||||
|
? getBooleanInput(constants.INPUT_VERIFY_SIGNATURE)
|
||||||
|
: undefined;
|
||||||
|
}
|
||||||
|
|
||||||
async function installVersion(
|
async function installVersion(
|
||||||
version: string,
|
version: string,
|
||||||
options: installerInputsOptions,
|
options: installerInputsOptions,
|
||||||
@@ -263,7 +269,7 @@ interface installerInputsOptions {
|
|||||||
forceDownload: boolean;
|
forceDownload: boolean;
|
||||||
cacheJdk: boolean;
|
cacheJdk: boolean;
|
||||||
setDefault: boolean;
|
setDefault: boolean;
|
||||||
verifySignature: boolean;
|
verifySignature: boolean | undefined;
|
||||||
verifySignaturePublicKey: string | undefined;
|
verifySignaturePublicKey: string | undefined;
|
||||||
distributionName: string;
|
distributionName: string;
|
||||||
jdkFile: string;
|
jdkFile: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user