diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 06939361e..000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,6 +0,0 @@
-# Ignore list
-/*
-
-# Do not ignore these folders:
-!__tests__/
-!src/
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 293128e6e..000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
-module.exports = {
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:eslint-plugin-jest/recommended',
- 'eslint-config-prettier'
- ],
- parser: '@typescript-eslint/parser',
- plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
- rules: {
- '@typescript-eslint/no-require-imports': 'error',
- '@typescript-eslint/no-non-null-assertion': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-empty-function': 'off',
- '@typescript-eslint/ban-ts-comment': [
- 'error',
- {
- 'ts-ignore': 'allow-with-description'
- }
- ],
- 'no-console': 'error',
- 'yoda': 'error',
- 'prefer-const': [
- 'error',
- {
- destructuring: 'all'
- }
- ],
- 'no-control-regex': 'off',
- 'no-constant-condition': ['error', {checkLoops: false}],
- 'node/no-extraneous-import': 'error'
- },
- overrides: [
- {
- files: ['**/*{test,spec}.ts'],
- rules: {
- '@typescript-eslint/no-unused-vars': 'off',
- 'jest/no-standalone-expect': 'off',
- 'jest/no-conditional-expect': 'off',
- 'no-console': 'off',
-
- }
- }
- ],
- env: {
- node: true,
- es6: true,
- 'jest/globals': true
- }
-};
diff --git a/.github/ISSUE_TEMPLATE/new_distribution_request.md b/.github/ISSUE_TEMPLATE/new_distribution_request.md
new file mode 100644
index 000000000..f5d7c7faf
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new_distribution_request.md
@@ -0,0 +1,22 @@
+---
+name: New Java distribution template
+about: Suggest a new Java distribution
+title: ''
+labels: feature request, needs triage
+assignees: ''
+---
+
+**Description:**
+Describe your proposal.
+
+**Justification:**
+Justification or a use case for your proposal.
+
+**Download URL:**
+Download URL for the new distribution.
+
+**License:**
+Link to the license for the new distribution.
+
+**Are you willing to submit a PR?**
+
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE/new_distribution_pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/new_distribution_pull_request_template.md
new file mode 100644
index 000000000..4e3b44372
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/new_distribution_pull_request_template.md
@@ -0,0 +1,16 @@
+**Description:**
+Describe your changes.
+
+**Related issue:**
+Add link to the related issue.
+
+**Download URL:**
+Download URL for the new distribution.
+
+**License:**
+Link to the license for the new distribution.
+
+**Check list:**
+- [ ] Mark if documentation changes are required.
+- [ ] Mark if tests were added or updated to cover the changes.
+- [ ] Mark if new distribution is being added.
\ No newline at end of file
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 000000000..7fdefa038
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,43 @@
+# Copilot instructions
+
+## Build, test, and lint
+
+Use Node.js 24 or later (`package.json` declares `>=24.0.0`).
+
+- `npm ci` installs the locked dependencies.
+- `npm test` runs Jest serially with coverage.
+- `npm test -- --runTestsByPath __tests__/setup-java.test.ts` runs one test file.
+- `npm test -- --runTestsByPath __tests__/setup-java.test.ts --testNamePattern="pattern"` filters that file to matching test names.
+- `npm run lint` runs ESLint on TypeScript files.
+- `npm run format-check` checks Prettier formatting; `npm run format` applies it.
+- `npm run build` bundles the setup and post-job entrypoints into `dist/`.
+- `npm run check` runs format check, lint, build, and the full test suite.
+
+## Architecture
+
+This repository implements a Node.js GitHub Action. `action.yml` defines its inputs and outputs and runs `dist/setup/index.js` as the main entrypoint and `dist/cleanup/index.js` as the post-job entrypoint. The TypeScript sources in `src/` are bundled with NCC; the committed `dist/` files are what the action executes.
+
+The setup entrypoint parses inputs, resolves versions, and configures the action's shared features. `src/distributions/distribution-factory.ts` lazily selects a vendor installer. Vendor installers implement metadata lookup and archive handling on top of `JavaBase` in `src/distributions/base-installer.ts`, which centralizes version resolution, tool-cache/JDK-cache use, download verification, and Java environment setup. Package support and OS/architecture support are validated centrally in `package-types.ts` and `platform-types.ts`.
+
+The setup flow also configures problem matchers, Maven authentication and arguments, and Maven toolchains. The post-job entrypoint removes any isolated GPG home and saves enabled caches when the job succeeds and cache saving is not read-only.
+
+## Repository-specific conventions
+
+- Keep TypeScript source imports ESM-compatible: relative imports include the `.js` extension, even when the source file is `.ts`.
+- Distribution-specific download and metadata logic belongs in its installer under `src/distributions/`; reuse `JavaBase` rather than duplicating common resolution, caching, verification, or environment behavior.
+- When adding or changing distribution support, keep the distribution enum, factory, package-capability map, platform-capability map, README support documentation, unit tests, and relevant end-to-end workflow coverage consistent.
+- Unit tests live under `__tests__/` and use Jest/ts-jest. Distribution tests are grouped under `__tests__/distributors/`; use the corresponding test and fixture patterns when changing an installer. End-to-end coverage is defined in `.github/workflows/e2e-*.yml`.
+- Rebuild and commit generated `dist/` bundles for runtime-affecting source or dependency changes; do not make the bundles the source of truth. `npm run check` includes the build.
+- New npm dependencies need lockfile changes and corresponding license records under `.licenses/`, following `.licensed.yml` and the licensed workflow.
+
+## Action behavior principles
+
+- Treat `action.yml` inputs, outputs, defaults, and compatibility aliases as the public API. Keep implementation, README, and advanced-usage documentation aligned when behavior changes; preserve deprecated aliases unless a documented breaking change removes them.
+- Do not assume version syntax, package variants, or platform/architecture support is uniform across distributions. Keep capability checks and vendor resolution behavior consistent with the documented support matrix. `latest` means the newest stable GA release, not an early-access build.
+- Preserve selection semantics: a recognized vendor in a supported version file may supply the distribution; otherwise the caller must provide it. If both `java-version` and `java-version-file` are given, the explicit `java-version` takes precedence.
+- Preserve install-state behavior for multiple JDKs. The last installed JDK becomes the default unless `set-default: false`; all installed JDKs remain available through their version-specific environment variables and Maven toolchains. Toolchain entries accumulate non-destructively, and custom IDs must correspond one-for-one with requested versions.
+- Treat dependency, wrapper, and JDK caches as distinct features with distinct keys and save behavior. `cache` enables dependency caching and implicitly enables JDK caching unless `cache-jdk` overrides it; `cache-read-only` restores without saving. Keep changes to cache identity or lifecycle aligned with these documented contracts.
+- Preserve download-integrity guarantees: verify authoritative checksums when published. Signature verification is distribution-specific; explicit `verify-signature: true` must enforce verification where supported and fail clearly where unsupported. Do not silently weaken verification or imply that a cached install was downloaded and reverified.
+- Keep Maven credential inputs as environment-variable names, not secret values. Generated settings and custom repository behavior must respect the documented overwrite option, while toolchain merging remains non-destructive and independent of that option.
+
+See `docs/CONTRIBUTING.md` for contribution and validation guidance, `README.md` for the public contract, and `docs/advanced-usage.md` for detailed behavior and examples.
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..f85e23877
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,25 @@
+version: 2
+updates:
+ - package-ecosystem: 'npm'
+ directory: '/'
+ schedule:
+ interval: 'monthly'
+ cooldown:
+ default-days: 7
+ groups:
+ monthly-npm-updates:
+ applies-to: 'version-updates'
+ patterns:
+ - '*'
+
+ - package-ecosystem: 'github-actions'
+ directory: '/'
+ schedule:
+ interval: 'monthly'
+ cooldown:
+ default-days: 7
+ groups:
+ monthly-actions-updates:
+ applies-to: 'version-updates'
+ patterns:
+ - '*'
diff --git a/.github/java.json b/.github/java.json
index eda1b0cd4..5e52ab819 100644
--- a/.github/java.json
+++ b/.github/java.json
@@ -9,6 +9,31 @@
"message": 3
}
]
+ },
+ {
+ "owner": "javac",
+ "pattern": [
+ {
+ "regexp": "^([^:]+):(\\d+): (warning|error): (.+?)$",
+ "file": 1,
+ "line": 2,
+ "severity": 3,
+ "message": 4
+ }
+ ]
+ },
+ {
+ "owner": "maven-javac",
+ "pattern": [
+ {
+ "regexp": "^\\[(WARNING|ERROR)\\]\\s+(.+?\\.java):\\[(\\d+),(\\d+)\\]\\s+(.+)$",
+ "severity": 1,
+ "file": 2,
+ "line": 3,
+ "column": 4,
+ "message": 5
+ }
+ ]
}
]
-}
\ No newline at end of file
+}
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index ef54acadd..dcf4beaaf 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -5,5 +5,6 @@ Describe your changes.
Add link to the related issue.
**Check list:**
+- [ ] Ran `npm run check` locally (format, lint, build, test) and all checks pass.
- [ ] Mark if documentation changes are required.
- [ ] Mark if tests were added or updated to cover the changes.
\ No newline at end of file
diff --git a/.github/workflows/basic-validation.yml b/.github/workflows/basic-validation.yml
index 37fa323e6..ea70e0577 100644
--- a/.github/workflows/basic-validation.yml
+++ b/.github/workflows/basic-validation.yml
@@ -11,9 +11,12 @@ on:
paths-ignore:
- '**.md'
+permissions:
+ contents: read
+
jobs:
call-basic-validation:
name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with:
- node-version: '20.x'
+ node-version: '24.x'
diff --git a/.github/workflows/benchmark-cache-restore.yml b/.github/workflows/benchmark-cache-restore.yml
new file mode 100644
index 000000000..17e1da301
--- /dev/null
+++ b/.github/workflows/benchmark-cache-restore.yml
@@ -0,0 +1,211 @@
+name: Benchmark cache restore
+
+on:
+ workflow_dispatch:
+ inputs:
+ baseline-ref:
+ description: Git ref containing the sequential restore implementation
+ required: true
+ default: main
+ type: string
+ candidate-ref:
+ description: Git ref containing the concurrent restore implementation (defaults to the dispatched ref)
+ required: false
+ type: string
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ warm-caches:
+ name: Warm ${{ matrix.tool }} ${{ matrix.profile }} caches (${{ matrix.os }})
+ runs-on: ${{ matrix.os }}
+ cache-mode: write-only
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ tool: [maven, gradle]
+ profile: [small, large]
+ steps:
+ - name: Checkout benchmark workflow
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Checkout baseline
+ uses: actions/checkout@v7
+ with:
+ path: baseline
+ persist-credentials: false
+ ref: ${{ inputs.baseline-ref }}
+ - name: Checkout candidate
+ uses: actions/checkout@v7
+ with:
+ path: candidate
+ persist-credentials: false
+ ref: ${{ inputs.candidate-ref || github.ref }}
+ - name: Prepare benchmark inputs
+ run: bash __tests__/benchmark-cache-restore.sh prepare "${{ matrix.tool }}" "${{ matrix.profile }}"
+ - name: Prepare cache save
+ uses: ./candidate
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ - name: Populate benchmark caches
+ run: |
+ bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ bash __tests__/benchmark-cache-restore.sh populate "${{ matrix.tool }}" "${{ matrix.profile }}"
+
+ benchmark:
+ name: Benchmark ${{ matrix.tool }} ${{ matrix.profile }} (${{ matrix.os }})
+ needs: warm-caches
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ tool: [maven, gradle]
+ profile: [small, large]
+ steps:
+ - name: Checkout benchmark workflow
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Checkout baseline
+ uses: actions/checkout@v7
+ with:
+ path: baseline
+ persist-credentials: false
+ ref: ${{ inputs.baseline-ref }}
+ - name: Checkout candidate
+ uses: actions/checkout@v7
+ with:
+ path: candidate
+ persist-credentials: false
+ ref: ${{ inputs.candidate-ref || github.ref }}
+ - name: Prepare benchmark inputs
+ run: bash __tests__/benchmark-cache-restore.sh prepare "${{ matrix.tool }}" "${{ matrix.profile }}"
+
+ - name: Reset caches for baseline iteration 1
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start baseline iteration 1 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with baseline iteration 1
+ id: baseline-1
+ uses: ./baseline
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record baseline iteration 1
+ env:
+ CACHE_HIT: ${{ steps.baseline-1.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" baseline 1 "$CACHE_HIT"
+
+ - name: Reset caches for candidate iteration 1
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start candidate iteration 1 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with candidate iteration 1
+ id: candidate-1
+ uses: ./candidate
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record candidate iteration 1
+ env:
+ CACHE_HIT: ${{ steps.candidate-1.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" candidate 1 "$CACHE_HIT"
+
+ - name: Reset caches for candidate iteration 2
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start candidate iteration 2 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with candidate iteration 2
+ id: candidate-2
+ uses: ./candidate
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record candidate iteration 2
+ env:
+ CACHE_HIT: ${{ steps.candidate-2.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" candidate 2 "$CACHE_HIT"
+
+ - name: Reset caches for baseline iteration 2
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start baseline iteration 2 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with baseline iteration 2
+ id: baseline-2
+ uses: ./baseline
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record baseline iteration 2
+ env:
+ CACHE_HIT: ${{ steps.baseline-2.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" baseline 2 "$CACHE_HIT"
+
+ - name: Reset caches for baseline iteration 3
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start baseline iteration 3 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with baseline iteration 3
+ id: baseline-3
+ uses: ./baseline
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record baseline iteration 3
+ env:
+ CACHE_HIT: ${{ steps.baseline-3.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" baseline 3 "$CACHE_HIT"
+
+ - name: Reset caches for candidate iteration 3
+ run: bash __tests__/benchmark-cache-restore.sh reset "${{ matrix.tool }}"
+ - name: Start candidate iteration 3 timer
+ run: bash __tests__/benchmark-cache-restore.sh start "${{ matrix.tool }}"
+ - name: Restore with candidate iteration 3
+ id: candidate-3
+ uses: ./candidate
+ with:
+ distribution: temurin
+ java-version: '17'
+ cache: ${{ matrix.tool }}
+ cache-dependency-path: benchmark/${{ matrix.tool == 'maven' && 'pom.xml' || 'build.gradle' }}
+ cache-read-only: true
+ - name: Record candidate iteration 3
+ env:
+ CACHE_HIT: ${{ steps.candidate-3.outputs.cache-hit }}
+ run: bash __tests__/benchmark-cache-restore.sh record "${{ matrix.tool }}" "${{ matrix.os }}" "${{ matrix.profile }}" candidate 3 "$CACHE_HIT"
+
+ - name: Summarize benchmark
+ run: bash __tests__/benchmark-cache-restore.sh summarize "${{ matrix.tool }}" "$GITHUB_STEP_SUMMARY"
+ - name: Upload raw timings
+ uses: actions/upload-artifact@v7
+ with:
+ name: cache-restore-${{ matrix.os }}-${{ matrix.tool }}-${{ matrix.profile }}
+ path: .benchmark-results/timings.csv
+ if-no-files-found: error
diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml
index 509ea6cc7..5592249e7 100644
--- a/.github/workflows/check-dist.yml
+++ b/.github/workflows/check-dist.yml
@@ -11,9 +11,12 @@ on:
- '**.md'
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
call-check-dist:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with:
- node-version: '20.x'
+ node-version: '24.x'
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 7a8261238..598f7de5d 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -8,7 +8,13 @@ on:
schedule:
- cron: '0 3 * * 0'
+permissions: {}
+
jobs:
call-codeQL-analysis:
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
name: CodeQL analysis
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
diff --git a/.github/workflows/e2e-cache-dependency-path.yml b/.github/workflows/e2e-cache-dependency-path.yml
deleted file mode 100644
index f276ef312..000000000
--- a/.github/workflows/e2e-cache-dependency-path.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-name: Validate cache with cache-dependency-path option
-
-on:
- push:
- branches:
- - main
- - releases/*
- paths-ignore:
- - '**.md'
- pull_request:
- paths-ignore:
- - '**.md'
-
-defaults:
- run:
- shell: bash
-
-jobs:
- gradle1-save:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Run setup-java with the cache for gradle
- uses: ./
- id: setup-java
- with:
- distribution: 'adopt'
- java-version: '11'
- cache: gradle
- cache-dependency-path: __tests__/cache/gradle1/*.gradle*
- - name: Create files to cache
- # Need to avoid using Gradle daemon to stabilize the save process on Windows
- # https://github.com/actions/cache/issues/454#issuecomment-840493935
- run: |
- gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
- if [ ! -d ~/.gradle/caches ]; then
- echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
- exit 1
- fi
- gradle1-restore:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- needs: gradle1-save
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Run setup-java with the cache for gradle
- uses: ./
- id: setup-java
- with:
- distribution: 'adopt'
- java-version: '11'
- cache: gradle
- cache-dependency-path: __tests__/cache/gradle1/*.gradle*
- - name: Confirm that ~/.gradle/caches directory has been made
- run: |
- if [ ! -d ~/.gradle/caches ]; then
- echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/.gradle/caches/
- gradle2-restore:
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- needs: gradle1-save
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Run setup-java with the cache for gradle
- uses: ./
- id: setup-java
- with:
- distribution: 'adopt'
- java-version: '11'
- cache: gradle
- cache-dependency-path: __tests__/cache/gradle2/*.gradle*
- - name: Confirm that ~/.gradle/caches directory has not been made
- run: |
- if [ -d ~/.gradle/caches ]; then
- echo "::error::The ~/.gradle/caches directory exists unexpectedly"
- exit 1
- fi
diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml
index 95031dbb1..2a9fef541 100644
--- a/.github/workflows/e2e-cache.yml
+++ b/.github/workflows/e2e-cache.yml
@@ -11,6 +11,9 @@ on:
paths-ignore:
- '**.md'
+permissions:
+ contents: read
+
defaults:
run:
shell: bash
@@ -18,102 +21,111 @@ defaults:
jobs:
gradle-save:
runs-on: ${{ matrix.os }}
+ cache-mode: write-only
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
with:
- distribution: 'adopt'
- java-version: '11'
+ distribution: 'temurin'
+ java-version: '17'
cache: gradle
- name: Create files to cache
# Need to avoid using Gradle daemon to stabilize the save process on Windows
# https://github.com/actions/cache/issues/454#issuecomment-840493935
run: |
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
- if [ ! -d ~/.gradle/caches ]; then
- echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
- exit 1
- fi
+ mkdir -p "$HOME/.gradle/wrapper/dists/setup-java-e2e"
+ echo "gradle wrapper cache" > "$HOME/.gradle/wrapper/dists/setup-java-e2e/payload"
+ bash __tests__/check-dir.sh "$HOME/.gradle/caches"
+ bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
gradle-restore:
runs-on: ${{ matrix.os }}
+ cache-mode: read
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
needs: gradle-save
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for gradle
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
cache: gradle
+ cache-read-only: true
- name: Confirm that ~/.gradle/caches directory has been made
- run: |
- if [ ! -d ~/.gradle/caches ]; then
- echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/.gradle/caches/
+ run: bash __tests__/check-dir.sh "$HOME/.gradle/caches"
+ - name: Confirm that the Gradle Wrapper cache has been restored
+ run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
maven-save:
runs-on: ${{ matrix.os }}
+ cache-mode: write-only
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
cache: maven
- name: Create files to cache
run: |
mvn verify -f __tests__/cache/maven/pom.xml
- if [ ! -d ~/.m2/repository ]; then
- echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
- exit 1
- fi
+ mkdir -p "$HOME/.m2/wrapper/dists/setup-java-e2e"
+ echo "maven wrapper cache" > "$HOME/.m2/wrapper/dists/setup-java-e2e/payload"
+ bash __tests__/check-dir.sh "$HOME/.m2/repository"
+ bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
maven-restore:
runs-on: ${{ matrix.os }}
+ cache-mode: read
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
needs: maven-save
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for maven
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
cache: maven
+ cache-read-only: true
- name: Confirm that ~/.m2/repository directory has been made
- run: |
- if [ ! -d ~/.m2/repository ]; then
- echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/.m2/repository
+ run: bash __tests__/check-dir.sh "$HOME/.m2/repository"
+ - name: Confirm that the Maven Wrapper cache has been restored
+ run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
sbt-save:
runs-on: ${{ matrix.os }}
+ cache-mode: write-only
defaults:
run:
shell: bash
@@ -121,19 +133,21 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-22.04]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for sbt
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
cache: sbt
- name: Setup SBT
- if: matrix.os == 'macos-13'
+ if: matrix.os == 'macos-15-intel'
run: |
echo ""Installing SBT...""
brew install sbt
@@ -141,28 +155,17 @@ jobs:
run: sbt update
- name: Check files to cache on macos-latest
- if: matrix.os == 'macos-13'
- run: |
- if [ ! -d ~/Library/Caches/Coursier ]; then
- echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
- exit 1
- fi
+ if: matrix.os == 'macos-15-intel'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
- name: Check files to cache on windows-latest
if: matrix.os == 'windows-latest'
- run: |
- if [ ! -d ~/AppData/Local/Coursier/Cache ]; then
- echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
- exit 1
- fi
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
- name: Check files to cache on ubuntu-latest
- if: matrix.os == 'ubuntu-latest'
- run: |
- if [ ! -d ~/.cache/coursier ]; then
- echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
- exit 1
- fi
+ if: matrix.os == 'ubuntu-22.04'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
sbt-restore:
runs-on: ${{ matrix.os }}
+ cache-mode: read
defaults:
run:
shell: bash
@@ -170,40 +173,342 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
+ os: [macos-15-intel, windows-latest, ubuntu-22.04]
needs: sbt-save
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Run setup-java with the cache for sbt
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
cache: sbt
+ cache-read-only: true
- name: Confirm that ~/Library/Caches/Coursier directory has been made
- if: matrix.os == 'macos-13'
- run: |
- if [ ! -d ~/Library/Caches/Coursier ]; then
- echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/Library/Caches/Coursier
+ if: matrix.os == 'macos-15-intel'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
- name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made
if: matrix.os == 'windows-latest'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
+ - name: Confirm that ~/.cache/coursier directory has been made
+ if: matrix.os == 'ubuntu-22.04'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
+ gradle1-save:
+ runs-on: ${{ matrix.os }}
+ cache-mode: write-only
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-latest]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for gradle
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ cache: gradle
+ cache-dependency-path: __tests__/cache/gradle1/*.gradle*
+ - name: Create files to cache
+ # Need to avoid using Gradle daemon to stabilize the save process on Windows
+ # https://github.com/actions/cache/issues/454#issuecomment-840493935
+ run: |
+ gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
+ mkdir -p "$HOME/.gradle/wrapper/dists/setup-java-e2e-gradle1"
+ echo "gradle wrapper cache gradle1" > "$HOME/.gradle/wrapper/dists/setup-java-e2e-gradle1/payload"
+ bash __tests__/check-dir.sh "$HOME/.gradle/caches"
+ bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
+ gradle1-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-latest]
+ needs: gradle1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for gradle
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: gradle
+ cache-dependency-path: __tests__/cache/gradle1/*.gradle*
+ - name: Confirm that ~/.gradle/caches directory has been made
+ run: bash __tests__/check-dir.sh "$HOME/.gradle/caches"
+ - name: Confirm that the Gradle Wrapper cache has been restored
+ run: bash __tests__/check-dir.sh "$HOME/.gradle/wrapper/dists"
+ gradle2-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-latest]
+ needs: gradle1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for gradle
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: gradle
+ cache-dependency-path: __tests__/cache/gradle2/*.gradle*
+ - name: Confirm that ~/.gradle/caches directory has not been made
+ run: bash __tests__/check-dir.sh "$HOME/.gradle/caches" absent
+ maven1-save:
+ runs-on: ${{ matrix.os }}
+ cache-mode: write-only
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for maven
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: maven
+ cache-dependency-path: __tests__/cache/maven/pom.xml
+ - name: Create files to cache
+ run: |
+ mvn verify -f __tests__/cache/maven/pom.xml
+ mkdir -p "$HOME/.m2/wrapper/dists/setup-java-e2e-maven1"
+ echo "maven wrapper cache maven1" > "$HOME/.m2/wrapper/dists/setup-java-e2e-maven1/payload"
+ bash __tests__/check-dir.sh "$HOME/.m2/repository"
+ bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
+ maven1-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ needs: maven1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for maven
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: maven
+ cache-dependency-path: __tests__/cache/maven/pom.xml
+ - name: Confirm that ~/.m2/repository directory has been made
+ run: bash __tests__/check-dir.sh "$HOME/.m2/repository"
+ - name: Confirm that the Maven Wrapper cache has been restored
+ run: bash __tests__/check-dir.sh "$HOME/.m2/wrapper/dists"
+ maven2-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ needs: maven1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for maven
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: maven
+ cache-dependency-path: |
+ __tests__/cache/maven2/pom.xml
+ README.md
+ - name: Confirm that ~/.m2/repository directory has not been made
+ run: bash __tests__/check-dir.sh "$HOME/.m2/repository" absent
+ sbt1-save:
+ runs-on: ${{ matrix.os }}
+ cache-mode: write-only
+ defaults:
+ run:
+ shell: bash
+ working-directory: __tests__/cache/sbt
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-22.04]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for sbt
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: sbt
+ cache-dependency-path: __tests__/cache/sbt/*.sbt
+ - name: Setup SBT
+ if: matrix.os == 'macos-15-intel'
run: |
- if [ ! -d ~/AppData/Local/Coursier/Cache ]; then
- echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/AppData/Local/Coursier/Cache
+ echo ""Installing SBT...""
+ brew install sbt
+ - name: Create files to cache
+ run: sbt update
+
+ - name: Check files to cache on macos-latest
+ if: matrix.os == 'macos-15-intel'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
+ - name: Check files to cache on windows-latest
+ if: matrix.os == 'windows-latest'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
+ - name: Check files to cache on ubuntu-latest
+ if: matrix.os == 'ubuntu-22.04'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
+ sbt1-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ defaults:
+ run:
+ shell: bash
+ working-directory: __tests__/cache/sbt
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-22.04]
+ needs: sbt1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for sbt
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: sbt
+ cache-dependency-path: __tests__/cache/sbt/*.sbt
+
+ - name: Confirm that ~/Library/Caches/Coursier directory has been made
+ if: matrix.os == 'macos-15-intel'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
+ - name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made
+ if: matrix.os == 'windows-latest'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
- name: Confirm that ~/.cache/coursier directory has been made
- if: matrix.os == 'ubuntu-latest'
+ if: matrix.os == 'ubuntu-22.04'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
+ sbt2-restore:
+ runs-on: ${{ matrix.os }}
+ cache-mode: read
+ defaults:
+ run:
+ shell: bash
+ working-directory: __tests__/cache/sbt2
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-15-intel, windows-latest, ubuntu-22.04]
+ needs: sbt1-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with the cache for sbt
+ uses: ./
+ id: setup-java
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: sbt
+ cache-dependency-path: __tests__/cache/sbt2/*.sbt
+
+ - name: Confirm that ~/Library/Caches/Coursier directory has not been made
+ if: matrix.os == 'macos-15-intel'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier" absent
+ - name: Confirm that ~/AppData/Local/Coursier/Cache directory has not been made
+ if: matrix.os == 'windows-latest'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache" absent
+ - name: Confirm that ~/.cache/coursier directory has not been made
+ if: matrix.os == 'ubuntu-22.04'
+ run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" absent
+ custom-maven-path-save:
+ runs-on: ubuntu-latest
+ cache-mode: write-only
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with a custom Maven cache path
+ uses: ./
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: maven
+ cache-dependency-path: |
+ __tests__/cache/maven2/pom.xml
+ .github/workflows/e2e-cache.yml
+ cache-path: |
+ ${{ runner.temp }}/setup-java-custom-maven-repository
+ !${{ runner.temp }}/setup-java-custom-maven-repository/**/*.lastUpdated
+ - name: Populate the custom Maven repository
run: |
- if [ ! -d ~/.cache/coursier ]; then
- echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
- exit 1
- fi
- ls ~/.cache/coursier
+ mvn -Dmaven.repo.local="$RUNNER_TEMP/setup-java-custom-maven-repository" verify -f __tests__/cache/maven2/pom.xml
+ touch "$RUNNER_TEMP/setup-java-custom-maven-repository/setup-java-cache-path-marker"
+ bash __tests__/check-dir.sh "$RUNNER_TEMP/setup-java-custom-maven-repository"
+ custom-maven-path-restore:
+ runs-on: ubuntu-latest
+ cache-mode: read
+ needs: custom-maven-path-save
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Run setup-java with a custom Maven cache path
+ uses: ./
+ with:
+ distribution: 'temurin'
+ java-version: '11'
+ cache: maven
+ cache-dependency-path: |
+ __tests__/cache/maven2/pom.xml
+ .github/workflows/e2e-cache.yml
+ cache-path: |
+ ${{ runner.temp }}/setup-java-custom-maven-repository
+ !${{ runner.temp }}/setup-java-custom-maven-repository/**/*.lastUpdated
+ cache-read-only: true
+ - name: Confirm that the custom Maven repository has been restored
+ run: test -f "$RUNNER_TEMP/setup-java-custom-maven-repository/setup-java-cache-path-marker"
diff --git a/.github/workflows/e2e-local-file.yml b/.github/workflows/e2e-local-file.yml
index 9757621ed..657334ce0 100644
--- a/.github/workflows/e2e-local-file.yml
+++ b/.github/workflows/e2e-local-file.yml
@@ -11,44 +11,10 @@ on:
paths-ignore:
- '**.md'
-jobs:
- setup-java-local-file-adopt:
- name: Validate installation from local file Adopt
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Download Adopt OpenJDK file
- run: |
- if ($IsLinux) {
- $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
- $localFilename = "java_package.tar.gz"
- } elseif ($IsMacOS) {
- $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz"
- $localFilename = "java_package.tar.gz"
- } elseif ($IsWindows) {
- $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip"
- $localFilename = "java_package.zip"
- }
- echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename")
- shell: pwsh
- - name: setup-java
- uses: ./
- id: setup-java
- with:
- distribution: 'jdkfile'
- jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
- java-version: '11.0.0-ea'
- architecture: x64
- - name: Verify Java version
- run: bash __tests__/verify-java.sh "11.0.10" "${{ steps.setup-java.outputs.path }}"
- shell: bash
+permissions:
+ contents: read
+jobs:
setup-java-local-file-zulu:
name: Validate installation from local file Zulu
runs-on: ${{ matrix.os }}
@@ -58,7 +24,9 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Download Zulu OpenJDK file
run: |
if ($IsLinux) {
@@ -79,11 +47,13 @@ jobs:
id: setup-java
with:
distribution: 'jdkfile'
- jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
+ jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
java-version: '11.0.0-ea'
architecture: x64
- name: Verify Java version
- run: bash __tests__/verify-java.sh "11.0" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "11.0" "$JAVA_PATH"
shell: bash
setup-java-local-file-temurin:
@@ -95,7 +65,9 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Download Eclipse Temurin file
run: |
if ($IsLinux) {
@@ -116,9 +88,12 @@ jobs:
id: setup-java
with:
distribution: 'jdkfile'
+ # Intentionally uses the deprecated `jdkFile` alias to keep it covered.
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
java-version: '11.0.0-ea'
architecture: x64
- name: Verify Java version
- run: bash __tests__/verify-java.sh "11.0.12" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "11.0.12" "$JAVA_PATH"
shell: bash
diff --git a/.github/workflows/e2e-publishing.yml b/.github/workflows/e2e-publishing.yml
index dd7bd4351..f7419d8e8 100644
--- a/.github/workflows/e2e-publishing.yml
+++ b/.github/workflows/e2e-publishing.yml
@@ -11,6 +11,9 @@ on:
paths-ignore:
- '**.md'
+permissions:
+ contents: read
+
defaults:
run:
shell: pwsh
@@ -25,29 +28,43 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: setup-java
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
server-id: maven
- server-username: MAVEN_USERNAME
- server-password: MAVEN_CENTRAL_TOKEN
- gpg-passphrase: MAVEN_GPG_PASSPHRASE
+ server-username-env-var: MAVEN_USERNAME
+ server-password-env-var: MAVEN_CENTRAL_TOKEN
+ gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
- name: Validate settings.xml
run: |
$xmlPath = Join-Path $HOME ".m2" "settings.xml"
Get-Content $xmlPath | ForEach-Object { Write-Host $_ }
- [xml]$xml = Get-Content $xmlPath
- $servers = $xml.settings.servers.server
- if (($servers[0].id -ne 'maven') -or ($servers[0].username -ne '${env.MAVEN_USERNAME}') -or ($servers[0].password -ne '${env.MAVEN_CENTRAL_TOKEN}')) {
- throw "Generated XML file is incorrect"
- }
+ $content = [System.IO.File]::ReadAllText($xmlPath)
+ $expected = @(
+ ''
+ ' false'
+ ' '
+ ' '
+ ' maven'
+ ' ${env.MAVEN_USERNAME}'
+ ' ${env.MAVEN_CENTRAL_TOKEN}'
+ ' '
+ ' '
+ ''
+ ) -join "`n"
- if (($servers[1].id -ne 'gpg.passphrase') -or ($servers[1].passphrase -ne '${env.MAVEN_GPG_PASSPHRASE}')) {
+ if ($content -ne $expected) {
+ Write-Host "Expected settings.xml:"
+ $expected -split "`n" | ForEach-Object { Write-Host $_ }
throw "Generated XML file is incorrect"
}
@@ -60,7 +77,9 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -71,12 +90,12 @@ jobs:
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
server-id: maven
- server-username: MAVEN_USERNAME
- server-password: MAVEN_CENTRAL_TOKEN
- gpg-passphrase: MAVEN_GPG_PASSPHRASE
+ server-username-env-var: MAVEN_USERNAME
+ server-password-env-var: MAVEN_CENTRAL_TOKEN
+ gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
- name: Validate settings.xml is overwritten
run: |
$xmlPath = Join-Path $HOME ".m2" "settings.xml"
@@ -96,7 +115,9 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Create fake settings.xml
run: |
$xmlDirectory = Join-Path $HOME ".m2"
@@ -107,13 +128,13 @@ jobs:
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
server-id: maven
- server-username: MAVEN_USERNAME
- server-password: MAVEN_CENTRAL_TOKEN
+ server-username-env-var: MAVEN_USERNAME
+ server-password-env-var: MAVEN_CENTRAL_TOKEN
overwrite-settings: false
- gpg-passphrase: MAVEN_GPG_PASSPHRASE
+ gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
- name: Validate that settings.xml is not overwritten
run: |
$xmlPath = Join-Path $HOME ".m2" "settings.xml"
@@ -133,17 +154,19 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: setup-java
uses: ./
id: setup-java
with:
- distribution: 'adopt'
+ distribution: 'temurin'
java-version: '11'
server-id: maven
- server-username: MAVEN_USERNAME
- server-password: MAVEN_CENTRAL_TOKEN
- gpg-passphrase: MAVEN_GPG_PASSPHRASE
+ server-username-env-var: MAVEN_USERNAME
+ server-password-env-var: MAVEN_CENTRAL_TOKEN
+ gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE
settings-path: ${{ runner.temp }}
- name: Validate settings.xml location
run: |
@@ -151,3 +174,203 @@ jobs:
if (-not (Test-Path $path)) {
throw "settings.xml file is not found in expected location"
}
+
+ test-maven-mirrors:
+ name: Maven mirrors (${{ matrix.mirror-of }})
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-latest]
+ mirror-of: ['*', 'external:*']
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Configure Maven mirrors without repository inputs
+ uses: $/
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ settings-path: ${{ runner.temp }}/maven-mirror-test
+ mvn-server-credentials: |
+ private:PRIVATE_USERNAME:PRIVATE_TOKEN
+ mvn-mirrors: |
+ private:https://mirror.example.invalid/maven:${{ matrix.mirror-of }}
+ - name: Validate generated settings and Maven mirror selection
+ env:
+ MIRROR_OF: ${{ matrix.mirror-of }}
+ PRIVATE_USERNAME: mirror-test-user
+ PRIVATE_TOKEN: mirror-test-token
+ run: |
+ $directory = Join-Path $env:RUNNER_TEMP "maven-mirror-test"
+ $settingsPath = Join-Path $directory "settings.xml"
+ [xml]$settings = Get-Content -Path $settingsPath -Raw
+ $mirrors = @($settings.settings.mirrors.mirror)
+ if ($mirrors.Count -ne 1 -or $mirrors[0].id -ne "private" -or $mirrors[0].url -ne "https://mirror.example.invalid/maven" -or $mirrors[0].mirrorOf -ne $env:MIRROR_OF) {
+ throw "Incorrect generated mirror"
+ }
+ if ($settings.settings.profiles -or $settings.settings.activeProfiles) {
+ throw "Mirror-only settings must not add repository profiles"
+ }
+ $server = $settings.settings.servers.server
+ if ($server.id -ne "private" -or $server.username -ne '${env.PRIVATE_USERNAME}' -or $server.password -ne '${env.PRIVATE_TOKEN}') {
+ throw "Mirror credentials were not preserved"
+ }
+
+ $pomPath = Join-Path $directory "pom.xml"
+ @'
+
+ 4.0.0
+ setup-java.test
+ mirror-settings
+ 1.0
+
+
+ pom-dependencies
+ https://dependencies.example.invalid/maven
+
+
+
+
+ pom-plugins
+ https://plugins.example.invalid/maven
+
+
+
+ '@ | Set-Content -Path $pomPath
+
+ # validate requires no plugins or dependencies, so mirror selection can
+ # be inspected offline without contacting the deliberately invalid URLs.
+ $output = & mvn --batch-mode --no-transfer-progress --offline --debug `
+ --settings $settingsPath --file $pomPath `
+ "-Dmaven.repo.local=$directory/repository" validate 2>&1
+ if ($LASTEXITCODE -ne 0) {
+ throw "Could not inspect Maven mirror selection: $output"
+ }
+ $log = $output -join "`n"
+ foreach ($id in @("central", "pom-dependencies")) {
+ $expected = "Using mirror private (https://mirror.example.invalid/maven) for $id ("
+ if (-not $log.Contains($expected)) {
+ throw "Maven did not select the mirror for ${id}: $log"
+ }
+ }
+ foreach ($type in @("dependencies", "plugins")) {
+ $pattern = 'Repositories \(' + $type + '\)\s*: \[private \(https://mirror\.example\.invalid/maven, [^\]]+\)\]'
+ if ($log -notmatch $pattern) {
+ throw "Maven did not redirect all $type repositories: $log"
+ }
+ }
+
+ test-maven-repositories:
+ name: Maven ${{ matrix.repositories }} repositories
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, windows-latest, ubuntu-latest]
+ repositories: [dependencies, plugins, both]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Prepare Maven model inspection
+ run: |
+ $directory = Join-Path $env:RUNNER_TEMP "maven-repository-test"
+ New-Item -Path $directory -ItemType Directory -Force | Out-Null
+ $pomPath = Join-Path $directory "pom.xml"
+ $warmSettingsPath = Join-Path $directory "warm-settings.xml"
+ $cachePath = Join-Path $directory "repository"
+ $outputPath = Join-Path $directory "warm-effective-pom.xml"
+
+ # This project repository keeps the inspection plugin available offline
+ # after the generated settings disable inherited plugin Central.
+ @'
+
+ 4.0.0
+ setup-java.test
+ repository-settings
+ 1.0
+
+
+ inspection
+ https://repo.maven.apache.org/maven2
+
+
+
+ '@ | Set-Content -Path $pomPath
+ '' | Set-Content -Path $warmSettingsPath
+
+ mvn --batch-mode --no-transfer-progress --settings $warmSettingsPath `
+ "-Dmaven.repo.local=$cachePath" --file $pomPath `
+ org.apache.maven.plugins:maven-help-plugin:3.5.1:effective-pom `
+ "-Doutput=$outputPath"
+ if ($LASTEXITCODE -ne 0) {
+ throw "Could not prepare the Maven Help Plugin"
+ }
+ - name: Configure dependency and plugin repositories
+ uses: ./
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ settings-path: ${{ runner.temp }}/maven-repository-test/settings
+ mvn-server-credentials: |
+ private:PRIVATE_USERNAME:PRIVATE_TOKEN
+ mvn-repositories: ${{ matrix.repositories != 'plugins' && 'private:https://repo.example.invalid/maven:false' || '' }}
+ mvn-plugin-repositories: ${{ matrix.repositories != 'dependencies' && 'private:https://repo.example.invalid/maven:false' || '' }}
+ mvn-repositories-include-central: false
+ - name: Validate generated settings and effective Maven repositories
+ env:
+ REPOSITORY_CONFIGURATION: ${{ matrix.repositories }}
+ run: |
+ $directory = Join-Path $env:RUNNER_TEMP "maven-repository-test"
+ $settingsPath = Join-Path $directory "settings/settings.xml"
+ [xml]$settings = Get-Content -Path $settingsPath -Raw
+ $profiles = @($settings.settings.profiles.profile)
+ if ($profiles.Count -ne 1 -or $profiles[0].id -ne "setup-java-repositories") {
+ throw "Expected one repository profile"
+ }
+ $activeProfiles = @($settings.settings.activeProfiles.activeProfile)
+ if ($activeProfiles.Count -ne 1 -or $activeProfiles[0] -ne "setup-java-repositories") {
+ throw "Expected one active repository profile"
+ }
+ $server = $settings.settings.servers.server
+ if ($server.id -ne "private" -or $server.username -ne '${env.PRIVATE_USERNAME}' -or $server.password -ne '${env.PRIVATE_TOKEN}') {
+ throw "Repository credentials were not preserved"
+ }
+
+ function Assert-Repositories($repositories, $expectPrivate, $context) {
+ $central = @($repositories | Where-Object { $_.id -eq "central" })
+ if ($central.Count -ne 1 -or $central[0].releases.enabled -ne "false" -or $central[0].snapshots.enabled -ne "false") {
+ throw "$context did not disable inherited Maven Central"
+ }
+ $private = @($repositories | Where-Object { $_.id -eq "private" })
+ $expectedCount = if ($expectPrivate) { 1 } else { 0 }
+ if ($private.Count -ne $expectedCount) {
+ throw "$context has incorrect private repositories"
+ }
+ if ($expectPrivate -and ($private[0].url -ne "https://repo.example.invalid/maven" -or $private[0].snapshots.enabled -ne "false")) {
+ throw "$context has incorrect private repository settings"
+ }
+ }
+
+ $expectDependencies = $env:REPOSITORY_CONFIGURATION -ne "plugins"
+ $expectPlugins = $env:REPOSITORY_CONFIGURATION -ne "dependencies"
+ Assert-Repositories @($profiles[0].repositories.repository) $expectDependencies "Settings dependency repositories"
+ Assert-Repositories @($profiles[0].pluginRepositories.pluginRepository) $expectPlugins "Settings plugin repositories"
+
+ $pomPath = Join-Path $directory "pom.xml"
+ $cachePath = Join-Path $directory "repository"
+ $outputPath = Join-Path $directory "effective-pom.xml"
+ mvn --batch-mode --no-transfer-progress --offline --settings $settingsPath `
+ "-Dmaven.repo.local=$cachePath" --file $pomPath `
+ org.apache.maven.plugins:maven-help-plugin:3.5.1:effective-pom `
+ "-Doutput=$outputPath"
+ if ($LASTEXITCODE -ne 0) {
+ throw "Could not inspect the effective Maven model"
+ }
+ [xml]$effectivePom = Get-Content -Path $outputPath -Raw
+ Assert-Repositories @($effectivePom.project.repositories.repository) $expectDependencies "Effective dependency repositories"
+ Assert-Repositories @($effectivePom.project.pluginRepositories.pluginRepository) $expectPlugins "Effective plugin repositories"
diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml
new file mode 100644
index 000000000..fed3adf72
--- /dev/null
+++ b/.github/workflows/e2e-smoke.yml
@@ -0,0 +1,87 @@
+name: Validate Java e2e smoke
+
+on:
+ push:
+ branches:
+ - main
+ paths-ignore:
+ - '**.md'
+ pull_request:
+ paths-ignore:
+ - '**.md'
+
+permissions:
+ contents: read
+
+jobs:
+ setup-java:
+ name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}) - ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: macos-latest
+ distribution: temurin
+ version: '11'
+ java-package: jdk
+ - os: windows-latest
+ distribution: temurin
+ version: '17'
+ java-package: jdk
+ - os: ubuntu-latest
+ distribution: temurin
+ version: '21'
+ java-package: jdk
+ - os: macos-latest
+ distribution: temurin
+ version: '25'
+ java-package: jdk
+ - os: windows-latest
+ distribution: temurin
+ version: '25'
+ java-package: jdk
+ - os: ubuntu-latest
+ distribution: temurin
+ version: '25'
+ java-package: jdk
+ - os: macos-latest
+ distribution: microsoft
+ version: '25'
+ java-package: jdk
+ - os: windows-latest
+ distribution: microsoft
+ version: '25'
+ java-package: jdk
+ - os: ubuntu-latest
+ distribution: microsoft
+ version: '25'
+ java-package: jdk
+ - os: ubuntu-latest
+ distribution: zulu
+ version: '17'
+ java-package: jre
+ - os: ubuntu-latest
+ distribution: liberica
+ version: '21'
+ java-package: jdk+fx
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: setup-java
+ uses: ./
+ id: setup-java
+ with:
+ java-version: ${{ matrix.version }}
+ java-package: ${{ matrix.java-package }}
+ distribution: ${{ matrix.distribution }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Verify Java
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
+ shell: bash
diff --git a/.github/workflows/e2e-versions.yml b/.github/workflows/e2e-versions.yml
index 045dee15d..7e7f339db 100644
--- a/.github/workflows/e2e-versions.yml
+++ b/.github/workflows/e2e-versions.yml
@@ -3,55 +3,106 @@ name: Validate Java e2e
on:
push:
branches:
- - main
- releases/*
paths-ignore:
- '**.md'
- pull_request:
- paths-ignore:
- - '**.md'
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
+
+permissions:
+ contents: read
+
jobs:
setup-java-major-versions:
- name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
+ name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
- distribution: [
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ distribution:
+ [
'temurin',
- 'adopt',
- 'adopt-openj9',
'zulu',
'liberica',
'microsoft',
'semeru',
'corretto',
'dragonwell',
- 'sapmachine'
- ] # internally 'adopt-hotspot' is the same as 'adopt'
+ 'sapmachine',
+ 'jetbrains',
+ 'kona',
+ 'liberica-nik'
+ ]
version: ['21', '11', '17']
exclude:
- distribution: microsoft
version: 8
- distribution: dragonwell
- os: macos-13
+ os: macos-15-intel
include:
+ - distribution: microsoft
+ os: windows-latest
+ version: 25
+ - distribution: microsoft
+ os: ubuntu-latest
+ version: 25
+ - distribution: microsoft
+ os: macos-latest
+ version: 25
+ - distribution: microsoft
+ os: windows-latest
+ version: '25.0.5+0.2'
+ - distribution: microsoft
+ os: ubuntu-latest
+ version: '25.0.5+0.2'
+ - distribution: microsoft
+ os: macos-latest
+ version: '25.0.5+0.2'
+ - distribution: kona
+ os: windows-latest
+ version: 25
+ - distribution: kona
+ os: ubuntu-latest
+ version: 25
+ - distribution: kona
+ os: macos-latest
+ version: 25
+ - distribution: liberica-nik
+ os: windows-latest
+ version: 25
+ - distribution: liberica-nik
+ os: ubuntu-latest
+ version: 25
+ - distribution: liberica-nik
+ os: macos-latest
+ version: 25
- distribution: oracle
- os: macos-13
- version: 17
+ os: macos-15-intel
+ version: 25
- distribution: oracle
os: windows-latest
- version: 21
+ version: 25
+ - distribution: oracle
+ os: ubuntu-latest
+ version: 25
+ # Oracle no longer publishes JDK 21 under /latest, so a major-only request resolves to the archived GA build.
- distribution: oracle
os: ubuntu-latest
version: 21
+ - distribution: oracle-openjdk
+ os: macos-15-intel
+ version: 21
+ - distribution: oracle-openjdk
+ os: windows-latest
+ version: 21
+ - distribution: oracle-openjdk
+ os: ubuntu-latest
+ version: 21
- distribution: graalvm
os: macos-latest
- version: 17
+ version: 17.0.12
- distribution: graalvm
os: windows-latest
version: 21
@@ -62,8 +113,62 @@ jobs:
os: ubuntu-latest
version: '24-ea'
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - &checkout_step
+ name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: setup-java
+ uses: ./
+ id: setup-java
+ with:
+ java-version: ${{ matrix.version }}
+ distribution: ${{ matrix.distribution }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Verify Java
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ SETUP_JAVA_VERSION: ${{ steps.setup-java.outputs.version }}
+ REQUIRE_CONCRETE_VERSION: ${{ ((matrix.distribution == 'oracle' && matrix.version != 21) || matrix.distribution == 'graalvm') && !contains(matrix.version, '.') && !contains(matrix.version, '-ea') }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH" "$SETUP_JAVA_VERSION" "$REQUIRE_CONCRETE_VERSION"
+ shell: bash
+
+ setup-java-checksum-verification:
+ name: Corretto checksum verification - ubuntu-latest
+ runs-on: ubuntu-latest
+ steps:
+ - *checkout_step
+ - name: setup-java with forced download
+ uses: ./
+ id: setup-java
+ with:
+ java-version: '21'
+ distribution: corretto
+ force-download: true
+ - name: Verify Java
+ env:
+ JAVA_VERSION: '21'
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
+ shell: bash
+
+ setup-java-alpine-linux:
+ name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - alpine-linux - ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ container:
+ image: alpine:3.21
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest]
+ distribution: ['temurin', 'sapmachine']
+ version: ['21', '17']
+ steps:
+ - *checkout_step
+ - name: Install bash and GnuPG
+ run: apk add --no-cache bash gnupg
- name: setup-java
uses: ./
id: setup-java
@@ -71,17 +176,20 @@ jobs:
java-version: ${{ matrix.version }}
distribution: ${{ matrix.distribution }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
setup-java-major-minor-versions:
- name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
+ name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
needs: setup-java-major-versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: &default_os [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'zulu', 'liberica']
version:
- '11.0'
@@ -103,9 +211,14 @@ jobs:
- distribution: sapmachine
os: ubuntu-latest
version: '17.0.7'
+ - distribution: jetbrains
+ os: ubuntu-latest
+ version: '11.0.11'
+ - distribution: jetbrains
+ os: ubuntu-latest
+ version: '17.0.7'
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
@@ -113,7 +226,11 @@ jobs:
java-version: ${{ matrix.version }}
distribution: ${{ matrix.distribution }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
setup-java-check-latest:
@@ -123,15 +240,21 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: *default_os
distribution:
- ['temurin', 'zulu', 'liberica', 'dragonwell', 'sapmachine']
+ [
+ 'temurin',
+ 'zulu',
+ 'liberica',
+ 'dragonwell',
+ 'sapmachine',
+ 'jetbrains'
+ ]
exclude:
- distribution: dragonwell
os: macos-latest
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
@@ -139,8 +262,12 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version: 11
check-latest: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "11" "$JAVA_PATH"
shell: bash
setup-java-multiple-jdks:
@@ -150,15 +277,21 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: *default_os
distribution:
- ['temurin', 'zulu', 'liberica', 'dragonwell', 'sapmachine']
+ [
+ 'temurin',
+ 'zulu',
+ 'liberica',
+ 'dragonwell',
+ 'sapmachine',
+ 'jetbrains'
+ ]
exclude:
- distribution: dragonwell
os: macos-latest
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
@@ -167,12 +300,15 @@ jobs:
java-version: |
11
17
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify Java env variables
run: |
+ $javaArch = if ($env:RUNNER_ARCH -eq "ARM64") { "AARCH64" } else { $env:RUNNER_ARCH }
$versionsArr = "11","17"
foreach ($version in $versionsArr)
{
- $envName = "JAVA_HOME_${version}_${env:RUNNER_ARCH}"
+ $envName = "JAVA_HOME_${version}_${javaArch}"
$JavaVersionPath = [Environment]::GetEnvironmentVariable($envName)
if (-not (Test-Path "$JavaVersionPath")) {
Write-Host "$envName is not found"
@@ -181,73 +317,74 @@ jobs:
}
shell: pwsh
- name: Verify Java
- run: bash __tests__/verify-java.sh "17" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "17" "$JAVA_PATH"
shell: bash
- setup-java-ea-versions-zulu:
- name: zulu ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
+ setup-java-ea-versions:
+ name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
- version: ['17-ea', '15.0.0-ea.14']
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: setup-java
- uses: ./
- id: setup-java
- with:
- java-version: ${{ matrix.version }}
- distribution: zulu
- - name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
- shell: bash
-
- setup-java-ea-versions-temurin:
- name: temurin ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
- needs: setup-java-major-minor-versions
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- version: ['17-ea']
+ include:
+ - {os: macos-15-intel, version: '17-ea', distribution: zulu}
+ - {os: windows-latest, version: '17-ea', distribution: zulu}
+ - {os: ubuntu-latest, version: '17-ea', distribution: zulu}
+ - {os: macos-15-intel, version: '15.0.0-ea.14', distribution: zulu}
+ - {os: windows-latest, version: '15.0.0-ea.14', distribution: zulu}
+ - {os: ubuntu-latest, version: '15.0.0-ea.14', distribution: zulu}
+ - {os: macos-latest, version: '17-ea', distribution: temurin}
+ - {os: windows-latest, version: '17-ea', distribution: temurin}
+ - {os: ubuntu-latest, version: '17-ea', distribution: temurin}
+ - {os: macos-latest, version: '17-ea', distribution: sapmachine}
+ - {os: windows-latest, version: '17-ea', distribution: sapmachine}
+ - {os: ubuntu-latest, version: '17-ea', distribution: sapmachine}
+ - {os: macos-latest, version: '21-ea', distribution: sapmachine}
+ - {os: windows-latest, version: '21-ea', distribution: sapmachine}
+ - {os: ubuntu-latest, version: '21-ea', distribution: sapmachine}
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
with:
java-version: ${{ matrix.version }}
- distribution: temurin
+ distribution: ${{ matrix.distribution }}
+ verify-signature: ${{ matrix.distribution == 'temurin' && contains(matrix.version, '-ea') && 'false' || '' }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
- setup-java-ea-versions-sapmachine:
- name: sapmachine ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
+ setup-java-signature-verification:
+ name: ${{ matrix.distribution }} ${{ matrix.version }} signature verification - ${{ matrix.os }}
needs: setup-java-major-minor-versions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- version: ['17-ea', '21-ea']
+ os: *default_os
+ version: ['21', '17']
+ distribution: [temurin, microsoft]
steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: setup-java
+ - *checkout_step
+ - name: setup-java with signature verification
uses: ./
id: setup-java
with:
java-version: ${{ matrix.version }}
- distribution: sapmachine
+ distribution: ${{ matrix.distribution }}
+ verify-signature: true
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
setup-java-custom-package-type:
@@ -257,8 +394,9 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-13, windows-latest, ubuntu-latest]
- distribution: ['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine']
+ os: [macos-15-intel, windows-latest, ubuntu-latest]
+ distribution:
+ ['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
java-package: ['jre']
version: ['17.0']
include:
@@ -278,13 +416,57 @@ jobs:
java-package: jre+fx
version: '11'
os: ubuntu-latest
+ - distribution: 'liberica-nik'
+ java-package: jdk+fx
+ version: '21'
+ os: ubuntu-latest
- distribution: 'corretto'
java-package: jre
version: '8'
os: windows-latest
+ - distribution: 'jetbrains'
+ java-package: jdk+jcef
+ version: '11'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jdk+jcef
+ version: '17'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jdk+jcef
+ version: '21'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jre+jcef
+ version: '11'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jre+jcef
+ version: '17'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jre+jcef
+ version: '21'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jdk+ft
+ version: '17'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jdk+ft
+ version: '21'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jre+ft
+ version: '17'
+ os: ubuntu-latest
+ - distribution: 'jetbrains'
+ java-package: jre+ft
+ version: '21'
+ os: ubuntu-latest
+
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
@@ -292,8 +474,13 @@ jobs:
java-version: ${{ matrix.version }}
java-package: ${{ matrix.java-package }}
distribution: ${{ matrix.distribution }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
# Only Liberica and Zulu provide x86
@@ -305,12 +492,11 @@ jobs:
fail-fast: false
matrix:
# x86 is not supported on macOS
- os: [windows-latest, ubuntu-latest]
+ os: [windows-latest, ubuntu-22.04]
distribution: ['liberica', 'zulu', 'corretto']
version: ['11']
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: setup-java
uses: ./
id: setup-java
@@ -319,21 +505,42 @@ jobs:
java-version: ${{ matrix.version }}
architecture: 'x86'
- name: Verify Java
- run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_VERSION: ${{ matrix.version }}
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
shell: bash
+ setup-java-unsupported-platform:
+ name: Reject unsupported Oracle x86 on Linux
+ runs-on: ubuntu-latest
+ steps:
+ - *checkout_step
+ - name: Attempt unsupported setup
+ id: unsupported-setup
+ continue-on-error: true
+ uses: ./
+ with:
+ distribution: oracle
+ java-version: '21'
+ architecture: x86
+ - name: Verify setup was rejected
+ if: always()
+ env:
+ SETUP_OUTCOME: ${{ steps.unsupported-setup.outcome }}
+ run: test "$SETUP_OUTCOME" = failure
+
setup-java-version-both-version-inputs-presents:
name: ${{ matrix.distribution }} version (should be from input) - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: *default_os
distribution: ['temurin', 'microsoft', 'corretto']
java-version-file: ['.java-version', '.tool-versions']
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: Create .java-version file
shell: bash
run: echo "17" > .java-version
@@ -348,7 +555,9 @@ jobs:
java-version: 11
java-version-file: ${{matrix.java-version-file }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "11" "$JAVA_PATH"
shell: bash
setup-java-version-from-file-major-notation:
@@ -357,12 +566,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
+ os: *default_os
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
java-version-file: ['.java-version', '.tool-versions']
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: Create .java-version file
shell: bash
run: echo "11" > .java-version
@@ -376,7 +584,9 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version-file: ${{matrix.java-version-file }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "11" "$JAVA_PATH"
shell: bash
setup-java-version-from-file-major-minor-patch-notation:
@@ -385,12 +595,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- distribution: ['adopt', 'adopt-openj9', 'zulu']
+ os: *default_os
+ distribution: ['temurin', 'zulu']
java-version-file: ['.java-version', '.tool-versions']
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: Create .java-version file
shell: bash
run: echo "17.0.10" > .java-version
@@ -404,27 +613,31 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version-file: ${{matrix.java-version-file }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "17.0.10" "$JAVA_PATH"
shell: bash
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 }}
strategy:
fail-fast: false
matrix:
- os: [macos-latest, windows-latest, ubuntu-latest]
- distribution: ['adopt', 'zulu', 'liberica']
- java-version-file: ['.java-version', '.tool-versions']
+ os: *default_os
+ distribution: ['temurin', 'zulu', 'liberica']
+ java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - *checkout_step
- name: Create .java-version file
shell: bash
run: echo "openjdk64-17.0.10" > .java-version
- name: Create .tool-versions file
shell: bash
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
uses: ./
id: setup-java
@@ -432,5 +645,106 @@ jobs:
distribution: ${{ matrix.distribution }}
java-version-file: ${{matrix.java-version-file }}
- name: Verify Java
- run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}"
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "17.0.10" "$JAVA_PATH"
+ shell: bash
+
+ setup-java-version-from-sdkman-major:
+ name: temurin 26 from .sdkmanrc - ubuntu-latest
+ runs-on: ubuntu-latest
+ steps:
+ - *checkout_step
+ - name: Create SDKMAN and Gradle files
+ run: |
+ echo "java=26-tem" > .sdkmanrc
+ touch build.gradle
+ - name: setup-java
+ uses: ./
+ id: setup-java
+ with:
+ java-version-file: .sdkmanrc
+ cache: gradle
+ - name: Verify Java
+ env:
+ JAVA_PATH: ${{ steps.setup-java.outputs.path }}
+ run: bash __tests__/verify-java.sh "26" "$JAVA_PATH"
+
+ setup-java-set-default:
+ name: set-default option - ${{ matrix.os }}
+ needs: setup-java-major-versions
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: *default_os
+ steps:
+ - *checkout_step
+ - name: Setup Java 17 as default
+ uses: ./
+ id: setup-java-17
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Setup Java 21 without setting as default
+ uses: ./
+ id: setup-java-21
+ with:
+ distribution: 'temurin'
+ java-version: '21'
+ set-default: false
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Verify JAVA_HOME still points to Java 17
+ env:
+ JAVA_17_PATH: ${{ steps.setup-java-17.outputs.path }}
+ run: |
+ echo "JAVA_HOME=$JAVA_HOME"
+ echo "Java 17 path=$JAVA_17_PATH"
+ if [ "$JAVA_HOME" != "$JAVA_17_PATH" ]; then
+ echo "JAVA_HOME should still point to Java 17"
+ exit 1
+ fi
+ shell: bash
+ - name: Verify java -version reports Java 17
+ run: |
+ JAVA_VERSION=$(java -version 2>&1 | head -1)
+ echo "java -version: $JAVA_VERSION"
+ if ! echo "$JAVA_VERSION" | grep -q "17"; then
+ echo "Default java should still be version 17"
+ exit 1
+ fi
+ shell: bash
+ - name: Verify JAVA_HOME_21 env var is set
+ run: |
+ $javaArch = if ($env:RUNNER_ARCH -eq "ARM64") { "AARCH64" } else { $env:RUNNER_ARCH }
+ $envName = "JAVA_HOME_21_${javaArch}"
+ $JavaVersionPath = [Environment]::GetEnvironmentVariable($envName)
+ if (-not $JavaVersionPath) {
+ Write-Host "$envName is not set"
+ exit 1
+ }
+ if (-not (Test-Path "$JavaVersionPath")) {
+ Write-Host "$envName path does not exist: $JavaVersionPath"
+ exit 1
+ }
+ Write-Host "$envName=$JavaVersionPath"
+ shell: pwsh
+ - name: Verify Java 21 outputs are set
+ env:
+ JAVA_21_PATH: ${{ steps.setup-java-21.outputs.path }}
+ JAVA_21_VERSION: ${{ steps.setup-java-21.outputs.version }}
+ run: |
+ echo "Java 21 path=$JAVA_21_PATH"
+ echo "Java 21 version=$JAVA_21_VERSION"
+ if [ -z "$JAVA_21_PATH" ]; then
+ echo "Java 21 path output should be set"
+ exit 1
+ fi
+ if [ -z "$JAVA_21_VERSION" ]; then
+ echo "Java 21 version output should be set"
+ exit 1
+ fi
shell: bash
diff --git a/.github/workflows/latest-jdk-versions.yml b/.github/workflows/latest-jdk-versions.yml
new file mode 100644
index 000000000..eb140c5ea
--- /dev/null
+++ b/.github/workflows/latest-jdk-versions.yml
@@ -0,0 +1,157 @@
+# Daily report of the exact JDK version each distribution currently resolves
+# for every major from Java 6 through the newest GA release, and `latest`, on every operating
+# system and architecture setup-java supports for it. Versions are resolved
+# from vendor metadata only; no JDK is downloaded.
+name: Latest JDK versions report
+
+on:
+ schedule:
+ - cron: '30 6 * * *'
+ workflow_dispatch:
+ inputs:
+ java-versions:
+ description: 'Comma-separated java-version values (default: every major from Java 6 through the newest GA release, and latest)'
+ required: false
+ default: ''
+ pull_request:
+ paths:
+ - 'src/reports/**'
+ - '.github/workflows/latest-jdk-versions.yml'
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ build:
+ name: Build report tool
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - name: Setup Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: '24.x'
+ cache: npm
+ - name: Install dependencies
+ run: npm ci
+ - name: Bundle report tool
+ run: npm run build:latest-versions-report
+ - name: Upload report tool
+ uses: actions/upload-artifact@v7
+ with:
+ name: latest-versions-report-tool
+ path: lib/latest-versions-report/
+ retention-days: 1
+
+ resolve:
+ name: Resolve versions (${{ matrix.platform }})
+ needs: build
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-latest
+ platform: linux
+ - os: macos-latest
+ platform: macos
+ - os: windows-latest
+ platform: windows
+ # Liberica's Solaris metadata is queried without running a Solaris JDK.
+ - os: ubuntu-latest
+ platform: solaris
+ steps:
+ - name: Setup Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: '24.x'
+ - name: Download report tool
+ uses: actions/download-artifact@v8
+ with:
+ name: latest-versions-report-tool
+ path: tool
+ - name: Resolve latest versions without downloading
+ run: node tool/index.js resolve "results/$REPORT_PLATFORM.json"
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ REPORT_VERSIONS: ${{ inputs.java-versions }}
+ REPORT_PLATFORM: ${{ matrix.platform }}
+ - name: Upload resolved versions
+ uses: actions/upload-artifact@v7
+ with:
+ name: latest-jdk-versions-${{ matrix.platform }}
+ path: results/
+ retention-days: 1
+
+ # Installers pick musl builds on Alpine, which can resolve to other versions.
+ resolve-alpine:
+ name: Resolve versions (alpine)
+ needs: build
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ container:
+ image: node:24-alpine
+ defaults:
+ run:
+ shell: sh
+ steps:
+ - name: Download report tool
+ uses: actions/download-artifact@v8
+ with:
+ name: latest-versions-report-tool
+ path: tool
+ - name: Resolve latest versions without downloading
+ run: node tool/index.js resolve results/alpine.json
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ REPORT_VERSIONS: ${{ inputs.java-versions }}
+ - name: Upload resolved versions
+ uses: actions/upload-artifact@v7
+ with:
+ name: latest-jdk-versions-alpine
+ path: results/
+ retention-days: 1
+
+ report:
+ name: Report
+ needs: [build, resolve, resolve-alpine]
+ if: ${{ !cancelled() && needs.build.result == 'success' }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: '24.x'
+ - name: Download report tool
+ uses: actions/download-artifact@v8
+ with:
+ name: latest-versions-report-tool
+ path: tool
+ - name: Download resolved versions
+ uses: actions/download-artifact@v8
+ with:
+ pattern: latest-jdk-versions-*
+ path: results
+ merge-multiple: true
+ - name: Write report
+ run: node tool/index.js summarize results latest-jdk-versions.md
+ - name: Upload report
+ uses: actions/upload-artifact@v7
+ with:
+ name: latest-jdk-versions-report
+ path: |
+ latest-jdk-versions.md
+ results/
+ retention-days: 30
diff --git a/.github/workflows/licensed.yml b/.github/workflows/licensed.yml
index 37f1560c3..b5d009cb5 100644
--- a/.github/workflows/licensed.yml
+++ b/.github/workflows/licensed.yml
@@ -9,6 +9,9 @@ on:
- main
workflow_dispatch:
+permissions:
+ contents: read
+
jobs:
call-licensed:
name: Licensed
diff --git a/.github/workflows/publish-immutable-actions.yml b/.github/workflows/publish-immutable-actions.yml
index 87c020728..3888f9a85 100644
--- a/.github/workflows/publish-immutable-actions.yml
+++ b/.github/workflows/publish-immutable-actions.yml
@@ -2,7 +2,10 @@ name: 'Publish Immutable Action Version'
on:
release:
- types: [published]
+ types: [released]
+ workflow_dispatch:
+
+permissions: {}
jobs:
publish:
@@ -14,7 +17,9 @@ jobs:
steps:
- name: Checking out
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Publish
id: publish
- uses: actions/publish-immutable-action@0.0.3
+ uses: actions/publish-immutable-action@v0.0.4
diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml
index e584e46f6..25192b640 100644
--- a/.github/workflows/release-new-action-version.yml
+++ b/.github/workflows/release-new-action-version.yml
@@ -23,7 +23,7 @@ jobs:
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
- uses: actions/publish-action@v0.2.2
+ uses: actions/publish-action@v0.4.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
diff --git a/.github/workflows/update-config-files.yml b/.github/workflows/update-config-files.yml
index 87af50042..bacdc74ec 100644
--- a/.github/workflows/update-config-files.yml
+++ b/.github/workflows/update-config-files.yml
@@ -5,7 +5,12 @@ on:
- cron: '0 3 * * 0'
workflow_dispatch:
+permissions: {}
+
jobs:
call-update-configuration-files:
name: Update configuration files
+ permissions:
+ contents: write # to push the branch with updated configuration files
+ pull-requests: write # to open/update the configuration update PR
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml
new file mode 100644
index 000000000..2009e6e70
--- /dev/null
+++ b/.github/workflows/zizmor.yml
@@ -0,0 +1,48 @@
+name: Security analysis with zizmor
+
+on:
+ push:
+ branches:
+ - main
+ - releases/*
+ paths-ignore:
+ - '**.md'
+ pull_request:
+ paths-ignore:
+ - '**.md'
+ workflow_dispatch:
+
+permissions: {}
+
+jobs:
+ zizmor:
+ name: Analyze workflows with zizmor
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ security-events: write # to upload SARIF results to code scanning
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+
+ - name: Set up Python
+ uses: actions/setup-python@v7
+ with:
+ python-version: '3.x'
+
+ - name: Install zizmor
+ run: pip install zizmor
+
+ - name: Run zizmor
+ run: zizmor --format sarif .github/workflows/ > zizmor.sarif
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Upload SARIF results to code scanning
+ if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
+ uses: github/codeql-action/upload-sarif@v4
+ with:
+ sarif_file: zizmor.sarif
+ category: zizmor
diff --git a/.github/zizmor.yml b/.github/zizmor.yml
new file mode 100644
index 000000000..38309ec47
--- /dev/null
+++ b/.github/zizmor.yml
@@ -0,0 +1,11 @@
+# Configuration for zizmor (https://docs.zizmor.sh)
+rules:
+ unpinned-uses:
+ config:
+ # First-party GitHub-maintained actions are trusted and referenced by
+ # major-version tags (the convention used across the actions org).
+ # Any third-party action must be pinned to a full commit SHA.
+ policies:
+ actions/*: ref-pin
+ github/*: ref-pin
+ '*': hash-pin
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 000000000..2312dc587
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npx lint-staged
diff --git a/.husky/pre-push b/.husky/pre-push
new file mode 100755
index 000000000..192cb67eb
--- /dev/null
+++ b/.husky/pre-push
@@ -0,0 +1 @@
+npm run build && npm test
diff --git a/.licensed.yml b/.licensed.yml
index e97382c4d..7f17bb852 100644
--- a/.licensed.yml
+++ b/.licensed.yml
@@ -10,6 +10,11 @@ allowed:
- mit
- cc0-1.0
- unlicense
+ - blueoak-1.0.0
reviewed:
- npm:
\ No newline at end of file
+ npm:
+ - "@actions/http-client" # MIT (license text present), but detected as "other"
+ - "argparse" # Python Software Foundation License (PSF), but detected as "other"
+ - "balanced-match"
+ - "brace-expansion"
diff --git a/.licenses/npm/@actions/cache.dep.yml b/.licenses/npm/@actions/cache.dep.yml
index b37997fc1..77337a724 100644
--- a/.licenses/npm/@actions/cache.dep.yml
+++ b/.licenses/npm/@actions/cache.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/cache"
-version: 3.2.4
+version: 6.3.0
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
diff --git a/.licenses/npm/@actions/core.dep.yml b/.licenses/npm/@actions/core.dep.yml
index 06638c01d..081715159 100644
--- a/.licenses/npm/@actions/core.dep.yml
+++ b/.licenses/npm/@actions/core.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/core"
-version: 1.10.1
+version: 3.0.1
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core
diff --git a/.licenses/npm/@actions/exec.dep.yml b/.licenses/npm/@actions/exec.dep.yml
index cbc5abd39..003562f8b 100644
--- a/.licenses/npm/@actions/exec.dep.yml
+++ b/.licenses/npm/@actions/exec.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/exec"
-version: 1.1.1
+version: 3.0.0
type: npm
summary: Actions exec lib
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
diff --git a/.licenses/npm/@actions/glob-0.1.2.dep.yml b/.licenses/npm/@actions/glob-0.1.2.dep.yml
deleted file mode 100644
index becb37de2..000000000
--- a/.licenses/npm/@actions/glob-0.1.2.dep.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: "@actions/glob"
-version: 0.1.2
-type: npm
-summary: Actions glob lib
-homepage: https://github.com/actions/toolkit/tree/main/packages/glob
-license: mit
-licenses:
-- sources: LICENSE.md
- text: |-
- The MIT License (MIT)
-
- Copyright 2019 GitHub
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/@actions/glob-0.4.0.dep.yml b/.licenses/npm/@actions/glob.dep.yml
similarity index 98%
rename from .licenses/npm/@actions/glob-0.4.0.dep.yml
rename to .licenses/npm/@actions/glob.dep.yml
index 137541859..24d3f6916 100644
--- a/.licenses/npm/@actions/glob-0.4.0.dep.yml
+++ b/.licenses/npm/@actions/glob.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/glob"
-version: 0.4.0
+version: 0.7.0
type: npm
summary: Actions glob lib
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
diff --git a/.licenses/npm/@actions/http-client.dep.yml b/.licenses/npm/@actions/http-client.dep.yml
index cdccff4e1..dc741537d 100644
--- a/.licenses/npm/@actions/http-client.dep.yml
+++ b/.licenses/npm/@actions/http-client.dep.yml
@@ -1,10 +1,10 @@
---
name: "@actions/http-client"
-version: 2.2.1
+version: 4.0.1
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
-license: mit
+license: other
licenses:
- sources: LICENSE
text: |
diff --git a/.licenses/npm/@actions/io.dep.yml b/.licenses/npm/@actions/io.dep.yml
index d28465403..dadddb4ed 100644
--- a/.licenses/npm/@actions/io.dep.yml
+++ b/.licenses/npm/@actions/io.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/io"
-version: 1.1.3
+version: 3.0.2
type: npm
summary: Actions io lib
homepage: https://github.com/actions/toolkit/tree/main/packages/io
diff --git a/.licenses/npm/@actions/tool-cache.dep.yml b/.licenses/npm/@actions/tool-cache.dep.yml
index fbf911fef..e7bf5bf0f 100644
--- a/.licenses/npm/@actions/tool-cache.dep.yml
+++ b/.licenses/npm/@actions/tool-cache.dep.yml
@@ -1,6 +1,6 @@
---
name: "@actions/tool-cache"
-version: 2.0.1
+version: 4.0.0
type: npm
summary: Actions tool-cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache
diff --git a/.licenses/npm/@azure/abort-controller.dep.yml b/.licenses/npm/@azure/abort-controller.dep.yml
index b19b8f7a4..32d238adf 100644
--- a/.licenses/npm/@azure/abort-controller.dep.yml
+++ b/.licenses/npm/@azure/abort-controller.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/abort-controller"
-version: 1.1.0
+version: 2.2.0
type: npm
summary: Microsoft Azure SDK for JavaScript - Aborter
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-auth.dep.yml b/.licenses/npm/@azure/core-auth.dep.yml
index 85f1bb89b..48b2844a8 100644
--- a/.licenses/npm/@azure/core-auth.dep.yml
+++ b/.licenses/npm/@azure/core-auth.dep.yml
@@ -1,17 +1,17 @@
---
name: "@azure/core-auth"
-version: 1.5.0
+version: 1.11.0
type: npm
summary: Provides low-level interfaces and helper methods for authentication in Azure
SDK
-homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-auth/README.md
+homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-auth/README.md
license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-http.dep.yml b/.licenses/npm/@azure/core-client.dep.yml
similarity index 78%
rename from .licenses/npm/@azure/core-http.dep.yml
rename to .licenses/npm/@azure/core-client.dep.yml
index 6a443e75c..ea8eb8ec9 100644
--- a/.licenses/npm/@azure/core-http.dep.yml
+++ b/.licenses/npm/@azure/core-client.dep.yml
@@ -1,17 +1,16 @@
---
-name: "@azure/core-http"
-version: 3.0.4
+name: "@azure/core-client"
+version: 1.11.1
type: npm
-summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
- libraries generated using AutoRest
-homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-http/README.md
+summary: Core library for interfacing with AutoRest generated code
+homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client/
license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-http-compat.dep.yml b/.licenses/npm/@azure/core-http-compat.dep.yml
new file mode 100644
index 000000000..c25f52b53
--- /dev/null
+++ b/.licenses/npm/@azure/core-http-compat.dep.yml
@@ -0,0 +1,32 @@
+---
+name: "@azure/core-http-compat"
+version: 2.5.0
+type: npm
+summary: Core HTTP Compatibility Library to bridge the gap between Core V1 & V2 packages.
+homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-http-compat/
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ Copyright (c) Microsoft Corporation.
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []
diff --git a/.licenses/npm/@azure/core-lro.dep.yml b/.licenses/npm/@azure/core-lro.dep.yml
index 29683014c..46cbe6e51 100644
--- a/.licenses/npm/@azure/core-lro.dep.yml
+++ b/.licenses/npm/@azure/core-lro.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/core-lro"
-version: 2.5.4
+version: 2.7.2
type: npm
summary: Isomorphic client library for supporting long-running operations in node.js
and browser.
diff --git a/.licenses/npm/@azure/core-paging.dep.yml b/.licenses/npm/@azure/core-paging.dep.yml
index dccc04820..09c56a260 100644
--- a/.licenses/npm/@azure/core-paging.dep.yml
+++ b/.licenses/npm/@azure/core-paging.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/core-paging"
-version: 1.5.0
+version: 1.7.0
type: npm
summary: Core types for paging async iterable iterators
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-rest-pipeline-1.23.0.dep.yml b/.licenses/npm/@azure/core-rest-pipeline-1.23.0.dep.yml
new file mode 100644
index 000000000..8a1cad571
--- /dev/null
+++ b/.licenses/npm/@azure/core-rest-pipeline-1.23.0.dep.yml
@@ -0,0 +1,32 @@
+---
+name: "@azure/core-rest-pipeline"
+version: 1.23.0
+type: npm
+summary: Isomorphic client library for making HTTP requests in node.js and browser.
+homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ Copyright (c) Microsoft Corporation.
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []
diff --git a/.licenses/npm/@azure/core-rest-pipeline-1.25.0.dep.yml b/.licenses/npm/@azure/core-rest-pipeline-1.25.0.dep.yml
new file mode 100644
index 000000000..663516957
--- /dev/null
+++ b/.licenses/npm/@azure/core-rest-pipeline-1.25.0.dep.yml
@@ -0,0 +1,32 @@
+---
+name: "@azure/core-rest-pipeline"
+version: 1.25.0
+type: npm
+summary: Isomorphic client library for making HTTP requests in node.js and browser.
+homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-rest-pipeline/README.md
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ Copyright (c) Microsoft Corporation.
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []
diff --git a/.licenses/npm/@azure/core-tracing.dep.yml b/.licenses/npm/@azure/core-tracing.dep.yml
index a4649e886..467ae44b8 100644
--- a/.licenses/npm/@azure/core-tracing.dep.yml
+++ b/.licenses/npm/@azure/core-tracing.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/core-tracing"
-version: 1.0.0-preview.13
+version: 1.4.0
type: npm
summary: Provides low-level interfaces and helper methods for tracing in Azure SDK
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-tracing/README.md
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-util.dep.yml b/.licenses/npm/@azure/core-util.dep.yml
index 75ffb250f..7a6451790 100644
--- a/.licenses/npm/@azure/core-util.dep.yml
+++ b/.licenses/npm/@azure/core-util.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/core-util"
-version: 1.6.1
+version: 1.14.0
type: npm
summary: Core library for shared utility methods
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-util/
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/core-xml.dep.yml b/.licenses/npm/@azure/core-xml.dep.yml
new file mode 100644
index 000000000..f501dd734
--- /dev/null
+++ b/.licenses/npm/@azure/core-xml.dep.yml
@@ -0,0 +1,32 @@
+---
+name: "@azure/core-xml"
+version: 1.6.0
+type: npm
+summary: Core library for interacting with XML payloads
+homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-xml/README.md
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ Copyright (c) Microsoft Corporation.
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []
diff --git a/.licenses/npm/@azure/logger.dep.yml b/.licenses/npm/@azure/logger.dep.yml
index 971ba001c..511d51b7a 100644
--- a/.licenses/npm/@azure/logger.dep.yml
+++ b/.licenses/npm/@azure/logger.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/logger"
-version: 1.0.4
+version: 1.4.0
type: npm
summary: Microsoft Azure SDK for JavaScript - Logger
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/@azure/ms-rest-js.dep.yml b/.licenses/npm/@azure/ms-rest-js.dep.yml
deleted file mode 100644
index 762fcdb1e..000000000
--- a/.licenses/npm/@azure/ms-rest-js.dep.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-name: "@azure/ms-rest-js"
-version: 2.7.0
-type: npm
-summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
- libraries generated using AutoRest
-homepage: https://github.com/Azure/ms-rest-js
-license: mit
-licenses:
-- sources: LICENSE
- text: |2
- MIT License
-
- Copyright (c) Microsoft Corporation. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
-notices: []
diff --git a/.licenses/npm/@azure/storage-blob.dep.yml b/.licenses/npm/@azure/storage-blob.dep.yml
index c1a125164..e28cfaa1f 100644
--- a/.licenses/npm/@azure/storage-blob.dep.yml
+++ b/.licenses/npm/@azure/storage-blob.dep.yml
@@ -1,6 +1,6 @@
---
name: "@azure/storage-blob"
-version: 12.17.0
+version: 12.31.0
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
@@ -8,9 +8,9 @@ license: mit
licenses:
- sources: LICENSE
text: |
- The MIT License (MIT)
+ Copyright (c) Microsoft Corporation.
- Copyright (c) 2020 Microsoft
+ MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
diff --git a/.licenses/npm/event-target-shim.dep.yml b/.licenses/npm/@azure/storage-common.dep.yml
similarity index 82%
rename from .licenses/npm/event-target-shim.dep.yml
rename to .licenses/npm/@azure/storage-common.dep.yml
index 7a3fc011b..139a9a9d8 100644
--- a/.licenses/npm/event-target-shim.dep.yml
+++ b/.licenses/npm/@azure/storage-common.dep.yml
@@ -1,16 +1,16 @@
---
-name: event-target-shim
-version: 5.0.1
+name: "@azure/storage-common"
+version: 12.5.0
type: npm
-summary: An implementation of WHATWG EventTarget interface.
-homepage: https://github.com/mysticatea/event-target-shim
+summary: Azure Storage Common Client Library for JavaScript
+homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-common/README.md
license: mit
licenses:
- sources: LICENSE
- text: |+
+ text: |-
The MIT License (MIT)
- Copyright (c) 2015 Toru Nagashima
+ Copyright (c) 2018 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -29,5 +29,4 @@ licenses:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-
notices: []
diff --git a/.licenses/npm/@fastify/busboy.dep.yml b/.licenses/npm/@fastify/busboy.dep.yml
deleted file mode 100644
index 51267ac9f..000000000
--- a/.licenses/npm/@fastify/busboy.dep.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-name: "@fastify/busboy"
-version: 2.1.0
-type: npm
-summary: A streaming parser for HTML form data for node.js
-homepage:
-license: mit
-licenses:
-- sources: LICENSE
- text: |-
- Copyright Brian White. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to
- deal in the Software without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- sell copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- IN THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/@nodable/entities.dep.yml b/.licenses/npm/@nodable/entities.dep.yml
new file mode 100644
index 000000000..bebf9b903
--- /dev/null
+++ b/.licenses/npm/@nodable/entities.dep.yml
@@ -0,0 +1,11 @@
+---
+name: "@nodable/entities"
+version: 3.1.0
+type: npm
+summary: Entity parser for XML, HTML, External entites with security and NCR control
+homepage:
+license: mit
+licenses:
+- sources: README.md
+ text: MIT
+notices: []
diff --git a/.licenses/npm/@opentelemetry/api.dep.yml b/.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
similarity index 83%
rename from .licenses/npm/@opentelemetry/api.dep.yml
rename to .licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
index 74c3159ad..79644b5d7 100644
--- a/.licenses/npm/@opentelemetry/api.dep.yml
+++ b/.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
@@ -1,14 +1,14 @@
---
-name: "@opentelemetry/api"
-version: 1.7.0
+name: "@protobuf-ts/runtime-rpc"
+version: 2.11.1
type: npm
-summary: Public API for OpenTelemetry
-homepage: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
+summary: Runtime library for RPC clients generated by the protoc plugin "protobuf-ts"
+homepage: https://github.com/timostamm/protobuf-ts
license: apache-2.0
licenses:
- sources: LICENSE
text: |2
- Apache License
+ Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -182,42 +182,4 @@ licenses:
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-- sources: README.md
- text: |-
- Apache 2.0 - See [LICENSE][license-url] for more information.
-
- [opentelemetry-js]: https://github.com/open-telemetry/opentelemetry-js
-
- [discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
- [license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
- [license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
- [docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
- [docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
notices: []
diff --git a/.licenses/npm/@protobuf-ts/runtime.dep.yml b/.licenses/npm/@protobuf-ts/runtime.dep.yml
new file mode 100644
index 000000000..7a210232d
--- /dev/null
+++ b/.licenses/npm/@protobuf-ts/runtime.dep.yml
@@ -0,0 +1,185 @@
+---
+name: "@protobuf-ts/runtime"
+version: 2.11.1
+type: npm
+summary: Runtime library for code generated by the protoc plugin "protobuf-ts"
+homepage: https://github.com/timostamm/protobuf-ts
+license: apache-2.0
+licenses:
+- sources: LICENSE
+ text: |2
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+notices: []
diff --git a/.licenses/npm/@types/node-fetch.dep.yml b/.licenses/npm/@types/node-fetch.dep.yml
deleted file mode 100644
index e335d29a1..000000000
--- a/.licenses/npm/@types/node-fetch.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: "@types/node-fetch"
-version: 2.6.9
-type: npm
-summary: TypeScript definitions for node-fetch
-homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
-license: mit
-licenses:
-- sources: LICENSE
- text: |2
- MIT License
-
- Copyright (c) Microsoft Corporation.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
-notices: []
diff --git a/.licenses/npm/@types/node.dep.yml b/.licenses/npm/@types/node.dep.yml
deleted file mode 100644
index 06fb919df..000000000
--- a/.licenses/npm/@types/node.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: "@types/node"
-version: 20.11.24
-type: npm
-summary: TypeScript definitions for node
-homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
-license: mit
-licenses:
-- sources: LICENSE
- text: |2
- MIT License
-
- Copyright (c) Microsoft Corporation.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
-notices: []
diff --git a/.licenses/npm/@types/tunnel.dep.yml b/.licenses/npm/@types/tunnel.dep.yml
deleted file mode 100644
index b3636b02d..000000000
--- a/.licenses/npm/@types/tunnel.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: "@types/tunnel"
-version: 0.0.3
-type: npm
-summary: TypeScript definitions for tunnel
-homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tunnel
-license: mit
-licenses:
-- sources: LICENSE
- text: |2
- MIT License
-
- Copyright (c) Microsoft Corporation.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE
-notices: []
diff --git a/.licenses/npm/@typespec/ts-http-runtime.dep.yml b/.licenses/npm/@typespec/ts-http-runtime.dep.yml
new file mode 100644
index 000000000..260656874
--- /dev/null
+++ b/.licenses/npm/@typespec/ts-http-runtime.dep.yml
@@ -0,0 +1,32 @@
+---
+name: "@typespec/ts-http-runtime"
+version: 0.3.9
+type: npm
+summary: Isomorphic client library for making HTTP requests in node.js and browser.
+homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/ts-http-runtime/README.md
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ Copyright (c) Microsoft Corporation.
+
+ MIT License
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []
diff --git a/.licenses/npm/abort-controller.dep.yml b/.licenses/npm/abort-controller.dep.yml
deleted file mode 100644
index 492a609bb..000000000
--- a/.licenses/npm/abort-controller.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: abort-controller
-version: 3.0.0
-type: npm
-summary: An implementation of WHATWG AbortController interface.
-homepage: https://github.com/mysticatea/abort-controller#readme
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- MIT License
-
- Copyright (c) 2017 Toru Nagashima
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-notices: []
diff --git a/.licenses/npm/process.dep.yml b/.licenses/npm/agent-base.dep.yml
similarity index 84%
rename from .licenses/npm/process.dep.yml
rename to .licenses/npm/agent-base.dep.yml
index 2bf50598a..54c324a34 100644
--- a/.licenses/npm/process.dep.yml
+++ b/.licenses/npm/agent-base.dep.yml
@@ -1,16 +1,16 @@
---
-name: process
-version: 0.11.10
+name: agent-base
+version: 7.1.4
type: npm
-summary: process information for node.js and browsers
-homepage: https://github.com/shtylman/node-process#readme
+summary: Turn a function into an `http.Agent` instance
+homepage:
license: mit
licenses:
- sources: LICENSE
- text: |
+ text: |-
(The MIT License)
- Copyright (c) 2013 Roman Shtylman
+ Copyright (c) 2013 Nathan Rajlich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/.licenses/npm/anynum.dep.yml b/.licenses/npm/anynum.dep.yml
new file mode 100644
index 000000000..891456f01
--- /dev/null
+++ b/.licenses/npm/anynum.dep.yml
@@ -0,0 +1,35 @@
+---
+name: anynum
+version: 1.0.1
+type: npm
+summary: Normalize all Unicode decimal digits (Devanagari, Arabic, Thai, etc.) to
+ ASCII numerals. Zero dependencies, performance-first.
+homepage:
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ MIT License
+
+ Copyright (c) 2026 Natural Intelligence
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+- sources: README.md
+ text: MIT
+notices: []
diff --git a/.licenses/npm/argparse.dep.yml b/.licenses/npm/argparse.dep.yml
deleted file mode 100644
index 2cd2843cf..000000000
--- a/.licenses/npm/argparse.dep.yml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-name: argparse
-version: 1.0.10
-type: npm
-summary: Very powerful CLI arguments parser. Native port of argparse - python's options
- parsing library
-homepage: https://github.com/nodeca/argparse#readme
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- (The MIT License)
-
- Copyright (C) 2012 by Vitaly Puzrin
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-- sources: README.md
- text: |-
- Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
- Released under the MIT license. See
- [LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
-notices: []
diff --git a/.licenses/npm/asynckit.dep.yml b/.licenses/npm/asynckit.dep.yml
deleted file mode 100644
index 905e0aaa9..000000000
--- a/.licenses/npm/asynckit.dep.yml
+++ /dev/null
@@ -1,34 +0,0 @@
----
-name: asynckit
-version: 0.4.0
-type: npm
-summary: Minimal async jobs utility library, with streams support
-homepage: https://github.com/alexindigo/asynckit#readme
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- The MIT License (MIT)
-
- Copyright (c) 2016 Alex Indigo
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-- sources: README.md
- text: AsyncKit is licensed under the MIT license.
-notices: []
diff --git a/.licenses/npm/balanced-match.dep.yml b/.licenses/npm/balanced-match.dep.yml
index 36095592b..101c2c32b 100644
--- a/.licenses/npm/balanced-match.dep.yml
+++ b/.licenses/npm/balanced-match.dep.yml
@@ -1,39 +1,18 @@
---
name: balanced-match
-version: 1.0.2
+version: 4.0.4
type: npm
summary: Match balanced character pairs, like "{" and "}"
-homepage: https://github.com/juliangruber/balanced-match
+homepage:
license: mit
licenses:
- sources: LICENSE.md
text: |
(MIT)
- Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+ Original code Copyright Julian Gruber
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-- sources: README.md
- text: |-
- (MIT)
-
- Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+ Port to TypeScript Copyright Isaac Z. Schlueter
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/.licenses/npm/brace-expansion.dep.yml b/.licenses/npm/brace-expansion.dep.yml
index 8fa6cfb31..8a9c0556d 100644
--- a/.licenses/npm/brace-expansion.dep.yml
+++ b/.licenses/npm/brace-expansion.dep.yml
@@ -1,16 +1,18 @@
---
name: brace-expansion
-version: 1.1.11
+version: 5.0.12
type: npm
summary: Brace expansion as known from sh/bash
-homepage: https://github.com/juliangruber/brace-expansion
+homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
- Copyright (c) 2013 Julian Gruber
+ Copyright Julian Gruber
+
+ TypeScript port Copyright Isaac Z. Schlueter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -22,29 +24,6 @@ licenses:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-- sources: README.md
- text: |-
- (MIT)
-
- Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
diff --git a/.licenses/npm/combined-stream.dep.yml b/.licenses/npm/combined-stream.dep.yml
deleted file mode 100644
index 2b392155d..000000000
--- a/.licenses/npm/combined-stream.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: combined-stream
-version: 1.0.8
-type: npm
-summary: A stream that emits multiple other streams one after another.
-homepage: https://github.com/felixge/node-combined-stream
-license: mit
-licenses:
-- sources: License
- text: |
- Copyright (c) 2011 Debuggable Limited
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-- sources: Readme.md
- text: combined-stream is licensed under the MIT license.
-notices: []
diff --git a/.licenses/npm/concat-map.dep.yml b/.licenses/npm/concat-map.dep.yml
deleted file mode 100644
index 20216b958..000000000
--- a/.licenses/npm/concat-map.dep.yml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-name: concat-map
-version: 0.0.1
-type: npm
-summary: concatenative mapdashery
-homepage: https://github.com/substack/node-concat-map#readme
-license: other
-licenses:
-- sources: LICENSE
- text: |
- This software is released under the MIT license:
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- the Software, and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- sources: README.markdown
- text: MIT
-notices: []
diff --git a/.licenses/npm/debug.dep.yml b/.licenses/npm/debug.dep.yml
new file mode 100644
index 000000000..b49c69e92
--- /dev/null
+++ b/.licenses/npm/debug.dep.yml
@@ -0,0 +1,56 @@
+---
+name: debug
+version: 4.4.3
+type: npm
+summary: Lightweight debugging utility for Node.js and the browser
+homepage:
+license: mit
+licenses:
+- sources: LICENSE
+ text: |+
+ (The MIT License)
+
+ Copyright (c) 2014-2017 TJ Holowaychuk
+ Copyright (c) 2018-2021 Josh Junon
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+ and associated documentation files (the 'Software'), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+- sources: README.md
+ text: |-
+ (The MIT License)
+
+ Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+ Copyright (c) 2018-2021 Josh Junon
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ 'Software'), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+notices: []
diff --git a/.licenses/npm/delayed-stream.dep.yml b/.licenses/npm/delayed-stream.dep.yml
deleted file mode 100644
index 124012173..000000000
--- a/.licenses/npm/delayed-stream.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: delayed-stream
-version: 1.0.0
-type: npm
-summary: Buffers events from a stream until you are ready to handle them.
-homepage: https://github.com/felixge/node-delayed-stream
-license: mit
-licenses:
-- sources: License
- text: |
- Copyright (c) 2011 Debuggable Limited
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-- sources: Readme.md
- text: delayed-stream is licensed under the MIT license.
-notices: []
diff --git a/.licenses/npm/esprima.dep.yml b/.licenses/npm/esprima.dep.yml
deleted file mode 100644
index 538091c52..000000000
--- a/.licenses/npm/esprima.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: esprima
-version: 4.0.1
-type: npm
-summary: ECMAScript parsing infrastructure for multipurpose analysis
-homepage: http://esprima.org
-license: bsd-2-clause
-licenses:
-- sources: LICENSE.BSD
- text: |
- Copyright JS Foundation and other contributors, https://js.foundation/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-notices: []
diff --git a/.licenses/npm/@oozcitak/dom.dep.yml b/.licenses/npm/fast-xml-builder.dep.yml
similarity index 88%
rename from .licenses/npm/@oozcitak/dom.dep.yml
rename to .licenses/npm/fast-xml-builder.dep.yml
index a810093aa..3e52f4152 100644
--- a/.licenses/npm/@oozcitak/dom.dep.yml
+++ b/.licenses/npm/fast-xml-builder.dep.yml
@@ -1,16 +1,16 @@
---
-name: "@oozcitak/dom"
-version: 1.15.8
+name: fast-xml-builder
+version: 1.3.1
type: npm
-summary: A modern DOM implementation
-homepage: http://github.com/oozcitak/dom
+summary: Build XML from JSON without C/C++ based libraries
+homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
- Copyright (c) 2019 Ozgur Ozcitak
+ Copyright (c) 2026 Natural Intelligence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/.licenses/npm/fast-xml-parser.dep.yml b/.licenses/npm/fast-xml-parser.dep.yml
new file mode 100644
index 000000000..0126797cf
--- /dev/null
+++ b/.licenses/npm/fast-xml-parser.dep.yml
@@ -0,0 +1,37 @@
+---
+name: fast-xml-parser
+version: 5.12.0
+type: npm
+summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
+homepage:
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ MIT License
+
+ Copyright (c) 2017 Amit Kumar Gupta
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+- sources: README.md
+ text: |-
+ * MIT License
+
+ 
+notices: []
diff --git a/.licenses/npm/form-data-2.5.1.dep.yml b/.licenses/npm/form-data-2.5.1.dep.yml
deleted file mode 100644
index 000f2223a..000000000
--- a/.licenses/npm/form-data-2.5.1.dep.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-name: form-data
-version: 2.5.1
-type: npm
-summary: A library to create readable "multipart/form-data" streams. Can be used to
- submit forms and file uploads to other web applications.
-homepage: https://github.com/form-data/form-data#readme
-license: mit
-licenses:
-- sources: License
- text: |
- Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-- sources: README.md
- text: Form-Data is released under the [MIT](License) license.
-notices: []
diff --git a/.licenses/npm/form-data-4.0.0.dep.yml b/.licenses/npm/form-data-4.0.0.dep.yml
deleted file mode 100644
index ced7212cc..000000000
--- a/.licenses/npm/form-data-4.0.0.dep.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-name: form-data
-version: 4.0.0
-type: npm
-summary: A library to create readable "multipart/form-data" streams. Can be used to
- submit forms and file uploads to other web applications.
-homepage: https://github.com/form-data/form-data#readme
-license: mit
-licenses:
-- sources: License
- text: |
- Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-- sources: Readme.md
- text: Form-Data is released under the [MIT](License) license.
-notices: []
diff --git a/.licenses/npm/mime-db.dep.yml b/.licenses/npm/http-proxy-agent.dep.yml
similarity index 85%
rename from .licenses/npm/mime-db.dep.yml
rename to .licenses/npm/http-proxy-agent.dep.yml
index 660566950..bcd275739 100644
--- a/.licenses/npm/mime-db.dep.yml
+++ b/.licenses/npm/http-proxy-agent.dep.yml
@@ -1,8 +1,8 @@
---
-name: mime-db
-version: 1.52.0
+name: http-proxy-agent
+version: 7.0.2
type: npm
-summary: Media Type Database
+summary: An HTTP(s) proxy `http.Agent` implementation for HTTP
homepage:
license: mit
licenses:
@@ -10,8 +10,7 @@ licenses:
text: |
(The MIT License)
- Copyright (c) 2014 Jonathan Ong
- Copyright (c) 2015-2022 Douglas Christopher Wilson
+ Copyright (c) 2013 Nathan Rajlich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/.licenses/npm/mime-types.dep.yml b/.licenses/npm/https-proxy-agent.dep.yml
similarity index 57%
rename from .licenses/npm/mime-types.dep.yml
rename to .licenses/npm/https-proxy-agent.dep.yml
index 832d2052d..7b6e176d7 100644
--- a/.licenses/npm/mime-types.dep.yml
+++ b/.licenses/npm/https-proxy-agent.dep.yml
@@ -1,17 +1,16 @@
---
-name: mime-types
-version: 2.1.35
+name: https-proxy-agent
+version: 7.0.6
type: npm
-summary: The ultimate javascript content-type utility.
+summary: An HTTP(s) proxy `http.Agent` implementation for HTTPS
homepage:
license: mit
licenses:
- sources: LICENSE
- text: |
+ text: |-
(The MIT License)
- Copyright (c) 2014 Jonathan Ong
- Copyright (c) 2015 Douglas Christopher Wilson
+ Copyright (c) 2013 Nathan Rajlich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -31,17 +30,4 @@ licenses:
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- sources: README.md
- text: |-
- [MIT](LICENSE)
-
- [ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
- [ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
- [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
- [coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
- [node-version-image]: https://badgen.net/npm/node/mime-types
- [node-version-url]: https://nodejs.org/en/download
- [npm-downloads-image]: https://badgen.net/npm/dm/mime-types
- [npm-url]: https://npmjs.org/package/mime-types
- [npm-version-image]: https://badgen.net/npm/v/mime-types
notices: []
diff --git a/.licenses/npm/is-unsafe.dep.yml b/.licenses/npm/is-unsafe.dep.yml
new file mode 100644
index 000000000..cbc4b8823
--- /dev/null
+++ b/.licenses/npm/is-unsafe.dep.yml
@@ -0,0 +1,35 @@
+---
+name: is-unsafe
+version: 2.0.3
+type: npm
+summary: Zero-dependency, DOM-free, pure predicate for detecting unsafe strings across
+ HTML, XML, SVG, SQL, SHELL, and REGEX contexts
+homepage:
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ MIT License
+
+ Copyright (c) 2026 Natural Intelligence
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+- sources: README.md
+ text: MIT
+notices: []
diff --git a/.licenses/npm/js-yaml.dep.yml b/.licenses/npm/js-yaml.dep.yml
deleted file mode 100644
index 3b8875d01..000000000
--- a/.licenses/npm/js-yaml.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: js-yaml
-version: 3.14.0
-type: npm
-summary: YAML 1.2 parser and serializer
-homepage: https://github.com/nodeca/js-yaml
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- (The MIT License)
-
- Copyright (C) 2011-2015 by Vitaly Puzrin
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/lru-cache.dep.yml b/.licenses/npm/lru-cache.dep.yml
deleted file mode 100644
index 920e7dc58..000000000
--- a/.licenses/npm/lru-cache.dep.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-name: lru-cache
-version: 6.0.0
-type: npm
-summary: A cache object that deletes the least-recently-used items.
-homepage: https://github.com/isaacs/node-lru-cache#readme
-license: isc
-licenses:
-- sources: LICENSE
- text: |
- The ISC License
-
- Copyright (c) Isaac Z. Schlueter and Contributors
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-notices: []
diff --git a/.licenses/npm/minimatch.dep.yml b/.licenses/npm/minimatch.dep.yml
index 869816f5f..d9010847c 100644
--- a/.licenses/npm/minimatch.dep.yml
+++ b/.licenses/npm/minimatch.dep.yml
@@ -1,26 +1,66 @@
---
name: minimatch
-version: 3.1.2
+version: 10.2.6
type: npm
summary: a glob matcher in javascript
-homepage: https://github.com/isaacs/minimatch#readme
-license: isc
+homepage:
+license: blueoak-1.0.0
licenses:
-- sources: LICENSE
+- sources: LICENSE.md
text: |
- The ISC License
+ # Blue Oak Model License
- Copyright (c) Isaac Z. Schlueter and Contributors
+ Version 1.0.0
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
+ ## Purpose
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ This license gives everyone as much permission to work with
+ this software as possible, while protecting contributors
+ from liability.
+
+ ## Acceptance
+
+ In order to receive this license, you must agree to its
+ rules. The rules of this license are both obligations
+ under that agreement and conditions to your license.
+ You must not do anything with this software that triggers
+ a rule that you cannot or will not follow.
+
+ ## Copyright
+
+ Each contributor licenses you to do everything with this
+ software that would otherwise infringe that contributor's
+ copyright in it.
+
+ ## Notices
+
+ You must ensure that everyone who gets a copy of
+ any part of this software from you, with or without
+ changes, also gets the text of this license or a link to
+ .
+
+ ## Excuse
+
+ If anyone notifies you in writing that you have not
+ complied with [Notices](#notices), you can keep your
+ license by taking all practical steps to comply within 30
+ days after the notice. If you do not do so, your license
+ ends immediately.
+
+ ## Patent
+
+ Each contributor licenses you to do everything with this
+ software that would otherwise infringe any patent claims
+ they can license or become able to license.
+
+ ## Reliability
+
+ No contributor can revoke this license.
+
+ ## No Liability
+
+ **_As far as the law allows, this software comes as is,
+ without any warranty or condition, and no contributor
+ will be liable to anyone for any damages related to this
+ software or this license, under any kind of legal claim._**
notices: []
diff --git a/.licenses/npm/undici-types.dep.yml b/.licenses/npm/ms.dep.yml
similarity index 86%
rename from .licenses/npm/undici-types.dep.yml
rename to .licenses/npm/ms.dep.yml
index a65b8affc..5a303e4d6 100644
--- a/.licenses/npm/undici-types.dep.yml
+++ b/.licenses/npm/ms.dep.yml
@@ -1,14 +1,16 @@
---
-name: undici-types
-version: 5.26.5
+name: ms
+version: 2.1.3
type: npm
-summary: A stand-alone types package for Undici
-homepage: https://undici.nodejs.org
+summary: Tiny millisecond conversion utility
+homepage:
license: mit
licenses:
-- sources: Auto-generated MIT license text
+- sources: license.md
text: |
- MIT License
+ The MIT License (MIT)
+
+ Copyright (c) 2020 Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/.licenses/npm/node-fetch.dep.yml b/.licenses/npm/node-fetch.dep.yml
deleted file mode 100644
index ec9a760d2..000000000
--- a/.licenses/npm/node-fetch.dep.yml
+++ /dev/null
@@ -1,56 +0,0 @@
----
-name: node-fetch
-version: 2.7.0
-type: npm
-summary: A light-weight module that brings window.fetch to node.js
-homepage: https://github.com/bitinn/node-fetch
-license: mit
-licenses:
-- sources: LICENSE.md
- text: |+
- The MIT License (MIT)
-
- Copyright (c) 2016 David Frank
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-
-- sources: README.md
- text: |-
- MIT
-
- [npm-image]: https://flat.badgen.net/npm/v/node-fetch
- [npm-url]: https://www.npmjs.com/package/node-fetch
- [travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
- [travis-url]: https://travis-ci.org/bitinn/node-fetch
- [codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
- [codecov-url]: https://codecov.io/gh/bitinn/node-fetch
- [install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
- [install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
- [discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
- [discord-url]: https://discord.gg/Zxbndcm
- [opencollective-image]: https://opencollective.com/node-fetch/backers.svg
- [opencollective-url]: https://opencollective.com/node-fetch
- [whatwg-fetch]: https://fetch.spec.whatwg.org/
- [response-init]: https://fetch.spec.whatwg.org/#responseinit
- [node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
- [mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
- [LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
- [ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
- [UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md
-notices: []
diff --git a/.licenses/npm/@oozcitak/url.dep.yml b/.licenses/npm/path-expression-matcher.dep.yml
similarity index 84%
rename from .licenses/npm/@oozcitak/url.dep.yml
rename to .licenses/npm/path-expression-matcher.dep.yml
index 6f3ae3985..a671e7d7c 100644
--- a/.licenses/npm/@oozcitak/url.dep.yml
+++ b/.licenses/npm/path-expression-matcher.dep.yml
@@ -1,16 +1,16 @@
---
-name: "@oozcitak/url"
-version: 1.0.4
+name: path-expression-matcher
+version: 1.6.2
type: npm
-summary: An implementation of the URL Living Standard
-homepage: http://github.com/oozcitak/url
+summary: Efficient path tracking and pattern matching for XML/JSON parsers
+homepage: https://github.com/NaturalIntelligence/path-expression-matcher#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
- Copyright (c) 2019 Ozgur Ozcitak
+ Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/.licenses/npm/sax.dep.yml b/.licenses/npm/sax.dep.yml
deleted file mode 100644
index 20f6c4671..000000000
--- a/.licenses/npm/sax.dep.yml
+++ /dev/null
@@ -1,52 +0,0 @@
----
-name: sax
-version: 1.3.0
-type: npm
-summary: An evented streaming XML parser in JavaScript
-homepage:
-license: isc
-licenses:
-- sources: LICENSE
- text: |
- The ISC License
-
- Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ====
-
- `String.fromCodePoint` by Mathias Bynens used according to terms of MIT
- License, as follows:
-
- Copyright (c) 2010-2022 Mathias Bynens
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/semver-6.3.1.dep.yml b/.licenses/npm/semver-6.3.1.dep.yml
deleted file mode 100644
index 248cb0301..000000000
--- a/.licenses/npm/semver-6.3.1.dep.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-name: semver
-version: 6.3.1
-type: npm
-summary: The semantic version parser used by npm.
-homepage:
-license: isc
-licenses:
-- sources: LICENSE
- text: |
- The ISC License
-
- Copyright (c) Isaac Z. Schlueter and Contributors
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-notices: []
diff --git a/.licenses/npm/semver-7.6.0.dep.yml b/.licenses/npm/semver.dep.yml
similarity index 98%
rename from .licenses/npm/semver-7.6.0.dep.yml
rename to .licenses/npm/semver.dep.yml
index bd631be07..c5813fabe 100644
--- a/.licenses/npm/semver-7.6.0.dep.yml
+++ b/.licenses/npm/semver.dep.yml
@@ -1,6 +1,6 @@
---
name: semver
-version: 7.6.0
+version: 7.8.5
type: npm
summary: The semantic version parser used by npm.
homepage:
diff --git a/.licenses/npm/sprintf-js.dep.yml b/.licenses/npm/sprintf-js.dep.yml
deleted file mode 100644
index e7157634f..000000000
--- a/.licenses/npm/sprintf-js.dep.yml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-name: sprintf-js
-version: 1.0.3
-type: npm
-summary: JavaScript sprintf implementation
-homepage: https://github.com/alexei/sprintf.js#readme
-license: bsd-3-clause
-licenses:
-- sources: LICENSE
- text: |
- Copyright (c) 2007-2014, Alexandru Marasteanu
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of this software nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- sources: README.md
- text: "**sprintf.js** is licensed under the terms of the 3-clause BSD license."
-notices: []
diff --git a/.licenses/npm/@oozcitak/util.dep.yml b/.licenses/npm/strnum.dep.yml
similarity index 89%
rename from .licenses/npm/@oozcitak/util.dep.yml
rename to .licenses/npm/strnum.dep.yml
index dcee45c0f..d560b95e7 100644
--- a/.licenses/npm/@oozcitak/util.dep.yml
+++ b/.licenses/npm/strnum.dep.yml
@@ -1,16 +1,16 @@
---
-name: "@oozcitak/util"
-version: 8.3.8
+name: strnum
+version: 2.5.1
type: npm
-summary: Utility functions
-homepage: http://github.com/oozcitak/util
+summary: Parse String to Number based on configuration
+homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
- Copyright (c) 2019 Ozgur Ozcitak
+ Copyright (c) 2021 Natural Intelligence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/.licenses/npm/tr46.dep.yml b/.licenses/npm/tr46.dep.yml
deleted file mode 100644
index 3bacc6ec4..000000000
--- a/.licenses/npm/tr46.dep.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-name: tr46
-version: 0.0.3
-type: npm
-summary: An implementation of the Unicode TR46 spec
-homepage: https://github.com/Sebmaster/tr46.js#readme
-license: mit
-licenses:
-- sources: Auto-generated MIT license text
- text: |
- MIT License
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-notices: []
diff --git a/.licenses/npm/tslib-1.14.1.dep.yml b/.licenses/npm/tslib-1.14.1.dep.yml
deleted file mode 100644
index 10b2c2ac1..000000000
--- a/.licenses/npm/tslib-1.14.1.dep.yml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-name: tslib
-version: 1.14.1
-type: npm
-summary: Runtime library for TypeScript helper functions
-homepage: https://www.typescriptlang.org/
-license: 0bsd
-licenses:
-- sources: LICENSE.txt
- text: |-
- Copyright (c) Microsoft Corporation.
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-notices:
-- sources: CopyrightNotice.txt
- text: "/*! *****************************************************************************\r\nCopyright
- (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute
- this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE
- SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD
- TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR
- CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS
- ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS
- SOFTWARE.\r\n*****************************************************************************
- */"
diff --git a/.licenses/npm/tslib-2.6.2.dep.yml b/.licenses/npm/tslib.dep.yml
similarity index 98%
rename from .licenses/npm/tslib-2.6.2.dep.yml
rename to .licenses/npm/tslib.dep.yml
index 427097a71..4611137ca 100644
--- a/.licenses/npm/tslib-2.6.2.dep.yml
+++ b/.licenses/npm/tslib.dep.yml
@@ -1,6 +1,6 @@
---
name: tslib
-version: 2.6.2
+version: 2.8.1
type: npm
summary: Runtime library for TypeScript helper functions
homepage: https://www.typescriptlang.org/
diff --git a/.licenses/npm/undici.dep.yml b/.licenses/npm/undici.dep.yml
index cc74a6d2d..459f1a92c 100644
--- a/.licenses/npm/undici.dep.yml
+++ b/.licenses/npm/undici.dep.yml
@@ -1,6 +1,6 @@
---
name: undici
-version: 5.28.4
+version: 6.29.1
type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org
diff --git a/.licenses/npm/uuid-3.4.0.dep.yml b/.licenses/npm/uuid-3.4.0.dep.yml
deleted file mode 100644
index 45970fef6..000000000
--- a/.licenses/npm/uuid-3.4.0.dep.yml
+++ /dev/null
@@ -1,39 +0,0 @@
----
-name: uuid
-version: 3.4.0
-type: npm
-summary: RFC4122 (v1, v4, and v5) UUIDs
-homepage: https://github.com/uuidjs/uuid#readme
-license: mit
-licenses:
-- sources: LICENSE.md
- text: |
- The MIT License (MIT)
-
- Copyright (c) 2010-2016 Robert Kieffer and other contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-notices:
-- sources: AUTHORS
- text: |-
- Robert Kieffer
- Christoph Tavan
- AJ ONeal
- Vincent Voyer
- Roman Shtylman
diff --git a/.licenses/npm/uuid-8.3.2.dep.yml b/.licenses/npm/uuid-8.3.2.dep.yml
deleted file mode 100644
index bf84da082..000000000
--- a/.licenses/npm/uuid-8.3.2.dep.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: uuid
-version: 8.3.2
-type: npm
-summary: RFC4122 (v1, v4, and v5) UUIDs
-homepage: https://github.com/uuidjs/uuid#readme
-license: mit
-licenses:
-- sources: LICENSE.md
- text: |
- The MIT License (MIT)
-
- Copyright (c) 2010-2020 Robert Kieffer and other contributors
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/webidl-conversions.dep.yml b/.licenses/npm/webidl-conversions.dep.yml
deleted file mode 100644
index 48c1f2272..000000000
--- a/.licenses/npm/webidl-conversions.dep.yml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-name: webidl-conversions
-version: 3.0.1
-type: npm
-summary: Implements the WebIDL algorithms for converting to and from JavaScript values
-homepage: https://github.com/jsdom/webidl-conversions#readme
-license: bsd-2-clause
-licenses:
-- sources: LICENSE.md
- text: |
- # The BSD 2-Clause License
-
- Copyright (c) 2014, Domenic Denicola
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-notices: []
diff --git a/.licenses/npm/whatwg-url.dep.yml b/.licenses/npm/whatwg-url.dep.yml
deleted file mode 100644
index bca799ccc..000000000
--- a/.licenses/npm/whatwg-url.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: whatwg-url
-version: 5.0.0
-type: npm
-summary: An implementation of the WHATWG URL Standard's URL API and parsing machinery
-homepage: https://github.com/jsdom/whatwg-url#readme
-license: mit
-licenses:
-- sources: LICENSE.txt
- text: |
- The MIT License (MIT)
-
- Copyright (c) 2015–2016 Sebastian Mayr
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/@oozcitak/infra.dep.yml b/.licenses/npm/xml-naming.dep.yml
similarity index 83%
rename from .licenses/npm/@oozcitak/infra.dep.yml
rename to .licenses/npm/xml-naming.dep.yml
index eeac49dd3..bfc32c71c 100644
--- a/.licenses/npm/@oozcitak/infra.dep.yml
+++ b/.licenses/npm/xml-naming.dep.yml
@@ -1,16 +1,17 @@
---
-name: "@oozcitak/infra"
-version: 1.0.8
+name: xml-naming
+version: 0.3.0
type: npm
-summary: An implementation of the Infra Living Standard
-homepage: http://github.com/oozcitak/infra
+summary: Validates XML name productions — Name, NCName, QName, NMToken, NMTokens —
+ for XML 1.0 and 1.1
+homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
- Copyright (c) 2019 Ozgur Ozcitak
+ Copyright (c) 2026 Natural Intelligence
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -29,4 +30,6 @@ licenses:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+- sources: README.md
+ text: MIT
notices: []
diff --git a/.licenses/npm/xml2js.dep.yml b/.licenses/npm/xml2js.dep.yml
deleted file mode 100644
index 92bce8dda..000000000
--- a/.licenses/npm/xml2js.dep.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-name: xml2js
-version: 0.5.0
-type: npm
-summary: Simple XML to JavaScript object converter.
-homepage: https://github.com/Leonidas-from-XIV/node-xml2js
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- Copyright 2010, 2011, 2012, 2013. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to
- deal in the Software without restriction, including without limitation the
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- sell copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- IN THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/xmlbuilder.dep.yml b/.licenses/npm/xmlbuilder.dep.yml
deleted file mode 100644
index e8c7ee12f..000000000
--- a/.licenses/npm/xmlbuilder.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: xmlbuilder
-version: 11.0.1
-type: npm
-summary: An XML builder for node.js
-homepage: http://github.com/oozcitak/xmlbuilder-js
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- The MIT License (MIT)
-
- Copyright (c) 2013 Ozgur Ozcitak
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-notices: []
diff --git a/.licenses/npm/xmlbuilder2.dep.yml b/.licenses/npm/xmlbuilder2.dep.yml
deleted file mode 100644
index 378714677..000000000
--- a/.licenses/npm/xmlbuilder2.dep.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: xmlbuilder2
-version: 2.4.1
-type: npm
-summary: An XML builder for node.js
-homepage: http://github.com/oozcitak/xmlbuilder2
-license: mit
-licenses:
-- sources: LICENSE
- text: |
- MIT License
-
- Copyright (c) 2019 Ozgur Ozcitak
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-notices: []
diff --git a/.licenses/npm/yallist.dep.yml b/.licenses/npm/yallist.dep.yml
deleted file mode 100644
index 1e1c46f1b..000000000
--- a/.licenses/npm/yallist.dep.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-name: yallist
-version: 4.0.0
-type: npm
-summary: Yet Another Linked List
-homepage: https://github.com/isaacs/yallist#readme
-license: isc
-licenses:
-- sources: LICENSE
- text: |
- The ISC License
-
- Copyright (c) Isaac Z. Schlueter and Contributors
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-notices: []
diff --git a/.prettierrc.js b/.prettierrc.js
deleted file mode 100644
index 468cdb1e2..000000000
--- a/.prettierrc.js
+++ /dev/null
@@ -1,11 +0,0 @@
-// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
-module.exports = {
- printWidth: 80,
- tabWidth: 2,
- useTabs: false,
- semi: true,
- singleQuote: true,
- trailingComma: 'none',
- bracketSpacing: false,
- arrowParens: 'avoid'
-};
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 000000000..b243c2ff0
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,10 @@
+{
+ "printWidth": 80,
+ "tabWidth": 2,
+ "useTabs": false,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": false,
+ "arrowParens": "avoid"
+}
diff --git a/README.md b/README.md
index aaf9cce87..ea57bc807 100644
--- a/README.md
+++ b/README.md
@@ -3,274 +3,564 @@
[](https://github.com/actions/setup-java/actions/workflows/basic-validation.yml)
[](https://github.com/actions/setup-java/actions/workflows/e2e-versions.yml)
[](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
+[](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml)
-The `setup-java` action provides the following functionality for GitHub Actions runners:
-- Downloading and setting up a requested version of Java. See [Usage](#usage) for a list of supported distributions.
-- Extracting and caching custom version of Java from a local file.
-- Configuring runner for publishing using Apache Maven.
-- Configuring runner for publishing using Gradle.
-- Configuring runner for using GPG private key.
-- Registering problem matchers for error output.
-- Caching dependencies managed by Apache Maven.
-- Caching dependencies managed by Gradle.
-- Caching dependencies managed by sbt.
-- [Maven Toolchains declaration](https://maven.apache.org/guides/mini/guide-using-toolchains.html) for specified JDK versions.
+Set up Java for GitHub Actions workflows. `setup-java` installs a requested Java distribution, adds it to `PATH`, configures `JAVA_HOME`, and can optionally cache build dependencies for Apache Maven, Gradle, and sbt; generate Maven publishing configuration, verify JDK package signatures, manage multiple JDKs, and manage Maven toolchains.
-This action allows you to work with Java and Scala projects.
-
-## V2 vs V1
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ - run: java --version
+```
-- V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK out of the box. V1 supports only Azul Zulu OpenJDK.
-- V2 requires you to specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2.
+## Contents
+
+- [What it does](#what-it-does)
+- [What's new](#whats-new)
+- [Usage](#usage)
+- [Inputs](#inputs)
+- [Supported distributions](#supported-distributions)
+- [Supported version syntax](#supported-version-syntax)
+- [Caching](#caching)
+- [Multiple JDKs and Maven toolchains](#multiple-jdks-and-maven-toolchains)
+- [Publishing packages](#publishing-packages)
+- [Advanced usage](#advanced-usage)
+
+## What it does
+
+- Downloads and installs Java from a supported distribution.
+- Uses a requested Java version, a version file, or the `latest` stable release alias.
+- Extracts and caches a custom JDK archive from a local file.
+- Configures Maven `settings.xml`, Maven Toolchains, Maven GPG signing inputs, and environment-variable based credentials for publishing workflows.
+- Registers Java problem matchers for compiler diagnostics and uncaught exceptions.
+- Caches dependencies for Maven, Gradle, and sbt.
+- Caches downloaded JDK installations between jobs.
+- Verifies downloaded archive checksums when a distribution publishes authoritative checksums.
+- Optionally verifies package signatures for supported distributions.
+
+`setup-java` works with Java, Scala, Kotlin, Gradle, Maven, and sbt projects.
+
+## What's new
+
+### V6
+
+- Migrated the action implementation to ESM to support the latest `@actions/*` packages.
+- Added Oracle OpenJDK (`oracle-openjdk`), Red Hat Build of OpenJDK (`redhat`), and Liberica Native Image Kit (`liberica-nik`), and expanded Tencent Kona support through JDK 25.
+- Added `java-version: latest` to resolve the newest stable GA release from the distribution's remote metadata.
+- Expanded install compatibility with JEP 322 multi-field versions such as `18.0.1.1`, Temurin `jdk+jmods` packages, and native musl artifacts on Alpine for Dragonwell, Corretto, Zulu, and Liberica.
+- JDK downloads now automatically verify authoritative checksums. Package signature verification is supported for Temurin and Microsoft builds, with configurable strict enforcement.
+- 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 cache keys now include `.mvn/extensions.xml` and `gradle.properties`, preventing stale restores when Maven extensions or Gradle dependency properties change.
+- Downloaded JDKs are now [cached](#caching-jdk-installations) automatically when `cache` is set; use `cache-jdk` to enable or disable it independently.
+- Warm JDK-cached jobs can reuse cached release metadata, avoiding vendor API calls while retaining a stale-metadata fallback for vendor outages and rate limits.
+- Maven configuration now supports multiple server credentials and custom dependency-resolution repositories.
+- Maven signing keys are imported into an isolated temporary GPG home instead of the runner's default keyring.
+- Java compiler and uncaught-exception annotations are now disabled by default. Set `problem-matcher: true` to enable them.
+- 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.
+- Renamed environment-variable-name inputs so they are not mistaken for secret values:
+ - `server-username` -> `server-username-env-var`
+ - `server-password` -> `server-password-env-var`
+ - `gpg-passphrase` -> `gpg-passphrase-env-var`
+- Deprecated aliases still work, but emit warnings.
+- Maven GPG passphrases are now passed through `gpg.passphraseEnvName` instead of a deprecated `gpg.passphrase` server entry in `settings.xml`. This requires `maven-gpg-plugin` 3.2.0 or newer. See [GPG](docs/advanced-usage.md#gpg).
+- Legacy AdoptOpenJDK distributions were removed. Use `temurin` instead of `adopt` or `adopt-hotspot`, and `semeru` instead of `adopt-openj9`.
+- See the [complete V6 release notes](https://github.com/actions/setup-java/releases/tag/v6.0.0) for all enhancements and fixes.
+
+### V5
+
+- Upgraded the action runtime from Node 20 to Node 24. Self-hosted runners must use version `v2.327.1` or later. See the [runner release notes](https://github.com/actions/runner/releases/tag/v2.327.1).
+- Added support for [GraalVM Community](#supported-distributions) and [Tencent Kona](#supported-distributions).
+- Expanded `java-version-file` support with `.sdkmanrc` files and automatic distribution detection from SDKMAN and asdf vendor identifiers.
+- Added optional package-signature verification for Eclipse Temurin and Microsoft Build of OpenJDK downloads.
+- Added `set-default: false` for installing a JDK without changing `JAVA_HOME` or `PATH`.
+- Improved dependency caching with separate Maven and Gradle wrapper caches, Maven extension-aware cache keys, and the `cache-primary-key` output.
+- Improved Maven and Java build behavior by preserving toolchain entries across repeated action invocations, suppressing transfer progress by default, generating non-interactive Maven settings, and matching `javac` compiler errors.
+- Renamed the `jdkFile` input to `jdk-file`; the old name remains available as a deprecated alias.
+- See the [complete V5 release history](https://github.com/actions/setup-java/releases?q=v5&expanded=true) for enhancements and fixes across all V5 releases.
+
+### Older versions
+
+> [!WARNING]
+> `actions/setup-java` versions `v1` through `v4` are deprecated. Upgrade workflows to `actions/setup-java@v6`, the latest stable release.
## Usage
- - `java-version`: The Java version that is going to be set up. Takes a whole or [semver](#supported-version-syntax) Java version. If not specified, the action will expect `java-version-file` input to be specified.
+### Install Eclipse Temurin
+
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ - run: java --version
+```
- - `java-version-file`: The path to a file containing java version. Supported file types are `.java-version` and `.tool-versions`. See more details in [about .java-version-file](docs/advanced-usage.md#Java-version-file).
+### Install Microsoft Build of OpenJDK
- - `distribution`: _(required)_ Java [distribution](#supported-distributions).
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: microsoft
+ java-version: '25'
+ - run: java --version
+```
- - `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
+### Read the version from a file
- - `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version-file: .java-version
+ - run: java --version
+```
- - `jdkFile`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM.
+Supported version files are `.java-version`, `.tool-versions`, and `.sdkmanrc`. A `.sdkmanrc` file can also provide the distribution when it contains a recognized suffix, such as `java=21.0.5-tem`.
- - `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
+### Use the newest stable Java
- - `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle" or "sbt".
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: latest
+ - run: java --version
+```
- - `cache-dependency-path`: The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used with the `cache` option. If this option is omitted, the action searches for the dependency file in the entire repository. This option supports wildcards and a list of file names for caching multiple dependencies.
+`latest` resolves the newest stable GA release from remote metadata rather than from the runner tool cache. Distributions that do not publish a release listing (such as `oracle` and `graalvm`) resolve the newest GA feature version from the Adoptium available-releases API and then request that version from their own catalog. `latest` is not supported with `java-version-file`, early-access versions, or `distribution: jdkfile`.
+
+## Inputs
+
+| Input | Description | Default |
+| --- | --- | --- |
+| `java-version` | Java version to install. Supports whole versions, semver ranges, early-access versions, and `latest`. Required unless `java-version-file` is set. | |
+| `java-version-file` | Path to `.java-version`, `.tool-versions`, or `.sdkmanrc`. Used when `java-version` is not set. | |
+| `distribution` | Java distribution keyword. Values are case-sensitive and must match one of the supported keywords below. Required unless `java-version-file` points to `.sdkmanrc` with a recognized distribution suffix. | |
+| `java-package` | Package variant such as `jdk`, `jre`, `jdk+fx`, `jre+fx`, `jdk+crac`, `jre+crac`, `jdk+jmods`, `jdk+jcef`, `jre+jcef`, `jdk+ft`, or `jre+ft`. Support varies by distribution. | `jdk` |
+| `architecture` | Package architecture. Canonical values are `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`, `ppc64`, `riscv64`, and `s390x`. Aliases `ia32`, `amd64`, `arm`, and `arm64` are normalized. | Runner architecture |
+| `jdk-file` | Local compressed JDK archive. Requires `distribution: jdkfile`. | |
+| `check-latest` | Check remote metadata for the latest version satisfying the version spec before using the runner 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__` variables are set. | `true` |
+| `problem-matcher` | Register Java compiler and uncaught exception problem matchers. | `false` |
+| `verify-signature` | Verify downloaded Java package signatures when supported. Explicitly setting this to `true` makes verification failures fatal. | Distribution-dependent; see [Download integrity and signatures](#download-integrity-and-signatures) |
+| `verify-signature-public-key` | One or more ASCII-armored GPG public keys used for signature verification. Concatenate multiple armored key blocks. Custom keys replace the bundled distribution keys. | |
+| `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-jdk` | Cache downloaded JDK installations between jobs. When omitted, JDK caching is enabled only if `cache` is set. Set explicitly to `true` or `false` to override. | Enabled when `cache` is set |
+| `cache-dependency-path` | Dependency file paths used for cache key hashing. Supports globs and multiline values. | Auto-detected by package manager |
+| `cache-path` | Cache paths to use instead of the package manager's default dependency cache path. Supports multiline values and exclusions. | |
+| `cache-read-only` | Restore dependency, wrapper, and JDK caches without saving changes in the post step. | `false` |
+| `server-id` | Maven repository ID used in generated `settings.xml`. | `github` |
+| `server-username-env-var` | Environment variable name for Maven repository username. | `GITHUB_ACTOR` |
+| `server-password-env-var` | Environment variable name for Maven repository password or token. | `GITHUB_TOKEN` |
+| `mvn-server-credentials` | Multiline Maven server credentials in the format `server-id:USERNAME_ENV:PASSWORD_ENV`. Replaces the single server configured by the three inputs above when set. | |
+| `mvn-server-repository-origins` | Multiline Maven credential origins in the format `server-id:repository-origin`. Each origin must belong to a configured server ID. Requires Maven 3.10+. | |
+| `mvn-repositories` | Multiline Maven dependency repositories in the format `repository-id:repository-url:snapshots-enabled`. | |
+| `mvn-plugin-repositories` | Multiline Maven plugin repositories in the format `repository-id:repository-url:snapshots-enabled`. Can be used independently of `mvn-repositories`. | |
+| `mvn-mirrors` | Multiline Maven mirrors in the format `mirror-id:mirror-url:mirror-of`. Redirect matching dependency and plugin repositories; use a matching server ID for authentication. | |
+| `mvn-repositories-include-central` | Include Maven Central for dependency and plugin repositories in the generated profile. When `false`, Central is disabled for both types unless that type explicitly declares `central`. Has no effect when neither repository list is configured. | `true` |
+| `mvn-repositories-prioritize-central` | Place Maven Central before custom dependency and plugin repositories. Has no effect when Central is excluded or neither repository list is configured. | `true` |
+| `settings-path` | Directory where `settings.xml` is written. | `~/.m2` |
+| `overwrite-settings` | Overwrite an existing `settings.xml`. | `true` |
+| `gpg-private-key` | GPG private key to import into an isolated temporary keyring. | |
+| `gpg-passphrase-env-var` | Environment variable name for the GPG private key passphrase. | `GPG_PASSPHRASE` when a key is set |
+| `mvn-toolchain-id` | Maven Toolchain ID. When multiple Java versions are installed, the number of IDs must match the number of versions. | `${mvn-toolchain-vendor}_${java-version}` |
+| `mvn-toolchain-vendor` | Maven Toolchain vendor value. | `${distribution}` |
+| `show-download-progress` | Keep Maven artifact download and transfer progress in logs. When `false`, the action adds `-ntp` to `MAVEN_ARGS`. | `false` |
+
+- `java-package`: Supported package types are `jdk`, `jre`, `jdk+fx`, `jre+fx`, `jdk+crac`, `jre+crac`, `jdk+jmods`, `jdk+jcef`, `jre+jcef`, `jdk+ft`, and `jre+ft`. Availability varies by distribution.
+
+Deprecated aliases `jdkFile`, `server-username`, `server-password`, and `gpg-passphrase` remain accepted for compatibility, but should be replaced with the current input names.
+
+## Outputs
+
+| Output | Description |
+| --- | --- |
+| `distribution` | Distribution that was installed. |
+| `version` | Actual Java version that was installed. |
+| `path` | Installation path, also used for `JAVA_HOME` when `set-default` is enabled. |
+| `cache-hit` | Whether an exact dependency cache match was restored. |
+| `cache-primary-key` | Primary cache key computed for the selected package manager. Empty when caching is disabled or skipped. |
+
+## Supported distributions
+
+| Keyword | Distribution | License |
+| --- | --- | --- |
+| `corretto` | [Amazon Corretto](https://aws.amazon.com/corretto/) | [License](https://aws.amazon.com/corretto/faqs/) |
+| `dragonwell` | [Alibaba Dragonwell JDK](https://dragonwell-jdk.io/) | [License](https://www.aliyun.com/product/dragonwell/) |
+| `graalvm` | [Oracle GraalVM](https://www.graalvm.org/) | [License](https://www.oracle.com/downloads/licenses/graal-free-license.html) |
+| `graalvm-community` | [GraalVM Community](https://github.com/graalvm/graalvm-ce-builds/releases) | [License](https://github.com/oracle/graal/blob/master/LICENSE) |
+| `jetbrains` | [JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime/) | [License](https://github.com/JetBrains/JetBrainsRuntime/blob/main/LICENSE) |
+| `kona` | [Tencent Kona JDK](https://tencent.github.io/konajdk/) | [License](https://tencent.github.io/konajdk/LICENSE.txt) |
+| `liberica` | [Liberica JDK](https://bell-sw.com/) | [License](https://bell-sw.com/liberica_eula/) |
+| `liberica-nik` | [Liberica Native Image Kit](https://bell-sw.com/pages/downloads/native-image-kit/) | [License](https://bell-sw.com/liberica_nik_eula/) |
+| `microsoft` | [Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk) | [License](https://docs.microsoft.com/java/openjdk/faq) |
+| `oracle` | [Oracle JDK](https://www.oracle.com/java/technologies/downloads/) | [License](https://java.com/freeuselicense) |
+| `oracle-openjdk` | [Oracle OpenJDK](https://jdk.java.net/) | [License](https://openjdk.org/legal/gplv2+ce.html) |
+| `redhat` | [Red Hat Build of OpenJDK](https://developers.redhat.com/products/openjdk/overview) | [License](https://openjdk.org/legal/gplv2+ce.html) |
+| `sapmachine` | [SAP SapMachine JDK/JRE](https://sapmachine.io/) | [License](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE) |
+| `semeru` | [IBM Semeru Runtime Open Edition](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [License](https://openjdk.java.net/legal/gplv2+ce.html) |
+| `temurin` | [Eclipse Temurin](https://adoptium.net/) | [License](https://adoptium.net/about.html) |
+| `zulu` | [Azul Zulu OpenJDK](https://www.azul.com/downloads/zulu-community/?package=jdk) | [License](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/) |
+| `jdkfile` | Custom JDK archive | |
+
+> [!NOTE]
+> Distribution availability, package variants, architectures, and version metadata differ by vendor. Check the vendor documentation when a specific version or platform matters.
+
+Additional distribution notes:
+
+- Oracle OpenJDK builds are archived after a limited number of releases and no longer receive security updates. To continue receiving security patches, use Oracle JDK or another vendor.
+- Azul Zulu maps `arm64` to `aarch64` when querying the Azul Metadata API.
+- Microsoft Build of OpenJDK uses Microsoft's live version manifest, falling back to the bundled version list when no release matches. Version `25.0.5.0.2` can also be requested as `25.0.5+0.2`.
+- GraalVM Community is available as `distribution: graalvm-community` for stable JDK 17 and later releases.
+- On Ubuntu runners, commands executed with `sudo` do not inherit the `JAVA_HOME` and `PATH` set by `setup-java` and may fall back to the system-default JDK.
+
+## Supported version syntax
+
+`java-version` accepts exact versions, version ranges, early-access versions, and `latest`.
+
+| Syntax | Examples |
+| --- | --- |
+| Major version | `8`, `11`, `17`, `21`, `25` |
+| Specific feature or patch version | `11.0`, `11.0.4`, `17.0`, `8.0.282+8` |
+| JEP 322 multi-field versions | `11.0.9.1`, `18.0.1.1`, `26.0.2.1+1` |
+| Early access | `15-ea`, `15.0.0-ea`, `27-ea` |
+| Latest stable GA release | `latest` |
+
+When `check-latest` is `false`, the action first tries the runner tool cache for the requested distribution, package type, architecture, and version range. It downloads Java only when no matching cached version is found. When `check-latest` is `true`, the action checks remote metadata first and downloads if the cached version is not current.
+
+GitHub-hosted runners primarily pre-cache Eclipse Temurin JDKs. See the installed Java versions for [Ubuntu](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java), [Windows](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#java), and [macOS](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#java). On a fresh GitHub-hosted runner, requests for other distributions usually miss the tool cache and resolve from remote metadata. For broad version ranges such as a major version (`21`, `25`), this often behaves similarly to `check-latest: true` because the action downloads the latest available release that satisfies the range.
+
+To see which exact version a request resolves to today, open the summary of the latest run of the daily [Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml) workflow. For every supported distribution, it lists the version that `setup-java` currently resolves from vendor metadata for every major from Java 6 through the newest stable GA release (including non-LTS releases), plus `latest`, on every operating system and architecture the action supports for that distribution, including Alpine Linux and Solaris. Because vendors publish builds per platform, the same request can resolve to different versions on different platforms. The report doesn't download any JDKs. Floating vendor URLs are marked when their exact version cannot be established from metadata alone. It shows what a job installs on a tool-cache miss or with `check-latest: true`.
+
+## Download integrity and signatures
+
+`setup-java` automatically verifies downloaded archive checksums when a selected distribution publishes an authoritative checksum. Automatic checksum verification currently applies to `temurin`, `semeru`, `corretto`, `dragonwell`, `kona`, `sapmachine`, `graalvm`, `graalvm-community`, `zulu`, `oracle`, `oracle-openjdk`, `microsoft`, and `jetbrains`.
+
+Distributions or individual releases without an authoritative checksum continue to install normally, with the omission reported in debug logs. Installations resolved directly from the runner tool cache — including JDKs preinstalled on the runner image and JDKs installed by an earlier step of the same job — are not downloaded again and are not reverified, even when `verify-signature: true` is set. Use `force-download: true` to always download and verify the archive.
+
+Package signature verification is supported for `temurin` and `microsoft`. When `verify-signature` is omitted, the action checks the signature and warns if GPG is unavailable or verification fails, but does not enforce the result. Explicitly setting `verify-signature: true` enforces verification and makes these failures fatal. Setting `verify-signature: true` for an unsupported distribution also fails the workflow.
+
+> [!WARNING]
+> Requesting explicit signature verification with verify-signature can fail a build after an unexpected but legitimate vendor signing-key rotation, because the action's bundled keys may not yet include the new key. Confirm a new key through the vendor's trusted documentation before using it.
+
+After confirming a legitimate rotation, configure the updated key with `verify-signature-public-key`. The input accepts one or more ASCII-armored public keys; concatenate complete armored key blocks when both old and new vendor keys are needed during a transition. Custom keys replace, rather than extend, the keys bundled with the selected distribution.
- #### Maven options
- The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
+```yaml
+- uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ verify-signature: true
+ verify-signature-public-key: |
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
+ ...vendor key material...
+ -----END PGP PUBLIC KEY BLOCK-----
+```
- - `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists, set this to `false`.
+As a temporary fallback while a legitimate rotation is being investigated, set `verify-signature: false`. This disables package signature verification, although authoritative checksum verification still applies when the vendor publishes a checksum.
- - `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
+```yaml
+- uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ verify-signature: false
+```
- - `server-username`: Environment variable name for the username for authentication to the Apache Maven repository. Default is GITHUB_ACTOR.
+## Caching
- - `server-password`: Environment variable name for password or token for authentication to the Apache Maven repository. Default is GITHUB_TOKEN.
+`setup-java` manages three kinds of caches. Each one is restored and saved as a separate cache entry.
- - `settings-path`: Maven related setting to point to the directory where the settings.xml file will be written. Default is ~/.m2.
+| Cache | What it stores | Key based on | How it is enabled |
+| --- | --- | --- | --- |
+| Dependency cache | Downloaded dependencies, such as `~/.m2/repository`, `~/.gradle/caches`, or the sbt cache paths | Runner OS, architecture, package manager, and a hash of the dependency files | Set `cache` to `maven`, `gradle`, or `sbt` |
+| Wrapper caches | Maven and Gradle wrapper distributions (`~/.m2/wrapper/dists`, `~/.gradle/wrapper`) | Runner OS, architecture, wrapper cache name, and a hash of the wrapper properties | Set `cache` to `maven` or `gradle` |
+| JDK cache | The downloaded JDK installation | Runner OS, architecture, distribution, package type, resolved version, release identity, and signature-verification identity | Enabled implicitly whenever `cache` is set, or explicitly with `cache-jdk: true`. Opt out with `cache-jdk: false` |
- - `gpg-private-key`: GPG private key to import. Default is empty string.
+Set `cache` to `maven`, `gradle`, or `sbt` to cache dependencies with minimal configuration.
- - `gpg-passphrase`: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ cache: maven
+ - run: mvn verify
+```
- - `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
+The primary dependency cache key is `setup-java----`, where `` is the runner's Node.js process architecture. The primary cache stores dependency directories such as `~/.m2/repository`, `~/.gradle/caches`, or the sbt cache paths. Its file hash is based on these files by default:
- - `mvn-toolchain-vendor`: Name of Maven Toolchain Vendor if the default name of `${distribution}` is not wanted.
+| Package manager | Files used for the primary dependency-cache key |
+| --- | --- |
+| Gradle | `**/*.gradle*`, `**/gradle.properties`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, `**/versions.properties` |
+| Maven | `**/pom.xml`, `**/.mvn/wrapper/maven-wrapper.properties`, `**/.mvn/extensions.xml` |
+| sbt | `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt` |
-### Basic Configuration
+Use `cache-dependency-path` to override the files used for key hashing, especially in monorepos:
-#### Eclipse Temurin
```yaml
-steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
+- uses: actions/setup-java@v6
with:
- distribution: 'temurin' # See 'Supported distributions' for available options
- java-version: '21'
-- run: java HelloWorldApp.java
+ distribution: temurin
+ java-version: '25'
+ cache: gradle
+ cache-dependency-path: |
+ sub-project/*.gradle*
+ sub-project/**/gradle-wrapper.properties
```
-#### Azul Zulu OpenJDK
+Use `cache-path` when the build tool stores dependencies outside the default location:
+
```yaml
-steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
+- uses: actions/setup-java@v6
with:
- distribution: 'zulu' # See 'Supported distributions' for available options
- java-version: '21'
-- run: java HelloWorldApp.java
+ distribution: temurin
+ java-version: '25'
+ cache: maven
+ cache-path: |
+ /custom/maven/repository
+ !/custom/maven/repository/**/*.lastUpdated
+- run: mvn -Dmaven.repo.local=/custom/maven/repository verify
```
-#### Supported version syntax
-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`
-- 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`
+`cache-path` changes what is restored and saved, but not the cache key. Jobs that should share a cache key must use the same OS, architecture, package manager, dependency files, and cache paths.
-#### Supported distributions
-Currently, the following distributions are supported:
-| Keyword | Distribution | Official site | License
-|-|-|-|-|
-| `temurin` | Eclipse Temurin | [Link](https://adoptium.net/) | [Link](https://adoptium.net/about.html)
-| `zulu` | Azul Zulu OpenJDK | [Link](https://www.azul.com/downloads/zulu-community/?package=jdk) | [Link](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/) |
-| `adopt` or `adopt-hotspot` | AdoptOpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
-| `adopt-openj9` | AdoptOpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
-| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
-| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
-| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
-| `semeru` | IBM Semeru Runtime Open Edition | [Link](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [Link](https://openjdk.java.net/legal/gplv2+ce.html) |
-| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
-| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
-| `sapmachine` | SAP SapMachine JDK/JRE | [Link](https://sapmachine.io/) | [Link](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE)
-| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html)
+### Wrapper caches
-**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
+Maven and Gradle wrapper distributions are restored and saved as additional cache entries, separate from the primary dependency cache. These entries have their own keys in the form `setup-java----`.
-**NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` and `adopt-openj9`, to `temurin` and `semeru` respectively, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
+| Package manager | Wrapper cache name | Cached path | Files used for wrapper-cache key |
+| --- | --- | --- | --- |
+| Maven | `maven-wrapper` | `~/.m2/wrapper/dists` | `**/.mvn/wrapper/maven-wrapper.properties` |
+| Gradle | `gradle-wrapper` | `~/.gradle/wrapper` | `**/gradle-wrapper.properties` |
-**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
+These wrapper caches are independent from dependency caches, so they remain useful even when dependency files change frequently. The wrapper properties are also part of the Maven and Gradle primary dependency-cache key because wrapper changes can affect how dependencies are resolved, but the wrapper distribution files themselves are stored in the separate wrapper cache entries above.
-### Caching packages dependencies
-The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
+For advanced Gradle caching features such as build output caching, configuration cache support, encrypted cache storage, cleanup, and fine-grained cache control, consider [`gradle/actions/setup-gradle`](https://github.com/gradle/actions/tree/main/setup-gradle).
-- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
-- maven: `**/pom.xml`
-- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt`
+### Caching JDK installations
-When the option `cache-dependency-path` is specified, the hash is based on the matching file. This option supports wildcards and a list of file names, and is especially useful for monorepos.
+The JDK cache stores the downloaded JDK installation so later runs skip the download. It is enabled implicitly whenever dependency `cache` is set, so most workflows that cache dependencies are already caching the JDK. Set `cache-jdk: true` to enable it without dependency caching, or `cache-jdk: false` to opt out while keeping dependency caching. With neither `cache` nor `cache-jdk` set, nothing is cached.
-The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
+> [!IMPORTANT]
+> Because JDK caching is on by default whenever `cache` is set, review [Caching JDK installations](docs/advanced-usage.md#caching-jdk-installations)
+> for the full `cache`/`cache-jdk` matrix, cache identity and storage impact.
-The cache input is optional, and caching is turned off by default.
+### Read-only caches
-#### Caching gradle dependencies
-```yaml
-steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
- with:
- distribution: 'temurin'
- java-version: '21'
- cache: 'gradle'
- cache-dependency-path: | # optional
- sub-project/*.gradle*
- sub-project/**/gradle-wrapper.properties
-- run: ./gradlew build --no-daemon
-```
+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.
-#### Caching maven dependencies
```yaml
-steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
+- uses: actions/setup-java@v6
with:
- distribution: 'temurin'
- java-version: '21'
- cache: 'maven'
- cache-dependency-path: 'sub-project/pom.xml' # optional
-- name: Build with Maven
- run: mvn -B package --file pom.xml
+ distribution: temurin
+ java-version: '25'
+ cache: maven
+ cache-read-only: ${{ github.ref != 'refs/heads/main' }}
```
-#### Caching sbt dependencies
+For matrix fan-out, seed the cache once and make matrix jobs read-only consumers:
+
```yaml
-steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
- with:
- distribution: 'temurin'
- java-version: '21'
- cache: 'sbt'
- cache-dependency-path: | # optional
- sub-project/build.sbt
- sub-project/project/build.properties
-- name: Build with SBT
- run: sbt package
+jobs:
+ seed-cache:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ cache: maven
+ - run: mvn dependency:go-offline dependency:resolve-plugins
+
+ build:
+ needs: seed-cache
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ goal: [test, verify, package]
+ steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ cache: maven
+ cache-read-only: true
+ - run: mvn ${{ matrix.goal }}
```
-#### Cache segment restore timeout
-Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a segment download gets stuck, which causes the workflow job to be stuck. The cache segment download timeout [was introduced](https://github.com/actions/toolkit/tree/main/packages/cache#cache-segment-restore-timeout) to solve this issue as it allows the segment download to get aborted and hence allows the job to proceed with a cache miss. The default value of the cache segment download timeout is set to 10 minutes and can be customized by specifying an environment variable named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with a timeout value in minutes.
+### Cache segment restore timeout
+
+Cache downloads are split into segments. To reduce the chance of a stuck segment blocking a workflow, set `SEGMENT_DOWNLOAD_TIMEOUT_MINS`:
```yaml
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
- with:
- distribution: 'temurin'
- java-version: '21'
- cache: 'gradle'
-- run: ./gradlew build --no-daemon
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ cache: gradle
+ - run: ./gradlew build --no-daemon
```
-### Check latest
-
-In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download.
-
-If `check-latest` is set to `true`, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the latest version of Java will be downloaded. Set `check-latest` to `true` if you want the most up-to-date version of Java to always be used. Setting `check-latest` to `true` has performance implications as downloading versions of Java is slower than using cached versions.
-
-For Java distributions that are not cached on Hosted images, `check-latest` always behaves as `true` and downloads Java on-flight. Check out [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache) for more details about pre-cached Java versions.
+## Multiple JDKs and Maven toolchains
+Install multiple Java versions by providing a multiline `java-version` value. All configured JDKs are installed. The last one added to `PATH` becomes the default.
```yaml
steps:
-- uses: actions/checkout@v4
-- uses: actions/setup-java@v4
- with:
- distribution: 'temurin'
- java-version: '21'
- check-latest: true
-- run: java HelloWorldApp.java
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: |
+ 8
+ 11
+ 17
+ 21
+ 25
```
-### Testing against different Java versions
+Other installed JDKs are available through version-specific variables such as `JAVA_HOME_17_X64`. To use a specific version later in the job, set `JAVA_HOME` and prepend its `bin` directory to `PATH`.
+
+`setup-java` writes a Maven Toolchains declaration for each installed JDK. When multiple JDKs are installed, the declaration contains all of them. Customize the generated toolchain values with `mvn-toolchain-id` and `mvn-toolchain-vendor`.
+
+## Testing with a Java matrix
+
```yaml
jobs:
build:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-latest
strategy:
matrix:
- java: [ '8', '11', '17', '21' ]
- name: Java ${{ matrix.Java }} sample
+ java: ['8', '11', '17', '21', '25']
+ name: Java ${{ matrix.java }}
steps:
- - uses: actions/checkout@v4
- - name: Setup java
- uses: actions/setup-java@v4
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
with:
- distribution: ''
+ distribution: temurin
java-version: ${{ matrix.java }}
- - run: java HelloWorldApp.java
+ - run: java --version
+ - run: mvn verify
```
-### Install multiple JDKs
+## Publishing packages
+
+`setup-java` generates Maven `settings.xml` and Maven Toolchains configuration. For Gradle publishing, it installs Java for the workflow; the Gradle build file remains responsible for reading credentials from environment variables.
-All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'.
+### Maven
```yaml
- steps:
- - uses: actions/setup-java@v4
- with:
- distribution: ''
- java-version: |
- 8
- 11
- 15
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ server-id: github
+ server-username-env-var: GITHUB_ACTOR
+ server-password-env-var: GITHUB_TOKEN
+ - run: mvn --batch-mode deploy
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
-### Using Maven Toolchains
-In the example above multiple JDKs are installed for the same job. The result after the last JDK is installed is a Maven Toolchains declaration containing references to all three JDKs. The values for `id`, `version`, and `vendor` of the individual Toolchain entries are the given input values for `distribution` and `java-version` (`vendor` being the combination of `${distribution}_${java-version}`) by default.
-
-### Advanced Configuration
-
-- [Selecting a Java distribution](docs/advanced-usage.md#Selecting-a-Java-distribution)
- - [Eclipse Temurin](docs/advanced-usage.md#Eclipse-Temurin)
- - [Adopt](docs/advanced-usage.md#Adopt)
- - [Zulu](docs/advanced-usage.md#Zulu)
- - [Liberica](docs/advanced-usage.md#Liberica)
- - [Microsoft](docs/advanced-usage.md#Microsoft)
- - [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
- - [Oracle](docs/advanced-usage.md#Oracle)
- - [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
- - [SapMachine](docs/advanced-usage.md#SapMachine)
- - [GraalVM](docs/advanced-usage.md#GraalVM)
-- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
-- [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture)
-- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
-- [Testing against different Java distributions](docs/advanced-usage.md#Testing-against-different-Java-distributions)
-- [Testing against different platforms](docs/advanced-usage.md#Testing-against-different-platforms)
-- [Publishing using Apache Maven](docs/advanced-usage.md#Publishing-using-Apache-Maven)
-- [Publishing using Gradle](docs/advanced-usage.md#Publishing-using-Gradle)
-- [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache)
-- [Modifying Maven Toolchains](docs/advanced-usage.md#Modifying-Maven-Toolchains)
-- [Java Version File](docs/advanced-usage.md#Java-version-file)
+For dependencies hosted outside Maven Central, use `mvn-repositories`; for build
+plugins, use `mvn-plugin-repositories`. Either input adds its own repository type
+to the same active profile in the generated `settings.xml`. Repository IDs can
+match `mvn-server-credentials` IDs when authentication is required.
+See [Resolving Maven dependencies from custom repositories](docs/advanced-usage.md#resolving-maven-dependencies-from-custom-repositories)
+and [Resolving Maven plugins from custom repositories](docs/advanced-usage.md#resolving-maven-plugins-from-custom-repositories).
+
+To redirect repositories, including Central and repositories declared in project
+or parent POMs, use [`mvn-mirrors`](docs/advanced-usage.md#redirecting-maven-repositories-with-mirrors).
+It works independently of the repository inputs; a `mirrorOf` pattern of `*`
+routes all dependency and plugin repositories through the configured mirror.
+
+> [!WARNING]
+> `mvn-repositories-include-central: false` now disables inherited Maven Central
+> for **both dependencies and plugins**, even in existing workflows that only
+> configure `mvn-repositories`. Builds relying on uncached plugins from Central
+> must configure `mvn-plugin-repositories` with an accessible plugin repository
+> or explicitly declare `central` there. Neither repository list configured
+> means the Central controls remain inactive.
+
+### GPG signing
+
+```yaml
+steps:
+ - uses: actions/checkout@v7
+ - uses: actions/setup-java@v6
+ with:
+ distribution: temurin
+ java-version: '25'
+ gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
+ gpg-passphrase-env-var: GPG_PASSPHRASE
+ - run: mvn --batch-mode deploy
+ env:
+ GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
+```
+
+Maven GPG signing requires `maven-gpg-plugin` 3.2.0 or newer because `setup-java` passes the passphrase through `gpg.passphraseEnvName`.
+
+## Recommended permissions
+
+When using the `setup-java` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
+
+```yaml
+permissions:
+ contents: read # access to check out code and install dependencies
+```
+
+Publishing workflows may require additional permissions depending on the target registry.
+
+## Advanced usage
+
+See [advanced usage](docs/advanced-usage.md) for detailed examples:
+
+- [Selecting a Java distribution](docs/advanced-usage.md#selecting-a-java-distribution)
+- [Installing custom Java package types](docs/advanced-usage.md#installing-custom-java-package-type)
+- [Package compatibility](docs/advanced-usage.md#package-compatibility)
+- [Ensuring the Maven cache is complete](docs/advanced-usage.md#ensuring-the-maven-cache-is-complete-plugin-dependencies)
+- [Caching JDK installations](docs/advanced-usage.md#caching-jdk-installations)
+- [Platform and architecture compatibility](docs/advanced-usage.md#platform-and-architecture-compatibility)
+- [Installing custom Java architecture](docs/advanced-usage.md#installing-custom-java-architecture)
+- [Installing a JDK without setting it as default](docs/advanced-usage.md#installing-jdk-without-setting-as-default)
+- [Installing Java from a local file](docs/advanced-usage.md#installing-java-from-local-file)
+- [Testing against different Java distributions](docs/advanced-usage.md#testing-against-different-java-distributions)
+- [Testing against different platforms](docs/advanced-usage.md#testing-against-different-platforms)
+- [Publishing using Apache Maven](docs/advanced-usage.md#publishing-using-apache-maven)
+- [Apache Maven with a settings path](docs/advanced-usage.md#apache-maven-with-a-settings-path)
+- [Maven transfer progress](docs/advanced-usage.md#maven-transfer-progress-download-logs)
+- [Java problem matcher](docs/advanced-usage.md#java-problem-matcher-compiler-annotations)
+- [Publishing using Gradle](docs/advanced-usage.md#publishing-using-gradle)
+- [Hosted tool cache](docs/advanced-usage.md#hosted-tool-cache)
+- [Modifying Maven Toolchains](docs/advanced-usage.md#modifying-maven-toolchains)
+- [Java version files](docs/advanced-usage.md#java-version-file)
+- [Self-signed certificates and internal CAs on GitHub Enterprise](docs/advanced-usage.md#self-signed-certificates-and-internal-cas-github-enterprise)
## License
@@ -278,4 +568,8 @@ The scripts and documentation in this project are released under the [MIT Licens
## Contributions
-Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
+Contributions are welcome. See our [Contributor's Guide](docs/CONTRIBUTING.md).
+
+## Code of Conduct
+
+:wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md)
diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts
index 06591da7a..5fa5e9b85 100644
--- a/__tests__/auth.test.ts
+++ b/__tests__/auth.test.ts
@@ -1,27 +1,138 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import {fileURLToPath} from 'url';
import * as io from '@actions/io';
-import * as core from '@actions/core';
import * as fs from 'fs';
import * as path from 'path';
import os from 'os';
+import {XMLParser} from 'fast-xml-parser';
-import * as auth from '../src/auth';
-import {M2_DIR, MVN_SETTINGS_FILE} from '../src/constants';
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(() => []),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+jest.unstable_mockModule('../src/gpg.js', () => ({
+ importKey: jest.fn(),
+ removeGpgHome: jest.fn(),
+ toGpgPath: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const gpg = await import('../src/gpg.js');
+const auth = await import('../src/auth.js');
+const {M2_DIR, MVN_SETTINGS_FILE, STATE_GPG_HOME} =
+ await import('../src/constants.js');
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
const m2Dir = path.join(__dirname, M2_DIR);
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
+const credentials = (id: string, username: string, password: string) => [
+ {id, usernameEnvVar: username, passwordEnvVar: password}
+];
+const repositorySettings = (
+ repositories: auth.MavenRepository[],
+ includeCentral = true,
+ prioritizeCentral = true,
+ pluginRepositories: auth.MavenRepository[] = []
+): auth.MavenRepositorySettings => ({
+ repositories,
+ pluginRepositories,
+ includeCentral,
+ prioritizeCentral
+});
+const repositoryInputs = ['mvn-repositories', 'mvn-plugin-repositories'];
+const privateRepository = {
+ id: 'private',
+ url: 'https://repo.example.com/maven',
+ snapshotsEnabled: true
+};
+const privateRepositoryXml = {
+ id: privateRepository.id,
+ url: privateRepository.url,
+ snapshots: {enabled: 'true'}
+};
+const centralRepositoryXml = {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ snapshots: {enabled: 'false'}
+};
+const disabledCentralRepositoryXml = {
+ ...centralRepositoryXml,
+ releases: {enabled: 'false'}
+};
+const repositoryConfigurations = [
+ {
+ name: 'dependency-only',
+ repositories: [privateRepository],
+ pluginRepositories: []
+ },
+ {
+ name: 'plugin-only',
+ repositories: [],
+ pluginRepositories: [privateRepository]
+ },
+ {
+ name: 'combined',
+ repositories: [privateRepository],
+ pluginRepositories: [privateRepository]
+ }
+];
describe('auth tests', () => {
- let spyOSHomedir: jest.SpyInstance;
- let spyInfo: jest.SpyInstance;
+ let spyOSHomedir: any;
+ let spyInfo: any;
beforeEach(async () => {
await io.rmRF(m2Dir);
spyOSHomedir = jest.spyOn(os, 'homedir');
spyOSHomedir.mockReturnValue(__dirname);
- spyInfo = jest.spyOn(core, 'info');
+ spyInfo = core.info as jest.Mock;
spyInfo.mockImplementation(() => null);
+ (gpg.toGpgPath as jest.Mock).mockImplementation((p: string) => p);
}, 300000);
+ afterEach(() => {
+ (core.getInput as jest.Mock).mockReset();
+ (core.getMultilineInput as jest.Mock).mockReset();
+ (core.getMultilineInput as jest.Mock).mockReturnValue([]);
+ (core.warning as jest.Mock).mockReset();
+ (core.exportVariable as jest.Mock).mockReset();
+ (gpg.importKey as jest.Mock).mockReset();
+ (gpg.removeGpgHome as jest.Mock).mockReset();
+ (gpg.toGpgPath as jest.Mock).mockReset();
+ });
+
afterAll(async () => {
try {
await io.rmRF(m2Dir);
@@ -43,9 +154,7 @@ describe('auth tests', () => {
await io.rmRF(altHome); // ensure it doesn't already exist
await auth.createAuthenticationSettings(
- id,
- username,
- password,
+ credentials(id, username, password),
altHome,
true
);
@@ -56,7 +165,7 @@ describe('auth tests', () => {
expect(fs.existsSync(altHome)).toBe(true);
expect(fs.existsSync(altSettingsFile)).toBe(true);
expect(fs.readFileSync(altSettingsFile, 'utf-8')).toEqual(
- auth.generate(id, username, password)
+ auth.generate(credentials(id, username, password))
);
await io.rmRF(altHome);
@@ -68,9 +177,7 @@ describe('auth tests', () => {
const password = 'TOKEN';
await auth.createAuthenticationSettings(
- id,
- username,
- password,
+ credentials(id, username, password),
m2Dir,
true
);
@@ -78,7 +185,7 @@ describe('auth tests', () => {
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(settingsFile)).toBe(true);
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
- auth.generate(id, username, password)
+ auth.generate(credentials(id, username, password))
);
}, 100000);
@@ -89,9 +196,7 @@ describe('auth tests', () => {
const gpgPassphrase = 'GPG';
await auth.createAuthenticationSettings(
- id,
- username,
- password,
+ credentials(id, username, password),
m2Dir,
true,
gpgPassphrase
@@ -100,10 +205,56 @@ describe('auth tests', () => {
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(settingsFile)).toBe(true);
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
- auth.generate(id, username, password, gpgPassphrase)
+ auth.generate(credentials(id, username, password), gpgPassphrase)
);
}, 100000);
+ it('exports a GPG-compatible path and persists the native GPG home', async () => {
+ const gpgHome = 'D:\\a\\_temp\\setup-java-gpg-1';
+ const exportedGpgHome = '/d/a/_temp/setup-java-gpg-1';
+ (gpg.importKey as jest.Mock).mockResolvedValue(gpgHome);
+ (gpg.toGpgPath as jest.Mock).mockReturnValue(exportedGpgHome);
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ const inputs: Record = {
+ 'server-id': 'packages',
+ 'server-username-env-var': 'USERNAME',
+ 'server-password-env-var': 'PASSWORD',
+ 'settings-path': m2Dir,
+ 'gpg-private-key': 'KEY ONE\nKEY TWO'
+ };
+ return inputs[name] ?? '';
+ });
+
+ await auth.configureAuthentication();
+
+ expect(gpg.importKey).toHaveBeenCalledWith('KEY ONE\nKEY TWO');
+ expect(core.saveState).toHaveBeenCalledWith(STATE_GPG_HOME, gpgHome);
+ expect(gpg.toGpgPath).toHaveBeenCalledWith(gpgHome);
+ expect(core.exportVariable).toHaveBeenCalledWith(
+ 'GNUPGHOME',
+ exportedGpgHome
+ );
+ });
+
+ it('removes the isolated GPG home when environment export fails', async () => {
+ const gpgHome = path.join(__dirname, 'runner', 'temp', 'setup-java-gpg-2');
+ (gpg.importKey as jest.Mock).mockResolvedValue(gpgHome);
+ (core.exportVariable as jest.Mock).mockImplementation(() => {
+ throw new Error('environment file unavailable');
+ });
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ if (name === 'gpg-private-key') return 'KEY CONTENTS';
+ if (name === 'settings-path') return m2Dir;
+ return '';
+ });
+
+ await expect(auth.configureAuthentication()).rejects.toThrow(
+ 'environment file unavailable'
+ );
+
+ expect(gpg.removeGpgHome).toHaveBeenCalledWith(gpgHome);
+ });
+
it('overwrites existing settings.xml files', async () => {
const id = 'packages';
const username = 'USERNAME';
@@ -115,9 +266,7 @@ describe('auth tests', () => {
expect(fs.existsSync(settingsFile)).toBe(true);
await auth.createAuthenticationSettings(
- id,
- username,
- password,
+ credentials(id, username, password),
m2Dir,
true
);
@@ -125,7 +274,7 @@ describe('auth tests', () => {
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(settingsFile)).toBe(true);
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
- auth.generate(id, username, password)
+ auth.generate(credentials(id, username, password))
);
}, 100000);
@@ -140,9 +289,7 @@ describe('auth tests', () => {
expect(fs.existsSync(settingsFile)).toBe(true);
await auth.createAuthenticationSettings(
- id,
- username,
- password,
+ credentials(id, username, password),
m2Dir,
false
);
@@ -160,6 +307,7 @@ describe('auth tests', () => {
const expectedSettings = `
+ false
${id}
@@ -169,7 +317,9 @@ describe('auth tests', () => {
`;
- expect(auth.generate(id, username, password)).toEqual(expectedSettings);
+ expect(auth.generate(credentials(id, username, password))).toEqual(
+ expectedSettings
+ );
});
it('generates valid settings.xml with additional configuration', () => {
@@ -181,21 +331,1279 @@ describe('auth tests', () => {
const expectedSettings = `
+ false
${id}
\${env.${username}}
\${env.&<>"''"><&}
+
+
+
+ setup-java-gpg
+
+ ${gpgPassphrase}
+
+
+
+
+ setup-java-gpg
+
+`;
+
+ expect(
+ auth.generate(credentials(id, username, password), gpgPassphrase)
+ ).toEqual(expectedSettings);
+ });
+
+ it('generates repository origins for a Maven server', () => {
+ const settings = auth.generate([
+ {
+ id: 'central',
+ usernameEnvVar: 'CENTRAL_USER',
+ passwordEnvVar: 'CENTRAL_PASS',
+ repositoryOrigins: ['https://central.sonatype.com']
+ }
+ ]);
+
+ expect(settings).toContain(`
+ https://central.sonatype.com
+ `);
+ });
+
+ it('does not add a gpg profile when the passphrase env var is the maven-gpg-plugin default', () => {
+ const id = 'packages';
+ const username = 'USER';
+ const password = '&<>"\'\'"><&';
+ const gpgPassphrase = 'MAVEN_GPG_PASSPHRASE';
+
+ const expectedSettings = `
+ false
+
- gpg.passphrase
- \${env.${gpgPassphrase}}
+ ${id}
+ \${env.${username}}
+ \${env.&<>"''"><&}
`;
- expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(
- expectedSettings
+ expect(
+ auth.generate(credentials(id, username, password), gpgPassphrase)
+ ).toEqual(expectedSettings);
+ });
+
+ it('escapes settings.xml values while preserving parsed semantics', () => {
+ const id = `packages&<>"'é`;
+ const username = `USER&<>"'é`;
+ const password = `TOKEN&<>"'é`;
+ const gpgPassphrase = `GPG&<>"'é`;
+
+ const xml = auth.generate(
+ credentials(id, username, password),
+ gpgPassphrase
);
+ const parsed = parseXmlObject(xml) as any;
+
+ expect(parsed.settings.interactiveMode).toBe('false');
+ expect(xmlElementText(xml, 'id')).toBe(id);
+ expect(xmlElementText(xml, 'username')).toBe(`\${env.${username}}`);
+ expect(xmlElementText(xml, 'password')).toBe(`\${env.${password}}`);
+ expect(xmlElementText(xml, 'gpg.passphraseEnvName')).toBe(gpgPassphrase);
+ expect(parsed.settings.activeProfiles.activeProfile).toBe('setup-java-gpg');
+ });
+
+ it('generates ordered settings.xml entries for multiple servers', () => {
+ const servers = [
+ {
+ id: 'releases',
+ usernameEnvVar: 'RELEASES_USERNAME',
+ passwordEnvVar: 'RELEASES_PASSWORD'
+ },
+ {
+ id: 'snapshots',
+ usernameEnvVar: 'SNAPSHOTS_USERNAME',
+ passwordEnvVar: 'SNAPSHOTS_PASSWORD'
+ }
+ ];
+
+ const parsed = parseXmlObject(auth.generate(servers)) as any;
+
+ expect(parsed.settings.servers.server).toEqual([
+ {
+ id: 'releases',
+ username: '${env.RELEASES_USERNAME}',
+ password: '${env.RELEASES_PASSWORD}'
+ },
+ {
+ id: 'snapshots',
+ username: '${env.SNAPSHOTS_USERNAME}',
+ password: '${env.SNAPSHOTS_PASSWORD}'
+ }
+ ]);
+ });
+
+ it('generates an active profile with Central before custom repositories by default', () => {
+ const parsed = parseXmlObject(
+ auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings([
+ {
+ id: 'private',
+ url: 'https://repo.example.com/maven',
+ snapshotsEnabled: true
+ }
+ ])
+ )
+ ) as any;
+
+ expect(parsed.settings.profiles.profile).toEqual({
+ id: 'setup-java-repositories',
+ repositories: {
+ repository: [
+ {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'private',
+ url: 'https://repo.example.com/maven',
+ snapshots: {enabled: 'true'}
+ }
+ ]
+ }
+ });
+ expect(parsed.settings.activeProfiles.activeProfile).toBe(
+ 'setup-java-repositories'
+ );
+ });
+
+ it('places custom repositories before Central when configured', () => {
+ const parsed = parseXmlObject(
+ auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings(
+ [
+ {
+ id: 'first',
+ url: 'https://first.example.com',
+ snapshotsEnabled: false
+ },
+ {
+ id: 'second',
+ url: 'https://second.example.com',
+ snapshotsEnabled: true
+ }
+ ],
+ true,
+ false
+ )
+ )
+ ) as any;
+
+ expect(
+ parsed.settings.profiles.profile.repositories.repository.map(
+ (repository: {id: string}) => repository.id
+ )
+ ).toEqual(['first', 'second', 'central']);
+ });
+
+ it.each([
+ {
+ name: 'Central first by default',
+ prioritizeCentral: undefined,
+ expectedRepositories: [
+ {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'first',
+ url: 'https://first.example.com/plugins',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'second',
+ url: 'https://second.example.com/plugins',
+ snapshots: {enabled: 'true'}
+ }
+ ]
+ },
+ {
+ name: 'custom plugins before Central',
+ prioritizeCentral: false,
+ expectedRepositories: [
+ {
+ id: 'first',
+ url: 'https://first.example.com/plugins',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'second',
+ url: 'https://second.example.com/plugins',
+ snapshots: {enabled: 'true'}
+ },
+ {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ snapshots: {enabled: 'false'}
+ }
+ ]
+ }
+ ])(
+ 'generates plugin-only settings with $name',
+ ({prioritizeCentral, expectedRepositories}) => {
+ const xml = auth.generate(
+ [],
+ undefined,
+ repositorySettings([], true, prioritizeCentral, [
+ {
+ id: 'first',
+ url: 'https://first.example.com/plugins',
+ snapshotsEnabled: false
+ },
+ {
+ id: 'second',
+ url: 'https://second.example.com/plugins',
+ snapshotsEnabled: true
+ }
+ ])
+ );
+
+ expect(parseXmlObject(xml)).toEqual(
+ expect.objectContaining({
+ settings: expect.objectContaining({
+ profiles: {
+ profile: {
+ id: 'setup-java-repositories',
+ pluginRepositories: {
+ pluginRepository: expectedRepositories
+ }
+ }
+ },
+ activeProfiles: {activeProfile: 'setup-java-repositories'}
+ })
+ })
+ );
+ }
+ );
+
+ it('excludes Central from the generated repository profile when configured', () => {
+ const parsed = parseXmlObject(
+ auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings(
+ [
+ {
+ id: 'private',
+ url: 'https://repo.example.com',
+ snapshotsEnabled: false
+ }
+ ],
+ false
+ )
+ )
+ ) as any;
+
+ expect(parsed.settings.profiles.profile.repositories.repository).toEqual([
+ {
+ id: 'private',
+ url: 'https://repo.example.com',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ releases: {enabled: 'false'},
+ snapshots: {enabled: 'false'}
+ }
+ ]);
+ expect(
+ parsed.settings.profiles.profile.pluginRepositories.pluginRepository
+ ).toEqual(disabledCentralRepositoryXml);
+ });
+
+ it('combines repository and GPG configuration in shared profile blocks', () => {
+ const parsed = parseXmlObject(
+ auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ 'GPG_PASSPHRASE',
+ repositorySettings(
+ [
+ {
+ id: 'private',
+ url: 'https://repo.example.com',
+ snapshotsEnabled: false
+ }
+ ],
+ false
+ )
+ )
+ ) as any;
+
+ expect(parsed.settings.profiles.profile).toEqual([
+ {
+ id: 'setup-java-repositories',
+ repositories: {
+ repository: [
+ {
+ id: 'private',
+ url: 'https://repo.example.com',
+ snapshots: {enabled: 'false'}
+ },
+ {
+ id: 'central',
+ url: 'https://repo.maven.apache.org/maven2',
+ releases: {enabled: 'false'},
+ snapshots: {enabled: 'false'}
+ }
+ ]
+ },
+ pluginRepositories: {
+ pluginRepository: disabledCentralRepositoryXml
+ }
+ },
+ {
+ id: 'setup-java-gpg',
+ properties: {['gpg.passphraseEnvName']: 'GPG_PASSPHRASE'}
+ }
+ ]);
+ expect(parsed.settings.activeProfiles.activeProfile).toEqual([
+ 'setup-java-repositories',
+ 'setup-java-gpg'
+ ]);
+ });
+
+ it.each(
+ repositoryConfigurations.flatMap(configuration =>
+ [
+ {includeCentral: true, prioritizeCentral: true},
+ {includeCentral: true, prioritizeCentral: false},
+ {includeCentral: false, prioritizeCentral: true},
+ {includeCentral: false, prioritizeCentral: false}
+ ].map(controls => ({...configuration, ...controls}))
+ )
+ )(
+ 'generates $name repositories with includeCentral=$includeCentral and prioritizeCentral=$prioritizeCentral',
+ ({repositories, pluginRepositories, includeCentral, prioritizeCentral}) => {
+ const xml = auth.generate(
+ credentials('private', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings(
+ repositories,
+ includeCentral,
+ prioritizeCentral,
+ pluginRepositories
+ )
+ );
+ const expectedEntries = (configured: boolean) => {
+ const entries = includeCentral
+ ? configured
+ ? prioritizeCentral
+ ? [centralRepositoryXml, privateRepositoryXml]
+ : [privateRepositoryXml, centralRepositoryXml]
+ : []
+ : configured
+ ? [privateRepositoryXml, disabledCentralRepositoryXml]
+ : [disabledCentralRepositoryXml];
+ return entries.length === 1 ? entries[0] : entries;
+ };
+ const includeRepositories = repositories.length > 0 || !includeCentral;
+ const includePluginRepositories =
+ pluginRepositories.length > 0 || !includeCentral;
+
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {
+ profiles: {
+ profile: {
+ id: 'setup-java-repositories',
+ ...(includeRepositories
+ ? {
+ repositories: {
+ repository: expectedEntries(repositories.length > 0)
+ }
+ }
+ : {}),
+ ...(includePluginRepositories
+ ? {
+ pluginRepositories: {
+ pluginRepository: expectedEntries(
+ pluginRepositories.length > 0
+ )
+ }
+ }
+ : {})
+ }
+ },
+ activeProfiles: {activeProfile: 'setup-java-repositories'}
+ }
+ });
+ if (!includeRepositories) {
+ expect(xml).not.toContain('');
+ }
+ if (!includePluginRepositories) {
+ expect(xml).not.toContain('');
+ }
+ }
+ );
+
+ it.each(repositoryConfigurations)(
+ 'handles explicit Central independently for $name repositories',
+ ({repositories, pluginRepositories}) => {
+ const central = {
+ id: 'central',
+ url: 'https://mirror.example.com/maven',
+ snapshotsEnabled: true
+ };
+ const explicitCentralXml = {
+ id: central.id,
+ url: central.url,
+ snapshots: {enabled: 'true'}
+ };
+ const xml = auth.generate(
+ [],
+ undefined,
+ repositorySettings(
+ repositories.length ? [central] : [],
+ false,
+ true,
+ pluginRepositories.length ? [central] : []
+ )
+ );
+
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {
+ profiles: {
+ profile: {
+ repositories: {
+ repository: repositories.length
+ ? explicitCentralXml
+ : disabledCentralRepositoryXml
+ },
+ pluginRepositories: {
+ pluginRepository: pluginRepositories.length
+ ? explicitCentralXml
+ : disabledCentralRepositoryXml
+ }
+ }
+ }
+ }
+ });
+ expect(xml.match(/central<\/id>/g)).toHaveLength(2);
+ }
+ );
+
+ it('escapes plugin repository values while preserving parsed semantics', () => {
+ const repository = {
+ id: `private&<>"'é`,
+ url: `https://repo.example.com:8443/a?x=1&y="'é`,
+ snapshotsEnabled: false
+ };
+ const xml = auth.generate(
+ credentials(repository.id, 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings([], true, true, [repository])
+ );
+
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {
+ servers: {server: {id: repository.id}},
+ profiles: {
+ profile: {
+ pluginRepositories: {
+ pluginRepository: [
+ centralRepositoryXml,
+ {
+ id: repository.id,
+ url: repository.url,
+ snapshots: {enabled: 'false'}
+ }
+ ]
+ }
+ }
+ }
+ }
+ });
+ expect(xml).toContain('private&<>');
+ expect(xml).toContain('x=1&y=<value>');
+ expect(xml).not.toContain('');
+ });
+
+ it('escapes repository values while preserving parsed semantics', () => {
+ const repository = {
+ id: `private&<>"'é`,
+ url: `https://repo.example.com/a?x=1&y="'é`,
+ snapshotsEnabled: true
+ };
+ const xml = auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings([repository], false)
+ );
+ const parsed = parseXmlObject(xml) as any;
+
+ expect(
+ parsed.settings.profiles.profile.repositories.repository.find(
+ (entry: {id: string}) => entry.id === repository.id
+ )
+ ).toEqual({
+ id: repository.id,
+ url: repository.url,
+ snapshots: {enabled: 'true'}
+ });
+ });
+
+ it('parses and trims multiline Maven server credentials', () => {
+ expect(
+ auth.parseMavenServerCredentials([
+ '',
+ ' releases : RELEASES_USERNAME : RELEASES_PASSWORD ',
+ 'snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD'
+ ])
+ ).toEqual([
+ {
+ id: 'releases',
+ usernameEnvVar: 'RELEASES_USERNAME',
+ passwordEnvVar: 'RELEASES_PASSWORD'
+ },
+ {
+ id: 'snapshots',
+ usernameEnvVar: 'SNAPSHOTS_USERNAME',
+ passwordEnvVar: 'SNAPSHOTS_PASSWORD'
+ }
+ ]);
+ });
+
+ it.each([
+ '*',
+ 'central',
+ 'external:*',
+ 'external:http:*',
+ '*,!internal',
+ 'external:*,!internal',
+ '!internal,external:http:*',
+ 'external:*,!external:http:*'
+ ])('preserves the mirror selector %s and URL colons', mirrorOf => {
+ expect(
+ auth.parseMavenMirrors([
+ '',
+ ' \t ',
+ ` private : https://[2001:db8::1]:8443/maven : ${mirrorOf} `,
+ 'public:https://repo.example.com:443/releases:central'
+ ])
+ ).toEqual([
+ {
+ id: 'private',
+ url: 'https://[2001:db8::1]:8443/maven',
+ mirrorOf
+ },
+ {
+ id: 'public',
+ url: 'https://repo.example.com:443/releases',
+ mirrorOf: 'central'
+ }
+ ]);
+ });
+
+ it.each([
+ 'https://repo.example.com:8443',
+ 'https://repo.example.com:8443/maven',
+ 'https://[2001:db8::1]',
+ 'https://[2001:db8::1]/maven',
+ 'https://[2001:db8::1]:8443',
+ 'https://[2001:db8::1]:8443/maven',
+ 'https://repo.example.com/maven?redirect=https%3A//upstream.example.com%3A8443',
+ 'https://repo.example.com/maven#urn%3Aartifact',
+ 'https://repo.example.com/maven?redirect=https://upstream.example.com:8443',
+ 'https://repo.example.com/maven#urn:artifact'
+ ])('preserves the complete mirror URL %s with an explicit selector', url => {
+ expect(
+ auth.parseMavenMirrors([`private:${url}:external:http:*,!internal`])
+ ).toEqual([{id: 'private', url, mirrorOf: 'external:http:*,!internal'}]);
+ });
+
+ it.each([
+ 'private',
+ 'private:https://repo.example.com',
+ 'private:https://repo.example.com:8443',
+ 'private:https://repo.example.com:8443/maven',
+ 'private:https://[2001:db8::1]',
+ 'private:https://[2001:db8::1]/maven',
+ 'private:https://[2001:db8::1]:8443',
+ 'private:https://[2001:db8::1]:8443/maven',
+ 'private:repo.example.com:central',
+ ':https://repo.example.com:*',
+ 'private::*',
+ 'private:https://repo.example.com:',
+ 'private: :*',
+ 'private:https://repo.example.com: '
+ ])('rejects malformed mirror entry %s with a line number', entry => {
+ expect(() => auth.parseMavenMirrors(['', entry])).toThrow(
+ 'Invalid mvn-mirrors entry at line 2.'
+ );
+ });
+
+ it('rejects duplicate mirror IDs after trimming', () => {
+ expect(() =>
+ auth.parseMavenMirrors([
+ 'private:https://first.example.com:*',
+ ' private :https://second.example.com:central'
+ ])
+ ).toThrow("Duplicate mirror-id 'private' in mvn-mirrors input at line 2");
+ });
+
+ it('leaves settings unchanged for absent or blank mirrors', () => {
+ const servers = credentials('github', 'USERNAME', 'PASSWORD');
+ expect(auth.parseMavenMirrors(['', ' ', '\t'])).toEqual([]);
+ expect(auth.generate(servers, undefined, undefined, [])).toBe(
+ auth.generate(servers)
+ );
+ expect(auth.generate(servers)).not.toContain('');
+ });
+
+ it('generates public mirrors without credentials or repository profiles', () => {
+ const mirrors = auth.parseMavenMirrors([
+ 'public:https://repo.example.com:external:*',
+ 'fallback:https://other.example.com:central'
+ ]);
+ const xml = auth.generate([], undefined, undefined, mirrors);
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {mirrors: {mirror: mirrors}}
+ });
+ expect(xml).not.toContain('');
+ expect(xml).not.toContain('');
+ });
+
+ it('escapes all mirror fields as XML text', () => {
+ const mirror = {
+ id: 'private<&>',
+ url: 'https://repo.example.com/maven?a=1&b=',
+ mirrorOf: '*,!internal<&>'
+ };
+ const xml = auth.generate([], undefined, undefined, [mirror]);
+ expect(xml).toContain('private<&>');
+ expect(xml).toContain('a=1&b=<value>');
+ expect(xml).toContain('*,!internal<&>');
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {mirrors: {mirror}}
+ });
+ });
+
+ it.each([
+ {combined: false, overwrite: true},
+ {combined: true, overwrite: true},
+ {combined: true, overwrite: false}
+ ])(
+ 'configures mirrors with combined=$combined and overwrite=$overwrite',
+ async ({combined, overwrite}) => {
+ const directory = path.join(m2Dir, 'mirrors');
+ const location = path.join(directory, MVN_SETTINGS_FILE);
+ fs.mkdirSync(directory, {recursive: true});
+ fs.writeFileSync(location, 'EXISTING SETTINGS');
+ const url = 'https://maven.example.com/releases';
+ const inputs: Record = {
+ 'settings-path': directory,
+ 'overwrite-settings': String(overwrite),
+ 'mvn-repositories-include-central': 'false',
+ ...(combined ? {'gpg-passphrase-env-var': 'GPG_PASSPHRASE'} : {})
+ };
+ const multilineInputs: Record = {
+ 'mvn-server-credentials': ['private:PRIVATE_USERNAME:PRIVATE_TOKEN'],
+ 'mvn-mirrors': [`private:${url}:*`],
+ ...(combined
+ ? {
+ 'mvn-repositories': [`private:${url}:false`],
+ 'mvn-plugin-repositories': [`private:${url}:false`]
+ }
+ : {})
+ };
+ jest.mocked(core.getInput).mockImplementation(name => inputs[name] ?? '');
+ jest
+ .mocked(core.getMultilineInput)
+ .mockImplementation(name => multilineInputs[name] ?? []);
+
+ await auth.configureAuthentication();
+
+ const xml = fs.readFileSync(location, 'utf8');
+ if (!overwrite) {
+ expect(xml).toBe('EXISTING SETTINGS');
+ return;
+ }
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {
+ mirrors: {mirror: {id: 'private', url, mirrorOf: '*'}},
+ servers: {
+ server: {
+ id: 'private',
+ username: '${env.PRIVATE_USERNAME}',
+ password: '${env.PRIVATE_TOKEN}'
+ }
+ }
+ }
+ });
+ if (combined) {
+ expect(xml).toContain('');
+ expect(xml).toContain('');
+ expect(xml).toContain('GPG_PASSPHRASE');
+ } else {
+ expect(xml).not.toContain('');
+ expect(core.getInput).not.toHaveBeenCalledWith(
+ 'mvn-repositories-include-central'
+ );
+ }
+ }
+ );
+
+ it.each(repositoryInputs)(
+ 'parses %s while preserving colons in URLs',
+ inputName => {
+ expect(
+ auth.parseMavenRepositories(
+ [
+ '',
+ ' private : https://repo.example.com:8443/maven : TRUE ',
+ 'releases:https://repo.example.com/releases:false'
+ ],
+ true,
+ inputName
+ )
+ ).toEqual([
+ {
+ id: 'private',
+ url: 'https://repo.example.com:8443/maven',
+ snapshotsEnabled: true
+ },
+ {
+ id: 'releases',
+ url: 'https://repo.example.com/releases',
+ snapshotsEnabled: false
+ }
+ ]);
+ }
+ );
+
+ it.each(
+ [
+ {
+ entries: ['private'],
+ error:
+ 'Invalid mvn-repositories entry at line 1. Expected format: repository-id:repository-url:snapshots-enabled'
+ },
+ {
+ entries: ['private:https://repo.example.com'],
+ error:
+ "Invalid snapshots-enabled value '//repo.example.com' in mvn-repositories entry at line 1. Expected true or false"
+ },
+ {
+ entries: ['private::true'],
+ error:
+ 'Invalid mvn-repositories entry at line 1. repository-id, repository URL, and snapshots-enabled are required'
+ },
+ {
+ entries: ['private:https://repo.example.com:'],
+ error:
+ 'Invalid mvn-repositories entry at line 1. repository-id, repository URL, and snapshots-enabled are required'
+ },
+ {
+ entries: ['', 'private:https://repo.example.com:true', ' :url:false'],
+ error:
+ 'Invalid mvn-repositories entry at line 3. repository-id, repository URL, and snapshots-enabled are required'
+ },
+ {
+ entries: ['private:https://repo.example.com:sometimes'],
+ error:
+ "Invalid snapshots-enabled value 'sometimes' in mvn-repositories entry at line 1. Expected true or false"
+ }
+ ].flatMap(testCase =>
+ repositoryInputs.map(inputName => ({
+ ...testCase,
+ inputName,
+ error: testCase.error.replace('mvn-repositories', inputName)
+ }))
+ )
+ )('rejects malformed $inputName: $entries', ({entries, error, inputName}) => {
+ expect(() => auth.parseMavenRepositories(entries, true, inputName)).toThrow(
+ error
+ );
+ });
+
+ it.each(repositoryInputs)('rejects duplicate IDs in %s', inputName => {
+ expect(() =>
+ auth.parseMavenRepositories(
+ [
+ 'private:https://first.example.com:false',
+ 'private:https://second.example.com:true'
+ ],
+ true,
+ inputName
+ )
+ ).toThrow(`Duplicate repository-id 'private' in ${inputName} input`);
+ });
+
+ it.each(repositoryInputs)(
+ 'reserves the Central ID in %s only when automatic inclusion is enabled',
+ inputName => {
+ const central = 'central:https://custom.example.com/maven:false';
+
+ expect(() =>
+ auth.parseMavenRepositories([central], true, inputName)
+ ).toThrow(
+ "Repository-id 'central' is reserved when mvn-repositories-include-central is enabled"
+ );
+ expect(auth.parseMavenRepositories([central], false, inputName)).toEqual([
+ {
+ id: 'central',
+ url: 'https://custom.example.com/maven',
+ snapshotsEnabled: false
+ }
+ ]);
+ }
+ );
+
+ it('uses an explicit Central repository instead of adding a disabled override', () => {
+ const parsed = parseXmlObject(
+ auth.generate(
+ credentials('packages', 'USERNAME', 'PASSWORD'),
+ undefined,
+ repositorySettings(
+ auth.parseMavenRepositories(
+ ['central:https://mirror.example.com/maven:true'],
+ false
+ ),
+ false
+ )
+ )
+ ) as any;
+
+ expect(parsed.settings.profiles.profile.repositories.repository).toEqual({
+ id: 'central',
+ url: 'https://mirror.example.com/maven',
+ snapshots: {enabled: 'true'}
+ });
+ });
+
+ it('reads Maven repository settings and Central controls', () => {
+ (core.getMultilineInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'mvn-repositories'
+ ? ['private:https://repo.example.com:true']
+ : []
+ );
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ const inputs: Record = {
+ 'mvn-repositories-include-central': 'false',
+ 'mvn-repositories-prioritize-central': 'false'
+ };
+ return inputs[name] ?? '';
+ });
+
+ expect(auth.getMavenRepositorySettings()).toEqual({
+ repositories: [
+ {
+ id: 'private',
+ url: 'https://repo.example.com',
+ snapshotsEnabled: true
+ }
+ ],
+ pluginRepositories: [],
+ includeCentral: false,
+ prioritizeCentral: false
+ });
+ });
+
+ it('does not read repository controls when no repositories are configured', () => {
+ (
+ core.getInput as jest.MockedFunction
+ ).mockReturnValue('false');
+ expect(auth.getMavenRepositorySettings()).toBeUndefined();
+ expect(core.getInput).not.toHaveBeenCalled();
+ });
+
+ it('ignores blank dependency and plugin repository inputs', () => {
+ (
+ core.getMultilineInput as jest.MockedFunction<
+ typeof core.getMultilineInput
+ >
+ ).mockReturnValue(['', ' ', '\t']);
+
+ expect(auth.getMavenRepositorySettings()).toBeUndefined();
+ expect(core.getInput).not.toHaveBeenCalled();
+ });
+
+ it.each(repositoryConfigurations)(
+ 'reads $name inputs with default Central controls and shared IDs',
+ ({repositories, pluginRepositories}) => {
+ (
+ core.getInput as jest.MockedFunction
+ ).mockReturnValue('');
+ (
+ core.getMultilineInput as jest.MockedFunction<
+ typeof core.getMultilineInput
+ >
+ ).mockImplementation(name => {
+ const configured =
+ name === 'mvn-repositories' ? repositories : pluginRepositories;
+ return configured.map(
+ repository =>
+ `${repository.id}:${repository.url}:${repository.snapshotsEnabled}`
+ );
+ });
+
+ expect(auth.getMavenRepositorySettings()).toEqual({
+ repositories,
+ pluginRepositories,
+ includeCentral: true,
+ prioritizeCentral: true
+ });
+ }
+ );
+
+ it.each([true, false])(
+ 'configures plugin repositories with credentials, GPG, a custom path, and overwrite=%s',
+ async overwriteSettings => {
+ const directory = path.join(m2Dir, 'custom');
+ const location = path.join(directory, MVN_SETTINGS_FILE);
+ fs.mkdirSync(directory, {recursive: true});
+ fs.writeFileSync(location, 'EXISTING SETTINGS');
+ (
+ core.getInput as jest.MockedFunction
+ ).mockImplementation(name => {
+ const inputs: Record = {
+ 'settings-path': directory,
+ 'overwrite-settings': String(overwriteSettings),
+ 'gpg-passphrase-env-var': 'GPG_PASSPHRASE',
+ 'mvn-repositories-include-central': 'false'
+ };
+ return inputs[name] ?? '';
+ });
+ (
+ core.getMultilineInput as jest.MockedFunction<
+ typeof core.getMultilineInput
+ >
+ ).mockImplementation(name => {
+ const inputs: Record = {
+ 'mvn-server-credentials': ['private:USERNAME:PASSWORD'],
+ 'mvn-server-repository-origins': ['private:https://repo.example.com'],
+ 'mvn-plugin-repositories': [
+ 'private:https://repo.example.com/maven:true'
+ ]
+ };
+ return inputs[name] ?? [];
+ });
+
+ await auth.configureAuthentication();
+
+ const xml = fs.readFileSync(location, 'utf8');
+ if (!overwriteSettings) {
+ expect(xml).toBe('EXISTING SETTINGS');
+ return;
+ }
+ expect(parseXmlObject(xml)).toMatchObject({
+ settings: {
+ servers: {
+ server: {
+ id: 'private',
+ username: '${env.USERNAME}',
+ password: '${env.PASSWORD}',
+ repositoryOrigins: {
+ repositoryOrigin: 'https://repo.example.com'
+ }
+ }
+ },
+ profiles: {
+ profile: [
+ {
+ id: 'setup-java-repositories',
+ repositories: {repository: disabledCentralRepositoryXml},
+ pluginRepositories: {
+ pluginRepository: [
+ privateRepositoryXml,
+ disabledCentralRepositoryXml
+ ]
+ }
+ },
+ {
+ id: 'setup-java-gpg',
+ properties: {'gpg.passphraseEnvName': 'GPG_PASSPHRASE'}
+ }
+ ]
+ },
+ activeProfiles: {
+ activeProfile: ['setup-java-repositories', 'setup-java-gpg']
+ }
+ }
+ });
+ expect(fs.existsSync(settingsFile)).toBe(false);
+ }
+ );
+
+ it.each([
+ {
+ entries: ['releases:RELEASES_USERNAME'],
+ error:
+ 'Invalid mvn-server-credentials entry at line 1. Expected format: server-id:USERNAME_ENV:PASSWORD_ENV'
+ },
+ {
+ entries: ['', 'releases:RELEASES_USERNAME:RELEASES_PASSWORD:EXTRA'],
+ error:
+ 'Invalid mvn-server-credentials entry at line 2. Expected format: server-id:USERNAME_ENV:PASSWORD_ENV'
+ },
+ {
+ entries: ['releases::RELEASES_PASSWORD'],
+ error:
+ 'Invalid mvn-server-credentials entry at line 1. server-id, username environment variable, and password environment variable are required'
+ }
+ ])(
+ 'rejects malformed Maven server credentials: $entries',
+ ({entries, error}) => {
+ expect(() => auth.parseMavenServerCredentials(entries)).toThrow(error);
+ }
+ );
+
+ it('rejects duplicate Maven server ids', () => {
+ expect(() =>
+ auth.parseMavenServerCredentials([
+ 'releases:RELEASES_USERNAME:RELEASES_PASSWORD',
+ 'releases:OTHER_USERNAME:OTHER_PASSWORD'
+ ])
+ ).toThrow("Duplicate server-id 'releases' in mvn-server-credentials input");
+ });
+
+ it('uses multiline Maven server credentials instead of single-server inputs', () => {
+ (core.getMultilineInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'mvn-server-credentials'
+ ? [
+ 'releases:RELEASES_USERNAME:RELEASES_PASSWORD',
+ 'snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD'
+ ]
+ : name === 'mvn-server-repository-origins'
+ ? ['releases:https://repo.example.com']
+ : []
+ );
+
+ expect(auth.getMavenServerSettings()).toEqual([
+ {
+ id: 'releases',
+ usernameEnvVar: 'RELEASES_USERNAME',
+ passwordEnvVar: 'RELEASES_PASSWORD',
+ repositoryOrigins: ['https://repo.example.com']
+ },
+ {
+ id: 'snapshots',
+ usernameEnvVar: 'SNAPSHOTS_USERNAME',
+ passwordEnvVar: 'SNAPSHOTS_PASSWORD'
+ }
+ ]);
+ expect(core.getInput).not.toHaveBeenCalled();
+ });
+
+ it('uses the existing single-server inputs when multiline credentials are absent', () => {
+ (core.getInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'server-id' ? 'github' : ''
+ );
+
+ expect(auth.getMavenServerSettings()).toEqual([
+ {
+ id: 'github',
+ usernameEnvVar: 'GITHUB_ACTOR',
+ passwordEnvVar: 'GITHUB_TOKEN'
+ }
+ ]);
+ });
+
+ it('preserves deprecated single-server aliases as fallback inputs', () => {
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ const inputs: Record = {
+ 'server-id': 'legacy',
+ 'server-username': 'LEGACY_USERNAME',
+ 'server-password': 'LEGACY_PASSWORD'
+ };
+ return inputs[name] ?? '';
+ });
+
+ expect(auth.getMavenServerSettings()).toEqual([
+ {
+ id: 'legacy',
+ usernameEnvVar: 'LEGACY_USERNAME',
+ passwordEnvVar: 'LEGACY_PASSWORD'
+ }
+ ]);
+ expect(core.warning).toHaveBeenCalledTimes(2);
+ });
+
+ it('adds normalized repository origins to matching Maven servers', () => {
+ expect(
+ auth.addMavenServerRepositoryOrigins(
+ [
+ {
+ id: 'central',
+ usernameEnvVar: 'CENTRAL_USER',
+ passwordEnvVar: 'CENTRAL_PASS'
+ },
+ {
+ id: 'packages',
+ usernameEnvVar: 'GITHUB_ACTOR',
+ passwordEnvVar: 'GITHUB_TOKEN'
+ }
+ ],
+ [
+ 'central:https://central.sonatype.com/',
+ 'central:https://central.sonatype.com',
+ 'central:https://central.sonatype.com:443',
+ 'packages:https://maven.pkg.github.com',
+ 'packages:ssh://packages.example.com:22',
+ 'packages:ftp://packages.example.com:21'
+ ]
+ )
+ ).toEqual([
+ {
+ id: 'central',
+ usernameEnvVar: 'CENTRAL_USER',
+ passwordEnvVar: 'CENTRAL_PASS',
+ repositoryOrigins: ['https://central.sonatype.com']
+ },
+ {
+ id: 'packages',
+ usernameEnvVar: 'GITHUB_ACTOR',
+ passwordEnvVar: 'GITHUB_TOKEN',
+ repositoryOrigins: [
+ 'https://maven.pkg.github.com',
+ 'ssh://packages.example.com:22',
+ 'ftp://packages.example.com:21'
+ ]
+ }
+ ]);
+ });
+
+ it.each([
+ {
+ entries: ['central'],
+ error:
+ 'Invalid mvn-server-repository-origins entry at line 1. Expected format: server-id:repository-origin'
+ },
+ {
+ entries: ['other:https://repo.example.com'],
+ error:
+ "Unknown server-id 'other' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https://repo.example.com/path'],
+ error:
+ "Invalid repository origin 'https://repo.example.com/path' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https:repo.example.com'],
+ error:
+ "Invalid repository origin 'https:repo.example.com' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https:/repo.example.com'],
+ error:
+ "Invalid repository origin 'https:/repo.example.com' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https://repo.example.com?'],
+ error:
+ "Invalid repository origin 'https://repo.example.com?' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https://repo.example.com#'],
+ error:
+ "Invalid repository origin 'https://repo.example.com#' in mvn-server-repository-origins at line 1"
+ },
+ {
+ entries: ['central:https://@repo.example.com'],
+ error:
+ "Invalid repository origin 'https://@repo.example.com' in mvn-server-repository-origins at line 1"
+ }
+ ])('rejects invalid Maven server repository origins', ({entries, error}) => {
+ expect(() =>
+ auth.addMavenServerRepositoryOrigins(
+ [
+ {
+ id: 'central',
+ usernameEnvVar: 'CENTRAL_USER',
+ passwordEnvVar: 'CENTRAL_PASS'
+ }
+ ],
+ entries
+ )
+ ).toThrow(error);
+ });
+
+ function xmlElementText(xml: string, tagName: string): string {
+ const match = new RegExp(`<${tagName}>([\\s\\S]*?)${tagName}>`).exec(xml);
+ expect(match).not.toBeNull();
+ return (parseXmlObject(`${match?.[1]}`) as {value: string})
+ .value;
+ }
+
+ function parseXmlObject(xml: string): unknown {
+ const parser = new XMLParser({
+ ignoreAttributes: false,
+ attributeNamePrefix: '@',
+ parseAttributeValue: false,
+ parseTagValue: false,
+ trimValues: true
+ });
+ return parser.parse(xml);
+ }
+
+ it('uses deprecated input aliases and warns', () => {
+ const mockGetInput = core.getInput as jest.MockedFunction<
+ typeof core.getInput
+ >;
+ const mockWarning = core.warning as jest.MockedFunction<
+ typeof core.warning
+ >;
+ mockGetInput.mockImplementation(name =>
+ name === 'server-username' ? 'LEGACY_USERNAME' : ''
+ );
+
+ expect(
+ auth.getInputWithDeprecatedAlias(
+ 'server-username-env-var',
+ 'server-username',
+ 'GITHUB_ACTOR'
+ )
+ ).toBe('LEGACY_USERNAME');
+ expect(mockWarning).toHaveBeenCalledWith(
+ "The 'server-username' input is deprecated and may be removed in a future release. Please use 'server-username-env-var' instead."
+ );
+
+ mockGetInput.mockReset();
+ mockWarning.mockReset();
+ });
+
+ it('prefers the replacement input over its deprecated alias', () => {
+ const mockGetInput = core.getInput as jest.MockedFunction<
+ typeof core.getInput
+ >;
+ mockGetInput.mockImplementation(name => {
+ const inputs: Record = {
+ 'server-password-env-var': 'NEW_PASSWORD',
+ 'server-password': 'LEGACY_PASSWORD'
+ };
+ return inputs[name] || '';
+ });
+
+ expect(
+ auth.getInputWithDeprecatedAlias(
+ 'server-password-env-var',
+ 'server-password',
+ 'GITHUB_TOKEN'
+ )
+ ).toBe('NEW_PASSWORD');
+ expect(core.warning).toHaveBeenCalled();
+
+ mockGetInput.mockReset();
+ (core.warning as jest.Mock).mockReset();
});
});
diff --git a/__tests__/benchmark-cache-restore.sh b/__tests__/benchmark-cache-restore.sh
new file mode 100644
index 000000000..46470eafe
--- /dev/null
+++ b/__tests__/benchmark-cache-restore.sh
@@ -0,0 +1,135 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+command=${1:?command is required}
+tool=${2:?tool is required}
+
+case "$tool" in
+ maven)
+ dependency_cache="$HOME/.m2/repository"
+ wrapper_cache="$HOME/.m2/wrapper/dists"
+ dependency_file="benchmark/pom.xml"
+ wrapper_file="benchmark/.mvn/wrapper/maven-wrapper.properties"
+ ;;
+ gradle)
+ dependency_cache="$HOME/.gradle/caches"
+ wrapper_cache="$HOME/.gradle/wrapper"
+ dependency_file="benchmark/build.gradle"
+ wrapper_file="benchmark/gradle/wrapper/gradle-wrapper.properties"
+ ;;
+ *)
+ echo "Unsupported tool: $tool" >&2
+ exit 1
+ ;;
+esac
+
+case "$command" in
+ prepare)
+ profile=${3:?profile is required}
+ mkdir -p "$(dirname "$dependency_file")" "$(dirname "$wrapper_file")"
+ printf '// setup-java cache benchmark v1: %s\n' "$profile" > "$dependency_file"
+ printf '# setup-java cache benchmark v1: %s\n' "$profile" > "$wrapper_file"
+ ;;
+ reset)
+ rm -rf "$dependency_cache" "$wrapper_cache"
+ ;;
+ populate)
+ profile=${3:?profile is required}
+ case "$profile" in
+ small)
+ dependency_megabytes=8
+ wrapper_megabytes=2
+ ;;
+ large)
+ dependency_megabytes=128
+ wrapper_megabytes=32
+ ;;
+ *)
+ echo "Unsupported profile: $profile" >&2
+ exit 1
+ ;;
+ esac
+ mkdir -p "$dependency_cache/setup-java-benchmark"
+ mkdir -p "$wrapper_cache/setup-java-benchmark"
+ dd if=/dev/urandom \
+ of="$dependency_cache/setup-java-benchmark/payload" \
+ bs=1048576 count="$dependency_megabytes" 2>/dev/null
+ dd if=/dev/urandom \
+ of="$wrapper_cache/setup-java-benchmark/payload" \
+ bs=1048576 count="$wrapper_megabytes" 2>/dev/null
+ ;;
+ start)
+ node -e "require('fs').writeFileSync('.benchmark-start', String(Date.now()))"
+ ;;
+ record)
+ os=${3:?os is required}
+ profile=${4:?profile is required}
+ implementation=${5:?implementation is required}
+ iteration=${6:?iteration is required}
+ cache_hit=${7:?cache-hit output is required}
+ if [ "$cache_hit" != "true" ]; then
+ echo "Expected an exact dependency-cache hit for $implementation" >&2
+ exit 1
+ fi
+ test -f "$dependency_cache/setup-java-benchmark/payload"
+ started=$(cat .benchmark-start)
+ finished=$(node -e "process.stdout.write(String(Date.now()))")
+ elapsed=$((finished - started))
+ mkdir -p .benchmark-results
+ printf '%s,%s,%s,%s,%s,%s\n' \
+ "$os" "$tool" "$profile" "$implementation" "$iteration" "$elapsed" \
+ >> .benchmark-results/timings.csv
+ ;;
+ summarize)
+ summary_file=${3:?summary file is required}
+ results_file=".benchmark-results/timings.csv"
+ node --input-type=module - "$results_file" "$summary_file" <<'NODE'
+import fs from 'node:fs';
+
+const [, , resultsFile, summaryFile] = process.argv;
+const rows = fs
+ .readFileSync(resultsFile, 'utf8')
+ .trim()
+ .split('\n')
+ .map(line => {
+ const [os, tool, profile, implementation, iteration, elapsed] =
+ line.split(',');
+ return {os, tool, profile, implementation, iteration, elapsed: +elapsed};
+ });
+const average = implementation => {
+ const values = rows
+ .filter(row => row.implementation === implementation)
+ .map(row => row.elapsed);
+ if (values.length === 0) {
+ throw new Error(`No ${implementation} benchmark results were recorded`);
+ }
+ return Math.round(values.reduce((sum, value) => sum + value, 0) / values.length);
+};
+const baseline = average('baseline');
+const candidate = average('candidate');
+const change = (((candidate - baseline) / baseline) * 100).toFixed(1);
+const {os, tool, profile} = rows[0];
+const lines = [
+ `### ${tool} ${profile} cache restore on ${os}`,
+ '',
+ '| Implementation | Iteration | Wall time (ms) |',
+ '| --- | ---: | ---: |',
+ ...rows.map(
+ row =>
+ `| ${row.implementation} | ${row.iteration} | ${row.elapsed} |`
+ ),
+ `| **baseline average** | | **${baseline}** |`,
+ `| **candidate average** | | **${candidate}** |`,
+ '',
+ `Candidate change from baseline: **${change}%**`,
+ ''
+];
+fs.appendFileSync(summaryFile, `${lines.join('\n')}\n`);
+NODE
+ ;;
+ *)
+ echo "Unsupported command: $command" >&2
+ exit 1
+ ;;
+esac
diff --git a/__tests__/cache-feature.test.ts b/__tests__/cache-feature.test.ts
new file mode 100644
index 000000000..4953d9b93
--- /dev/null
+++ b/__tests__/cache-feature.test.ts
@@ -0,0 +1,80 @@
+import {jest, describe, it, expect, afterEach} from '@jest/globals';
+
+jest.unstable_mockModule('@actions/cache', () => ({
+ isFeatureAvailable: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/core', () => ({
+ warning: jest.fn(),
+ debug: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ info: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const cache = await import('@actions/cache');
+const core = await import('@actions/core');
+const {isCacheFeatureAvailable} = await import('../src/cache-feature.js');
+
+describe('isCacheFeatureAvailable', () => {
+ it('is disabled on GHES when cache feature is unavailable', () => {
+ (cache.isFeatureAvailable as jest.Mock).mockImplementation(
+ () => false
+ );
+ const warningMock = core.warning as jest.Mock;
+ const message =
+ 'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.';
+
+ try {
+ process.env['GITHUB_SERVER_URL'] = 'http://example.com';
+ expect(isCacheFeatureAvailable()).toBe(false);
+ expect(warningMock).toHaveBeenCalledWith(message);
+ } finally {
+ delete process.env['GITHUB_SERVER_URL'];
+ }
+ });
+
+ it('is disabled on dotcom when cache feature is unavailable', () => {
+ (cache.isFeatureAvailable as jest.Mock).mockImplementation(
+ () => false
+ );
+ const warningMock = core.warning as jest.Mock;
+ const message =
+ 'The runner was not able to contact the cache service. Caching will be skipped';
+
+ try {
+ process.env['GITHUB_SERVER_URL'] = 'http://github.com';
+ expect(isCacheFeatureAvailable()).toBe(false);
+ expect(warningMock).toHaveBeenCalledWith(message);
+ } finally {
+ delete process.env['GITHUB_SERVER_URL'];
+ }
+ });
+
+ it('is enabled when cache feature is available', () => {
+ (cache.isFeatureAvailable as jest.Mock).mockImplementation(() => true);
+ expect(isCacheFeatureAvailable()).toBe(true);
+ });
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ });
+});
diff --git a/__tests__/cache.test.ts b/__tests__/cache.test.ts
index 9762fb983..690f4a6a5 100644
--- a/__tests__/cache.test.ts
+++ b/__tests__/cache.test.ts
@@ -1,22 +1,85 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
import {mkdtempSync} from 'fs';
import {tmpdir} from 'os';
import {join} from 'path';
-import {restore, save} from '../src/cache';
+import {createHash} from 'crypto';
import * as fs from 'fs';
import * as os from 'os';
-import * as core from '@actions/core';
-import * as cache from '@actions/cache';
-import * as glob from '@actions/glob';
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+jest.unstable_mockModule('@actions/cache', () => ({
+ restoreCache: jest.fn(),
+ saveCache: jest.fn(),
+ isFeatureAvailable: jest.fn(),
+ ValidationError: class ValidationError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = 'ValidationError';
+ }
+ },
+ ReserveCacheError: class ReserveCacheError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = 'ReserveCacheError';
+ }
+ }
+}));
+
+jest.unstable_mockModule('@actions/glob', () => ({
+ hashFiles: jest.fn(),
+ create: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const cache = await import('@actions/cache');
+const glob = await import('@actions/glob');
+const {restore, save, validatePackageManager} = await import('../src/cache.js');
describe('dependency cache', () => {
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE'];
const ORIGINAL_CWD = process.cwd();
let workspace: string;
- let spyInfo: jest.SpyInstance>;
- let spyWarning: jest.SpyInstance>;
- let spyDebug: jest.SpyInstance>;
- let spySaveState: jest.SpyInstance>;
+ let spyInfo: any;
+ let spyWarning: any;
+ let spyDebug: any;
+ let spySaveState: any;
+ let spyCoreError: any;
beforeEach(() => {
workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
@@ -40,17 +103,21 @@ describe('dependency cache', () => {
});
beforeEach(() => {
- spyInfo = jest.spyOn(core, 'info');
+ spyInfo = core.info as jest.Mock;
spyInfo.mockImplementation(() => null);
- spyWarning = jest.spyOn(core, 'warning');
+ spyWarning = core.warning as jest.Mock;
spyWarning.mockImplementation(() => null);
- spyDebug = jest.spyOn(core, 'debug');
+ spyDebug = core.debug as jest.Mock;
spyDebug.mockImplementation(() => null);
- spySaveState = jest.spyOn(core, 'saveState');
+ spySaveState = core.saveState as jest.Mock;
spySaveState.mockImplementation(() => null);
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -58,25 +125,39 @@ describe('dependency cache', () => {
process.env['GITHUB_WORKSPACE'] = ORIGINAL_GITHUB_WORKSPACE;
process.env['RUNNER_OS'] = ORIGINAL_RUNNER_OS;
resetState();
+
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ jest.restoreAllMocks();
+ });
+
+ describe('validatePackageManager', () => {
+ it('accepts supported package managers', () => {
+ expect(() => validatePackageManager('maven')).not.toThrow();
+ expect(() => validatePackageManager('gradle')).not.toThrow();
+ expect(() => validatePackageManager('sbt')).not.toThrow();
+ });
+
+ it('throws the targeted error for unsupported package managers', () => {
+ expect(() => validatePackageManager('ant')).toThrow(
+ 'unknown package manager specified: ant'
+ );
+ });
});
describe('restore', () => {
- let spyCacheRestore: jest.SpyInstance<
- ReturnType,
- Parameters
- >;
- let spyGlobHashFiles: jest.SpyInstance<
- ReturnType,
- Parameters
- >;
+ let spyCacheRestore: any;
+ let spyGlobHashFiles: any;
+ let spySetOutput: any;
beforeEach(() => {
- spyCacheRestore = jest
- .spyOn(cache, 'restoreCache')
- .mockImplementation((paths: string[], primaryKey: string) =>
- Promise.resolve(undefined)
- );
- spyGlobHashFiles = jest.spyOn(glob, 'hashFiles');
+ spyCacheRestore = (cache.restoreCache as any).mockImplementation(
+ (paths: string[], primaryKey: string) => Promise.resolve(undefined)
+ );
+ spyGlobHashFiles = glob.hashFiles as jest.Mock;
+ spyGlobHashFiles.mockResolvedValue('hash-stub');
+ spySetOutput = core.setOutput as jest.Mock;
+ spySetOutput.mockImplementation(() => null);
spyWarning.mockImplementation(() => null);
});
@@ -87,29 +168,196 @@ describe('dependency cache', () => {
});
describe('for maven', () => {
- it('throws error if no pom.xml found', async () => {
+ it('throws error if no pom.xml, maven-wrapper.properties, or extensions.xml found', async () => {
+ spyGlobHashFiles.mockResolvedValue('');
await expect(restore('maven', '')).rejects.toThrow(
`No file in ${projectRoot(
workspace
- )} matched to [**/pom.xml], make sure you have checked out the target repository`
+ )} matched to [**/pom.xml,**/.mvn/wrapper/maven-wrapper.properties,**/.mvn/extensions.xml], make sure you have checked out the target repository`
);
});
- it('downloads cache', async () => {
+ it('downloads cache based on pom.xml', async () => {
createFile(join(workspace, 'pom.xml'));
await restore('maven', '');
- expect(spyCacheRestore).toHaveBeenCalled();
- expect(spyGlobHashFiles).toHaveBeenCalledWith('**/pom.xml');
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ expect.any(String)
+ );
+ expect(spyGlobHashFiles).toHaveBeenCalledWith(
+ '**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
+ });
+ it('sets the cache-primary-key output', async () => {
+ createFile(join(workspace, 'pom.xml'));
+
+ await restore('maven', '');
+ expect(spySetOutput).toHaveBeenCalledWith(
+ 'cache-primary-key',
+ expect.stringContaining('setup-java-')
+ );
+ });
+ it('downloads cache based on maven-wrapper.properties', async () => {
+ createDirectory(join(workspace, '.mvn'));
+ createDirectory(join(workspace, '.mvn', 'wrapper'));
+ createFile(
+ join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
+ );
+
+ await restore('maven', '');
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ expect.any(String)
+ );
+ expect(spyGlobHashFiles).toHaveBeenCalledWith(
+ '**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
+ );
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
});
+ it('downloads cache based on extensions.xml', async () => {
+ createDirectory(join(workspace, '.mvn'));
+ createFile(join(workspace, '.mvn', 'extensions.xml'));
+
+ await restore('maven', '');
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ expect.any(String)
+ );
+ expect(spyGlobHashFiles).toHaveBeenCalledWith(
+ '**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
+ });
+ it('restores the maven wrapper distribution cache independently of the main cache', async () => {
+ createDirectory(join(workspace, '.mvn'));
+ createDirectory(join(workspace, '.mvn', 'wrapper'));
+ createFile(
+ join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
+ );
+
+ await restore('maven', '', ['/custom/maven/repository']);
+ // Main dependency cache no longer carries the wrapper dists path.
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ ['/custom/maven/repository'],
+ expect.any(String)
+ );
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'wrapper', 'dists')],
+ expect.stringContaining('maven-wrapper')
+ );
+ expect(spyGlobHashFiles).toHaveBeenCalledWith(
+ '**/.mvn/wrapper/maven-wrapper.properties'
+ );
+ expect(spyInfo).toHaveBeenCalledWith(
+ 'maven-wrapper cache is not found'
+ );
+ });
+ it('starts maven dependency and wrapper restores before either completes', async () => {
+ createDirectory(join(workspace, '.mvn'));
+ createDirectory(join(workspace, '.mvn', 'wrapper'));
+ createFile(
+ join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
+ );
+ const dependencyRestore = deferred();
+ const wrapperRestore = deferred();
+ const bothRestoresStarted = deferred();
+ let restoreCount = 0;
+ spyCacheRestore.mockImplementation((paths: string[]) => {
+ restoreCount++;
+ if (restoreCount === 2) {
+ bothRestoresStarted.resolve();
+ }
+ return paths.includes(join(os.homedir(), '.m2', 'repository'))
+ ? dependencyRestore.promise
+ : wrapperRestore.promise;
+ });
+
+ const restorePromise = restore('maven', '');
+ await bothRestoresStarted.promise;
+
+ expect(spyCacheRestore).toHaveBeenCalledTimes(2);
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-primary-key',
+ expect.any(String)
+ );
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-primary-key-maven-wrapper',
+ expect.any(String)
+ );
+
+ wrapperRestore.resolve('maven-wrapper-hit');
+ dependencyRestore.resolve('maven-dependency-hit');
+ await restorePromise;
+
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-matched-key-maven-wrapper',
+ 'maven-wrapper-hit'
+ );
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-matched-key',
+ 'maven-dependency-hit'
+ );
+ expect(spySetOutput).toHaveBeenCalledWith('cache-hit', false);
+ });
+ it('propagates a wrapper restore failure after starting both restores', async () => {
+ createDirectory(join(workspace, '.mvn'));
+ createDirectory(join(workspace, '.mvn', 'wrapper'));
+ createFile(
+ join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
+ );
+ const dependencyRestore = deferred();
+ const wrapperRestore = deferred();
+ const bothRestoresStarted = deferred();
+ let restoreCount = 0;
+ spyCacheRestore.mockImplementation((paths: string[]) => {
+ restoreCount++;
+ if (restoreCount === 2) {
+ bothRestoresStarted.resolve();
+ }
+ return paths.includes(join(os.homedir(), '.m2', 'repository'))
+ ? dependencyRestore.promise
+ : wrapperRestore.promise;
+ });
+
+ const restorePromise = restore('maven', '');
+ await bothRestoresStarted.promise;
+ wrapperRestore.reject(new Error('wrapper restore failed'));
+ dependencyRestore.resolve(undefined);
+
+ await expect(restorePromise).rejects.toThrow('wrapper restore failed');
+ });
+ it('skips the maven wrapper cache when no wrapper properties exist', async () => {
+ createFile(join(workspace, 'pom.xml'));
+ spyGlobHashFiles.mockImplementation((pattern: string) =>
+ Promise.resolve(
+ pattern === '**/.mvn/wrapper/maven-wrapper.properties'
+ ? ''
+ : 'hash-stub'
+ )
+ );
+
+ await restore('maven', '');
+ // Only the main dependency cache is restored; the wrapper cache path is
+ // never touched because the project does not use mvnw.
+ expect(spyCacheRestore).toHaveBeenCalledTimes(1);
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ expect.any(String)
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
});
describe('for gradle', () => {
it('throws error if no build.gradle found', async () => {
+ spyGlobHashFiles.mockResolvedValue('');
await expect(restore('gradle', '')).rejects.toThrow(
`No file in ${projectRoot(
workspace
- )} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml,**/versions.properties], make sure you have checked out the target repository`
+ )} matched to [**/*.gradle*,**/gradle.properties,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml,**/versions.properties], make sure you have checked out the target repository`
);
});
it('downloads cache based on build.gradle', async () => {
@@ -118,7 +366,7 @@ describe('dependency cache', () => {
await restore('gradle', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith(
- '**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
+ '**/*.gradle*\n**/gradle.properties\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
@@ -129,7 +377,7 @@ describe('dependency cache', () => {
await restore('gradle', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith(
- '**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
+ '**/*.gradle*\n**/gradle.properties\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
@@ -141,7 +389,7 @@ describe('dependency cache', () => {
await restore('gradle', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith(
- '**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
+ '**/*.gradle*\n**/gradle.properties\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
@@ -153,14 +401,124 @@ describe('dependency cache', () => {
await restore('gradle', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith(
- '**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
+ '**/*.gradle*\n**/gradle.properties\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
});
+ it('changes the cache key when gradle.properties changes', async () => {
+ const buildFile = join(workspace, 'build.gradle');
+ const propertiesFile = join(workspace, 'gradle.properties');
+ createFile(buildFile);
+ createFile(propertiesFile, 'dependencyVersion=1.0.0');
+ spyGlobHashFiles.mockImplementation(async (pattern: string) => {
+ if (pattern === '**/gradle-wrapper.properties') {
+ return '';
+ }
+
+ const files = [buildFile];
+ if (pattern.split('\n').includes('**/gradle.properties')) {
+ files.push(propertiesFile);
+ }
+ const hash = createHash('sha256');
+ files.forEach(file => hash.update(fs.readFileSync(file)));
+ return hash.digest('hex');
+ });
+
+ await restore('gradle', '');
+ const firstKey = spyCacheRestore.mock.calls[0][1];
+
+ fs.writeFileSync(propertiesFile, 'dependencyVersion=2.0.0');
+ await restore('gradle', '');
+ const secondKey = spyCacheRestore.mock.calls[1][1];
+
+ expect(secondKey).not.toBe(firstKey);
+ });
+ it('restores the gradle wrapper distribution cache independently of the main cache', async () => {
+ createFile(join(workspace, 'build.gradle'));
+
+ await restore('gradle', '', ['/custom/gradle/caches']);
+ // Main dependency cache no longer carries the wrapper path.
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ ['/custom/gradle/caches'],
+ expect.any(String)
+ );
+ // Wrapper distribution is restored on its own, keyed only on the
+ // wrapper properties file.
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.gradle', 'wrapper')],
+ expect.stringContaining('setup-java-')
+ );
+ expect(spyGlobHashFiles).toHaveBeenCalledWith(
+ '**/gradle-wrapper.properties'
+ );
+ });
+ it('starts gradle dependency and wrapper restores before either completes', async () => {
+ createFile(join(workspace, 'build.gradle'));
+ createFile(join(workspace, 'gradle-wrapper.properties'));
+ const dependencyRestore = deferred();
+ const wrapperRestore = deferred();
+ const bothRestoresStarted = deferred();
+ let restoreCount = 0;
+ spyCacheRestore.mockImplementation((paths: string[]) => {
+ restoreCount++;
+ if (restoreCount === 2) {
+ bothRestoresStarted.resolve();
+ }
+ return paths.includes(join(os.homedir(), '.gradle', 'caches'))
+ ? dependencyRestore.promise
+ : wrapperRestore.promise;
+ });
+
+ const restorePromise = restore('gradle', '');
+ await bothRestoresStarted.promise;
+
+ expect(spyCacheRestore).toHaveBeenCalledTimes(2);
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-primary-key',
+ expect.any(String)
+ );
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-primary-key-gradle-wrapper',
+ expect.any(String)
+ );
+
+ dependencyRestore.resolve('gradle-dependency-hit');
+ wrapperRestore.resolve('gradle-wrapper-hit');
+ await restorePromise;
+
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-matched-key',
+ 'gradle-dependency-hit'
+ );
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-matched-key-gradle-wrapper',
+ 'gradle-wrapper-hit'
+ );
+ expect(spySetOutput).toHaveBeenCalledWith('cache-hit', false);
+ });
+ it('skips the gradle wrapper cache when no wrapper properties exist', async () => {
+ createFile(join(workspace, 'build.gradle'));
+ spyGlobHashFiles.mockImplementation((pattern: string) =>
+ Promise.resolve(
+ pattern === '**/gradle-wrapper.properties' ? '' : 'hash-stub'
+ )
+ );
+
+ await restore('gradle', '');
+ // Only the main dependency cache is restored; the wrapper cache path is
+ // never touched because the project does not use the gradle wrapper.
+ expect(spyCacheRestore).toHaveBeenCalledTimes(1);
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ [join(os.homedir(), '.gradle', 'caches')],
+ expect.any(String)
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
});
describe('for sbt', () => {
it('throws error if no build.sbt found', async () => {
+ spyGlobHashFiles.mockResolvedValue('');
await expect(restore('sbt', '')).rejects.toThrow(
`No file in ${projectRoot(
workspace
@@ -179,6 +537,13 @@ describe('dependency cache', () => {
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
});
it('detects scala and sbt changes under **/project/ folder', async () => {
+ let callCount = 0;
+ spyGlobHashFiles.mockImplementation(async () => {
+ callCount++;
+ // Return same hash for first two calls, different for third
+ return callCount <= 2 ? 'hash-v1' : 'hash-v2';
+ });
+
createFile(join(workspace, 'build.sbt'));
createDirectory(join(workspace, 'project'));
createFile(join(workspace, 'project/DependenciesV1.scala'));
@@ -207,13 +572,14 @@ describe('dependency cache', () => {
await restore('gradle', '');
expect(spyCacheRestore).toHaveBeenCalled();
expect(spyGlobHashFiles).toHaveBeenCalledWith(
- '**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
+ '**/*.gradle*\n**/gradle.properties\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
);
expect(spyWarning).not.toHaveBeenCalled();
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
});
describe('cache-dependency-path', () => {
it('throws error if no matching dependency file found', async () => {
+ spyGlobHashFiles.mockResolvedValue('');
createFile(join(workspace, 'build.gradle.kts'));
await expect(
restore('gradle', 'sub-project/**/build.gradle.kts')
@@ -253,19 +619,47 @@ describe('dependency cache', () => {
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
});
});
+ describe('cache-path', () => {
+ it.each([
+ ['maven', ['/custom/maven/repository']],
+ ['gradle', ['/custom/gradle/caches']],
+ [
+ 'sbt',
+ [
+ '/custom/ivy/cache',
+ '/custom/coursier/cache',
+ '!/custom/ivy/cache/*.lock'
+ ]
+ ]
+ ])(
+ 'restores and persists custom paths for %s',
+ async (packageManager, cachePaths) => {
+ await restore(packageManager, '', cachePaths);
+
+ expect(spyCacheRestore).toHaveBeenCalledWith(
+ cachePaths,
+ expect.any(String)
+ );
+ expect(spySaveState).toHaveBeenCalledWith(
+ 'cache-paths',
+ JSON.stringify(cachePaths)
+ );
+ }
+ );
+ });
});
describe('save', () => {
- let spyCacheSave: jest.SpyInstance<
- ReturnType,
- Parameters
- >;
+ let spyCacheSave: any;
+ let spyGlobCreate: jest.Mock;
beforeEach(() => {
- spyCacheSave = jest
- .spyOn(cache, 'saveCache')
- .mockImplementation((paths: string[], key: string) =>
- Promise.resolve(0)
- );
+ spyCacheSave = (cache.saveCache as any).mockImplementation(
+ (paths: string[], key: string) => Promise.resolve(0)
+ );
+ spyGlobCreate = glob.create as jest.Mock;
+ spyGlobCreate.mockResolvedValue({
+ glob: jest.fn(() => Promise.resolve(['wrapper-path']))
+ });
spyWarning.mockImplementation(() => null);
});
@@ -282,10 +676,12 @@ describe('dependency cache', () => {
await save('maven');
expect(spyCacheSave).toHaveBeenCalled();
expect(spyWarning).not.toHaveBeenCalled();
- expect(spyInfo).toHaveBeenCalled();
- expect(spyInfo).toHaveBeenCalledWith(
+ expect(spyInfo).not.toHaveBeenCalledWith(
expect.stringMatching(/^Cache saved with the key:.*/)
);
+ expect(spyDebug).toHaveBeenCalledWith(
+ expect.stringMatching(/^Cache was not saved for the key:.*/)
+ );
});
it('saves with error from toolkit, should fail workflow', async () => {
@@ -300,6 +696,42 @@ describe('dependency cache', () => {
);
});
+ it.each([
+ ['maven', ['/custom/maven/repository']],
+ ['gradle', ['/custom/gradle/caches']],
+ [
+ 'sbt',
+ [
+ '/custom/ivy/cache',
+ '/custom/coursier/cache',
+ '!/custom/ivy/cache/*.lock'
+ ]
+ ]
+ ])(
+ 'saves the persisted custom paths for %s',
+ async (packageManager, cachePaths) => {
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-paths':
+ return JSON.stringify(cachePaths);
+ default:
+ return '';
+ }
+ });
+
+ await save(packageManager);
+
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ cachePaths,
+ 'setup-java-cache-primary-key'
+ );
+ }
+ );
+
describe('for maven', () => {
it('uploads cache even if no pom.xml found', async () => {
createStateForMissingBuildFile();
@@ -327,6 +759,114 @@ describe('dependency cache', () => {
expect.stringMatching(/^Cache saved with the key:.*/)
);
});
+ it('saves the maven wrapper distribution cache under its own key', async () => {
+ createFile(join(workspace, 'pom.xml'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-maven-wrapper':
+ return 'setup-java-maven-wrapper-key';
+ default:
+ return '';
+ }
+ });
+
+ await save('maven');
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ ['wrapper-path'],
+ 'setup-java-maven-wrapper-key'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
+ it('does not save the maven wrapper cache on an exact wrapper hit', async () => {
+ createFile(join(workspace, 'pom.xml'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-maven-wrapper':
+ case 'cache-matched-key-maven-wrapper':
+ return 'setup-java-maven-wrapper-key';
+ default:
+ return '';
+ }
+ });
+
+ await save('maven');
+ expect(spyCacheSave).not.toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'wrapper', 'dists')],
+ expect.any(String)
+ );
+ });
+ it('does not fail the post step when the wrapper distribution path is missing', async () => {
+ createFile(join(workspace, 'pom.xml'));
+ createDirectory(join(workspace, '.mvn'));
+ createDirectory(join(workspace, '.mvn', 'wrapper'));
+ createFile(
+ join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
+ );
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-maven-wrapper':
+ return 'setup-java-maven-wrapper-key';
+ default:
+ return '';
+ }
+ });
+ spyGlobCreate.mockResolvedValue({
+ glob: jest.fn(() => Promise.resolve([]))
+ });
+
+ await expect(save('maven')).resolves.toBeUndefined();
+ expect(spyCacheSave).not.toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'wrapper', 'dists')],
+ expect.any(String)
+ );
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ 'setup-java-cache-primary-key'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
+ it('continues with primary cache save when additional cache save fails unexpectedly', async () => {
+ createFile(join(workspace, 'pom.xml'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-maven-wrapper':
+ return 'setup-java-maven-wrapper-key';
+ default:
+ return '';
+ }
+ });
+ spyCacheSave.mockImplementation((paths: string[], key: string) => {
+ if (paths[0] === 'wrapper-path') {
+ return Promise.reject(new Error('wrapper save exploded'));
+ }
+ return Promise.resolve(0);
+ });
+
+ await expect(save('maven')).resolves.toBeUndefined();
+ expect(spyWarning).toHaveBeenCalledWith(
+ 'Failed to save maven-wrapper cache: wrapper save exploded. Continuing with primary cache save.'
+ );
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ [join(os.homedir(), '.m2', 'repository')],
+ 'setup-java-cache-primary-key'
+ );
+ });
});
describe('for gradle', () => {
it('uploads cache even if no build.gradle found', async () => {
@@ -379,6 +919,80 @@ describe('dependency cache', () => {
expect.stringMatching(/^Cache saved with the key:.*/)
);
});
+ it('saves the gradle wrapper distribution cache under its own key', async () => {
+ createFile(join(workspace, 'build.gradle'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-gradle-wrapper':
+ return 'setup-java-gradle-wrapper-key';
+ default:
+ return '';
+ }
+ });
+
+ await save('gradle');
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ ['wrapper-path'],
+ 'setup-java-gradle-wrapper-key'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
+ it('does not save the gradle wrapper cache on an exact wrapper hit', async () => {
+ createFile(join(workspace, 'build.gradle'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-gradle-wrapper':
+ case 'cache-matched-key-gradle-wrapper':
+ return 'setup-java-gradle-wrapper-key';
+ default:
+ return '';
+ }
+ });
+
+ await save('gradle');
+ expect(spyCacheSave).not.toHaveBeenCalledWith(
+ [join(os.homedir(), '.gradle', 'wrapper')],
+ expect.any(String)
+ );
+ });
+ it('does not fail the post step when the wrapper distribution path is missing', async () => {
+ createFile(join(workspace, 'build.gradle'));
+ createFile(join(workspace, 'gradle-wrapper.properties'));
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case 'cache-primary-key-gradle-wrapper':
+ return 'setup-java-gradle-wrapper-key';
+ default:
+ return '';
+ }
+ });
+ spyGlobCreate.mockResolvedValue({
+ glob: jest.fn(() => Promise.resolve([]))
+ });
+
+ await expect(save('gradle')).resolves.toBeUndefined();
+ expect(spyCacheSave).not.toHaveBeenCalledWith(
+ [join(os.homedir(), '.gradle', 'wrapper')],
+ expect.any(String)
+ );
+ expect(spyCacheSave).toHaveBeenCalledWith(
+ [join(os.homedir(), '.gradle', 'caches')],
+ 'setup-java-cache-primary-key'
+ );
+ expect(spyWarning).not.toHaveBeenCalled();
+ });
});
describe('for sbt', () => {
it('uploads cache even if no build.sbt found', async () => {
@@ -423,14 +1037,14 @@ describe('dependency cache', () => {
});
function resetState() {
- jest.spyOn(core, 'getState').mockReset();
+ (core.getState as jest.Mock).mockReset();
}
/**
* Create states to emulate a restore process without build file.
*/
function createStateForMissingBuildFile() {
- jest.spyOn(core, 'getState').mockImplementation(name => {
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
switch (name) {
case 'cache-primary-key':
return 'setup-java-cache-';
@@ -444,7 +1058,7 @@ function createStateForMissingBuildFile() {
* Create states to emulate a successful restore process.
*/
function createStateForSuccessfulRestore() {
- jest.spyOn(core, 'getState').mockImplementation(name => {
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
switch (name) {
case 'cache-primary-key':
return 'setup-java-cache-primary-key';
@@ -456,9 +1070,19 @@ function createStateForSuccessfulRestore() {
});
}
-function createFile(path: string) {
+function createFile(path: string, contents = '') {
core.info(`created a file at ${path}`);
- fs.writeFileSync(path, '');
+ fs.writeFileSync(path, contents);
+}
+
+function deferred() {
+ let resolve!: (value: T | PromiseLike) => void;
+ let reject!: (reason?: unknown) => void;
+ const promise = new Promise((promiseResolve, promiseReject) => {
+ resolve = promiseResolve;
+ reject = promiseReject;
+ });
+ return {promise, resolve, reject};
}
function createDirectory(path: string) {
diff --git a/__tests__/cache/gradle1/gradle/wrapper/gradle-wrapper.properties b/__tests__/cache/gradle1/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..e78380889
--- /dev/null
+++ b/__tests__/cache/gradle1/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1 @@
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
diff --git a/__tests__/cache/maven/.mvn/wrapper/maven-wrapper.properties b/__tests__/cache/maven/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 000000000..2b8cd3d63
--- /dev/null
+++ b/__tests__/cache/maven/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
diff --git a/__tests__/cache/maven2/.gitignore b/__tests__/cache/maven2/.gitignore
new file mode 100644
index 000000000..0e13eebbe
--- /dev/null
+++ b/__tests__/cache/maven2/.gitignore
@@ -0,0 +1,11 @@
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+# https://github.com/takari/maven-wrapper#usage-without-binary-jar
+.mvn/wrapper/maven-wrapper.jar
diff --git a/__tests__/cache/maven2/pom.xml b/__tests__/cache/maven2/pom.xml
new file mode 100644
index 000000000..70b8d0cc1
--- /dev/null
+++ b/__tests__/cache/maven2/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+ io.github.actions
+ setup-java-maven2-example
+ 1.0.0-SNAPSHOT
+ jar
+
+
+ org.apache.commons
+ commons-lang3
+ 3.12.0
+
+
+
diff --git a/__tests__/cache/sbt2/.gitignore b/__tests__/cache/sbt2/.gitignore
new file mode 100644
index 000000000..2f7896d1d
--- /dev/null
+++ b/__tests__/cache/sbt2/.gitignore
@@ -0,0 +1 @@
+target/
diff --git a/__tests__/cache/sbt2/build.sbt b/__tests__/cache/sbt2/build.sbt
new file mode 100644
index 000000000..c8737676e
--- /dev/null
+++ b/__tests__/cache/sbt2/build.sbt
@@ -0,0 +1,3 @@
+ThisBuild / scalaVersion := "2.12.15"
+
+libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
diff --git a/__tests__/check-dir.sh b/__tests__/check-dir.sh
new file mode 100755
index 000000000..30da05fdc
--- /dev/null
+++ b/__tests__/check-dir.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+# Assert whether a directory exists, for use in the e2e cache workflows.
+#
+# Usage: check-dir.sh [present|absent]
+#
+# present (default): fail if does NOT exist, otherwise list its contents.
+# absent: fail if DOES exist.
+#
+# Call with already-expanded paths (e.g. "$HOME/.gradle/caches") to avoid
+# tilde-expansion pitfalls.
+set -eu
+
+if [ "$#" -lt 1 ]; then
+ echo "Usage: check-dir.sh [present|absent]" >&2
+ exit 2
+fi
+
+dir=$1
+mode=${2:-present}
+
+case "$mode" in
+ present)
+ if [ ! -d "$dir" ]; then
+ echo "::error::The $dir directory does not exist unexpectedly"
+ exit 1
+ fi
+ ls "$dir"
+ ;;
+ absent)
+ if [ -d "$dir" ]; then
+ echo "::error::The $dir directory exists unexpectedly"
+ exit 1
+ fi
+ ;;
+ *)
+ echo "::error::Unknown mode '$mode' (expected 'present' or 'absent')"
+ exit 1
+ ;;
+esac
diff --git a/__tests__/checksum.test.ts b/__tests__/checksum.test.ts
new file mode 100644
index 000000000..b8e3f0185
--- /dev/null
+++ b/__tests__/checksum.test.ts
@@ -0,0 +1,130 @@
+import {afterEach, describe, expect, it, jest} from '@jest/globals';
+import {createHash} from 'crypto';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+
+import {calculateChecksum, verifyChecksum} from '../src/checksum.js';
+import type {ChecksumMetadata} from '../src/distributions/base-models.js';
+
+const temporaryPaths: string[] = [];
+
+async function temporaryFile(contents: string): Promise {
+ const directory = await fs.promises.mkdtemp(
+ path.join(os.tmpdir(), 'setup-java-checksum-')
+ );
+ const file = path.join(directory, 'archive');
+ await fs.promises.writeFile(file, contents);
+ temporaryPaths.push(directory);
+ return file;
+}
+
+afterEach(async () => {
+ await Promise.all(
+ temporaryPaths
+ .splice(0)
+ .map(item => fs.promises.rm(item, {recursive: true, force: true}))
+ );
+ jest.restoreAllMocks();
+});
+
+describe('verifyChecksum', () => {
+ it.each(['sha256', 'sha512'] as const)(
+ 'verifies a matching %s digest',
+ async algorithm => {
+ const contents = `jdk archive for ${algorithm}`;
+ const file = await temporaryFile(contents);
+ const value = createHash(algorithm).update(contents).digest('hex');
+
+ await expect(
+ verifyChecksum(
+ file,
+ {algorithm, value: value.toUpperCase()},
+ {distribution: 'Test', version: '21.0.1'}
+ )
+ ).resolves.toBeUndefined();
+ }
+ );
+
+ it('reports mismatch context and both digests', async () => {
+ const file = await temporaryFile('corrupt archive');
+ const expected = 'a'.repeat(64);
+ const actual = await calculateChecksum(file, 'sha256');
+
+ await expect(
+ verifyChecksum(
+ file,
+ {algorithm: 'sha256', value: expected},
+ {distribution: 'Corretto', version: '21.0.8'}
+ )
+ ).rejects.toThrow(
+ `Checksum verification failed for Corretto version 21.0.8: sha256 expected ${expected}, actual ${actual}.`
+ );
+ });
+
+ it('rejects malformed digest metadata before reading the file', async () => {
+ await expect(
+ verifyChecksum(
+ '/missing/archive',
+ {algorithm: 'sha512', value: 'not-a-digest'},
+ {distribution: 'Test', version: '17'}
+ )
+ ).rejects.toThrow(
+ 'Malformed sha512 checksum metadata: expected a 128-character hexadecimal digest.'
+ );
+ });
+
+ it.each([undefined, null, 123])(
+ 'reports a malformed digest when the value is %p',
+ async value => {
+ const checksum = {
+ algorithm: 'sha256',
+ value
+ } as unknown as ChecksumMetadata;
+
+ await expect(
+ verifyChecksum('/missing/archive', checksum, {
+ distribution: 'Test',
+ version: '17'
+ })
+ ).rejects.toThrow(
+ 'Malformed sha256 checksum metadata: expected a 64-character hexadecimal digest.'
+ );
+ }
+ );
+
+ it('rejects unsupported algorithms without leaking source query parameters', async () => {
+ const checksum = {
+ algorithm: 'md5',
+ value: 'a'.repeat(32),
+ source: 'https://vendor.example/checksum.txt?token=secret-value#private'
+ } as unknown as ChecksumMetadata;
+
+ let message = '';
+ try {
+ await verifyChecksum('/missing/archive', checksum, {
+ distribution: 'Test',
+ version: '17'
+ });
+ } catch (error) {
+ message = (error as Error).message;
+ }
+
+ expect(message).toContain(
+ "Unsupported checksum algorithm 'md5' from https://vendor.example/checksum.txt"
+ );
+ expect(message).not.toContain('secret-value');
+ expect(message).not.toContain('token=');
+ expect(message).not.toContain('#private');
+ });
+
+ it('surfaces file read errors', async () => {
+ await expect(
+ verifyChecksum(
+ '/missing/archive',
+ {algorithm: 'sha256', value: 'a'.repeat(64)},
+ {distribution: 'Test', version: '17'}
+ )
+ ).rejects.toMatchObject({code: 'ENOENT'});
+ });
+});
diff --git a/__tests__/cleanup-java.test.ts b/__tests__/cleanup-java.test.ts
index 375a2ad15..36441fbf6 100644
--- a/__tests__/cleanup-java.test.ts
+++ b/__tests__/cleanup-java.test.ts
@@ -1,32 +1,111 @@
-import {run as cleanup} from '../src/cleanup-java';
-import * as core from '@actions/core';
-import * as cache from '@actions/cache';
-import * as util from '../src/util';
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+
+// Mock @actions/cache before importing source modules
+const real_cache_module = await import('@actions/cache');
+jest.unstable_mockModule('@actions/cache', () => ({
+ ...real_cache_module,
+ saveCache: jest.fn(),
+ restoreCache: jest.fn()
+}));
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../src/util.js');
+jest.unstable_mockModule('../src/util.js', () => ({
+ ...real_util_module,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getToolcachePath: jest.fn(),
+ isJobStatusSuccess: jest.fn(),
+ renameWinArchive: jest.fn(),
+ isVersionSatisfies: real_util_module.isVersionSatisfies,
+ getTempDir: real_util_module.getTempDir
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const cache = await import('@actions/cache');
+const {run: cleanup} = await import('../src/cleanup-java.js');
+const util = await import('../src/util.js');
+const constants = await import('../src/constants.js');
+const {GPG_HOME_PREFIX} = await import('../src/gpg.js');
+const {registerJdk, buildJdkCacheKey} = await import('../src/jdk-cache.js');
+
+const jdkTempRoots: string[] = [];
describe('cleanup', () => {
- let spyWarning: jest.SpyInstance>;
- let spyInfo: jest.SpyInstance>;
- let spyCacheSave: jest.SpyInstance<
- ReturnType,
- Parameters
- >;
- let spyJobStatusSuccess: jest.SpyInstance;
+ let spyWarning: any;
+ let spyInfo: any;
+ let spyCacheSave: any;
+ let spyJobStatusSuccess: any;
+ let spyCoreError: any;
beforeEach(() => {
- spyWarning = jest.spyOn(core, 'warning');
+ spyWarning = core.warning as jest.Mock;
spyWarning.mockImplementation(() => null);
- spyInfo = jest.spyOn(core, 'info');
+
+ spyInfo = core.info as jest.Mock;
spyInfo.mockImplementation(() => null);
- spyCacheSave = jest.spyOn(cache, 'saveCache');
- spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess');
+
+ spyCacheSave = cache.saveCache as jest.Mock;
+
+ spyJobStatusSuccess = util.isJobStatusSuccess as jest.Mock;
spyJobStatusSuccess.mockReturnValue(true);
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+
createStateForSuccessfulRestore();
});
+
afterEach(() => {
+ while (jdkTempRoots.length) {
+ fs.rmSync(jdkTempRoots.pop()!, {recursive: true, force: true});
+ }
resetState();
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ jest.restoreAllMocks();
});
- it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
+ it('does not warn/fail even when the save process throws a ReserveCacheError', async () => {
spyCacheSave.mockImplementation((paths: string[], key: string) =>
Promise.reject(
new cache.ReserveCacheError(
@@ -34,35 +113,230 @@ describe('cleanup', () => {
)
)
);
- jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
return name === 'cache' ? 'gradle' : '';
});
+
await cleanup();
expect(spyCacheSave).toHaveBeenCalled();
expect(spyWarning).not.toHaveBeenCalled();
});
+ it('removes the isolated GPG home without touching unrelated key material', async () => {
+ const tempDir = util.getTempDir();
+ fs.mkdirSync(tempDir, {recursive: true});
+ const gpgHome = fs.mkdtempSync(path.join(tempDir, GPG_HOME_PREFIX));
+ const unrelatedGpgHome = fs.mkdtempSync(
+ path.join(tempDir, 'user-gpg-home-')
+ );
+ fs.writeFileSync(
+ path.join(unrelatedGpgHome, 'private.key'),
+ 'pre-existing'
+ );
+ (core.getInput as jest.Mock).mockReturnValue('');
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === constants.STATE_GPG_HOME ? gpgHome : ''
+ );
+
+ await cleanup();
+
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ expect(
+ fs.readFileSync(path.join(unrelatedGpgHome, 'private.key'), 'utf8')
+ ).toBe('pre-existing');
+ fs.rmSync(unrelatedGpgHome, {recursive: true, force: true});
+ });
+
+ it('makes repeated cleanup of the same GPG home idempotent', async () => {
+ const tempDir = util.getTempDir();
+ fs.mkdirSync(tempDir, {recursive: true});
+ const gpgHome = fs.mkdtempSync(path.join(tempDir, GPG_HOME_PREFIX));
+ (core.getInput as jest.Mock).mockReturnValue('');
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === constants.STATE_GPG_HOME ? gpgHome : ''
+ );
+
+ await cleanup();
+ await cleanup();
+
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+
+ it('skips GPG cleanup when no home was persisted', async () => {
+ (core.getInput as jest.Mock).mockReturnValue('');
+ (core.getState as jest.Mock).mockReturnValue('');
+
+ await cleanup();
+
+ expect(spyInfo).not.toHaveBeenCalledWith(
+ 'Removing private key from isolated GPG home'
+ );
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+
it('does not fail even though the save process throws error', async () => {
spyCacheSave.mockImplementation((paths: string[], key: string) =>
Promise.reject(new Error('Unexpected error'))
);
- jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
return name === 'cache' ? 'gradle' : '';
});
await cleanup();
expect(spyCacheSave).toHaveBeenCalled();
});
+
+ it.each(['maven', 'gradle', 'sbt'])(
+ 'does not save the %s cache in read-only mode',
+ async packageManager => {
+ createStateForSuccessfulRestoreWithWrapper(packageManager);
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ switch (name) {
+ case 'cache':
+ return packageManager;
+ case 'cache-read-only':
+ return 'true';
+ default:
+ return '';
+ }
+ });
+
+ await cleanup();
+
+ expect(spyCacheSave).not.toHaveBeenCalled();
+ expect(core.getState).toHaveBeenCalledTimes(1);
+ expect(core.getState).toHaveBeenCalledWith(constants.STATE_GPG_HOME);
+ expect(spyInfo).toHaveBeenCalledWith(
+ 'Cache saving is skipped because cache-read-only is enabled.'
+ );
+ }
+ );
+
+ it('saves the cache when read-only mode is explicitly disabled', async () => {
+ spyCacheSave.mockResolvedValue(0);
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ switch (name) {
+ case 'cache':
+ return 'maven';
+ case 'cache-read-only':
+ return 'false';
+ default:
+ return '';
+ }
+ });
+
+ await cleanup();
+
+ expect(spyCacheSave).toHaveBeenCalled();
+ });
+
+ it('saves the JDK cache without dependency caching', async () => {
+ const {key, path: jdkPath, state} = createRegisteredJdk();
+ (core.getInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'cache-jdk' ? 'true' : ''
+ );
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === 'jdk-caches' ? state : ''
+ );
+ spyCacheSave.mockResolvedValue(1);
+
+ await cleanup();
+
+ expect(spyCacheSave).toHaveBeenCalledWith([jdkPath], key);
+ });
+
+ it('does not save a JDK cache when cache-jdk is disabled', async () => {
+ (core.getInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'cache-jdk' ? 'false' : ''
+ );
+
+ await cleanup();
+
+ expect(spyCacheSave).not.toHaveBeenCalled();
+ });
+
+ it.each([
+ ['', '', false],
+ ['', 'true', true],
+ ['', 'false', false],
+ ['maven', '', true],
+ ['maven', 'true', true],
+ ['maven', 'false', false]
+ ])(
+ 'uses effective JDK caching for cache=%j and cache-jdk=%j',
+ async (cacheInput, cacheJdkInput, expectedJdkSave) => {
+ const {key: jdkKey, path: jdkPath, state} = createRegisteredJdk();
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ if (name === 'cache') return cacheInput;
+ if (name === 'cache-jdk') return cacheJdkInput;
+ return '';
+ });
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === 'jdk-caches' ? state : ''
+ );
+ spyCacheSave.mockResolvedValue(1);
+
+ await cleanup();
+
+ const jdkSaveCalls = spyCacheSave.mock.calls.filter(
+ ([, key]) => key === jdkKey
+ );
+ expect(jdkSaveCalls).toHaveLength(expectedJdkSave ? 1 : 0);
+ if (expectedJdkSave) {
+ expect(spyCacheSave).toHaveBeenCalledWith([jdkPath], jdkKey);
+ }
+ }
+ );
+
+ it('keeps saving the remaining JDK caches when one save fails', async () => {
+ const first = createRegisteredJdk();
+ const second = createRegisteredJdk('17.0.19+9');
+ (core.getInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'cache-jdk' ? 'true' : ''
+ );
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === 'jdk-caches' ? second.state : ''
+ );
+ spyCacheSave.mockImplementation(async (paths: string[]) => {
+ if (paths[0] === first.path) {
+ throw new Error('Unexpected save failure');
+ }
+ return 1;
+ });
+
+ await cleanup();
+
+ expect(spyCacheSave).toHaveBeenCalledWith([first.path], first.key);
+ expect(spyCacheSave).toHaveBeenCalledWith([second.path], second.key);
+ expect(spyCoreError).not.toHaveBeenCalled();
+ });
+
+ it('does not save a JDK installation that was replaced after registration', async () => {
+ const {key, path: jdkPath, state, replace} = createRegisteredJdk();
+ (core.getInput as jest.Mock).mockImplementation((name: string) =>
+ name === 'cache-jdk' ? 'true' : ''
+ );
+ (core.getState as jest.Mock).mockImplementation((name: string) =>
+ name === 'jdk-caches' ? state : ''
+ );
+ spyCacheSave.mockResolvedValue(1);
+ replace();
+
+ await cleanup();
+
+ expect(spyCacheSave).not.toHaveBeenCalledWith([jdkPath], key);
+ });
});
function resetState() {
- jest.spyOn(core, 'getState').mockReset();
+ (core.getState as jest.Mock).mockReset();
}
/**
* Create states to emulate a successful restore process.
*/
function createStateForSuccessfulRestore() {
- jest.spyOn(core, 'getState').mockImplementation(name => {
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
switch (name) {
case 'cache-primary-key':
return 'setup-java-cache-primary-key';
@@ -73,3 +347,64 @@ function createStateForSuccessfulRestore() {
}
});
}
+
+function createStateForSuccessfulRestoreWithWrapper(packageManager: string) {
+ (core.getState as jest.Mock).mockImplementation((name: any) => {
+ switch (name) {
+ case 'cache-primary-key':
+ return 'setup-java-cache-primary-key';
+ case 'cache-matched-key':
+ return 'setup-java-cache-matched-key';
+ case `cache-primary-key-${packageManager}-wrapper`:
+ return `setup-java-${packageManager}-wrapper-primary-key`;
+ default:
+ return '';
+ }
+ });
+}
+
+/**
+ * Register a real JDK installation in a temporary tool cache so the post-job
+ * save sees the same installation identity that setup recorded.
+ */
+function createRegisteredJdk(version = '21.0.8+9') {
+ const root = fs.mkdtempSync(
+ path.join(os.tmpdir(), 'setup-java-cleanup-jdk-')
+ );
+ jdkTempRoots.push(root);
+ const jdkPath = path.join(
+ root,
+ 'Java_temurin_jdk',
+ version.replace('+', '-')
+ );
+ const write = (marker: string) => {
+ const architecturePath = path.join(jdkPath, 'x64');
+ fs.rmSync(architecturePath, {recursive: true, force: true});
+ fs.rmSync(`${architecturePath}.complete`, {force: true});
+ fs.mkdirSync(architecturePath, {recursive: true});
+ fs.writeFileSync(path.join(architecturePath, 'release'), marker);
+ fs.writeFileSync(`${architecturePath}.complete`, marker);
+ };
+ write('installed');
+
+ const jdk = {
+ distribution: 'temurin',
+ packageType: 'jdk',
+ architecture: 'x64',
+ version,
+ source: `sha256:${path.basename(root)}`,
+ verification: 'disabled',
+ path: jdkPath
+ };
+ registerJdk(jdk);
+ const state = (
+ (core.saveState as jest.Mock).mock.calls.at(-1) as string[]
+ )[1];
+
+ return {
+ key: buildJdkCacheKey(jdk),
+ path: jdkPath,
+ state,
+ replace: () => write('replaced-by-a-later-step')
+ };
+}
diff --git a/__tests__/data/adopt.json b/__tests__/data/adopt.json
deleted file mode 100644
index bcf140309..000000000
--- a/__tests__/data/adopt.json
+++ /dev/null
@@ -1,909 +0,0 @@
-[
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 74181,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "09b7e6ab5d5eb4b73813f4caa793a0b616d33794a17988fa6a6b7c972e8f3dd3",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12/OpenJDK14U-jdk_x64_mac_hotspot_14.0.2_12.tar.gz.sha256.txt",
- "download_count": 23872,
- "link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12/OpenJDK14U-jdk_x64_mac_hotspot_14.0.2_12.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12/OpenJDK14U-jdk_x64_mac_hotspot_14.0.2_12.tar.gz.json",
- "name": "OpenJDK14U-jdk_x64_mac_hotspot_14.0.2_12.tar.gz",
- "size": 195705010
- },
- "project": "jdk",
- "scm_ref": "jdk-14.0.2+12_adopt",
- "updated_at": "2020-07-16T08:55:45Z"
- }
- ],
- "download_count": 477080,
- "id": "MDc6UmVsZWFzZTI4NjIyMDc4.+ve8KojpqJUpsA==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/tag/jdk-14.0.2%2B12",
- "release_name": "jdk-14.0.2+12",
- "release_type": "ga",
- "timestamp": "2020-07-16T08:54:16Z",
- "updated_at": "2020-07-16T08:54:16Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 12,
- "major": 14,
- "minor": 0,
- "openjdk_version": "14.0.2+12",
- "security": 2,
- "semver": "14.0.2+12"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 58023,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "b11cb192312530bcd84607631203d0c1727e672af12813078e6b525e3cce862d",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_mac_hotspot_14.0.1_7.tar.gz.sha256.txt",
- "download_count": 25276,
- "link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_mac_hotspot_14.0.1_7.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_mac_hotspot_14.0.1_7.tar.gz.json",
- "name": "OpenJDK14U-jdk_x64_mac_hotspot_14.0.1_7.tar.gz",
- "size": 195769653
- },
- "project": "jdk",
- "scm_ref": "jdk-14.0.1+7_adopt",
- "updated_at": "2020-04-20T12:54:23Z"
- }
- ],
- "download_count": 198607,
- "id": "MDc6UmVsZWFzZTI1Njc4MzEw.z3NqYG25PFlG+Q==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/tag/jdk-14.0.1%2B7",
- "release_name": "jdk-14.0.1+7",
- "release_type": "ga",
- "timestamp": "2020-04-20T12:52:51Z",
- "updated_at": "2020-04-20T12:52:51Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 7,
- "major": 14,
- "minor": 0,
- "openjdk_version": "14.0.1+7",
- "security": 1,
- "semver": "14.0.1+7.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 30069,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "d358a7ff03905282348c6c80562a4da2e04eb377b60ad2152be4c90f8d580b7f",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_mac_hotspot_15.0.2_7.tar.gz.sha256.txt",
- "download_count": 3718,
- "link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_mac_hotspot_15.0.2_7.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_mac_hotspot_15.0.2_7.tar.gz.json",
- "name": "OpenJDK15U-jdk_x64_mac_hotspot_15.0.2_7.tar.gz",
- "size": 195232978
- },
- "project": "jdk",
- "scm_ref": "jdk-15.0.2+7_adopt",
- "updated_at": "2021-01-22T17:33:20Z"
- }
- ],
- "download_count": 124226,
- "id": "MDc6UmVsZWFzZTM2NzgwOTAw.X2+6VqPND3E8CA==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/tag/jdk-15.0.2%2B7",
- "release_name": "jdk-15.0.2+7",
- "release_type": "ga",
- "timestamp": "2021-01-22T17:31:37Z",
- "updated_at": "2021-01-22T17:31:37Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 7,
- "major": 15,
- "minor": 0,
- "openjdk_version": "15.0.2+7",
- "security": 2,
- "semver": "15.0.2+7"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 24542,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "b8c2e2ad31f3d6676ea665d9505b06df15e23741847556612b40e3ee329fc046",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9.1/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz.sha256.txt",
- "download_count": 3274,
- "link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9.1/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9.1/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz.json",
- "name": "OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz",
- "size": 195872839
- },
- "project": "jdk",
- "scm_ref": "jdk-15.0.1+9_adopt",
- "updated_at": "2020-12-01T16:57:47Z"
- }
- ],
- "download_count": 25378,
- "id": "MDc6UmVsZWFzZTM0NjQ2MDU4.Yj2XZf+VBGAPtw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/tag/jdk-15.0.1%2B9.1",
- "release_name": "jdk-15.0.1+9.1",
- "release_type": "ga",
- "timestamp": "2020-12-01T16:57:26Z",
- "updated_at": "2020-12-01T16:57:26Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 9,
- "major": 15,
- "minor": 0,
- "openjdk_version": "15.0.1+9",
- "security": 1,
- "semver": "15.0.1+9.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 21675,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "d32f9429c4992cef7be559a15c542011503d6bc38c89379800cd209a9d7ec539",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz.sha256.txt",
- "download_count": 11935,
- "link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz.json",
- "name": "OpenJDK15U-jdk_x64_mac_hotspot_15.0.1_9.tar.gz",
- "size": 195773522
- },
- "project": "jdk",
- "scm_ref": "jdk-15.0.1+9_adopt",
- "updated_at": "2020-10-23T20:48:09Z"
- }
- ],
- "download_count": 308690,
- "id": "MDc6UmVsZWFzZTMyOTk4MTUx.3oazo3YGfHhF3w==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/tag/jdk-15.0.1%2B9",
- "release_name": "jdk-15.0.1+9",
- "release_type": "ga",
- "timestamp": "2020-10-23T20:46:22Z",
- "updated_at": "2020-10-23T20:46:22Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 9,
- "major": 15,
- "minor": 0,
- "openjdk_version": "15.0.1+9",
- "security": 1,
- "semver": "15.0.1+9"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 51254,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "bd1fc774232e2dfee93056a01f5765bd92ffb19d68dd548c233a82bb5c162be4",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_mac_hotspot_15_36.tar.gz.sha256.txt",
- "download_count": 5325,
- "link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_mac_hotspot_15_36.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_mac_hotspot_15_36.tar.gz.json",
- "name": "OpenJDK15U-jdk_x64_mac_hotspot_15_36.tar.gz",
- "size": 195853361
- },
- "project": "jdk",
- "scm_ref": "jdk-15+36_adopt",
- "updated_at": "2020-09-17T07:43:54Z"
- }
- ],
- "download_count": 157313,
- "id": "MDc6UmVsZWFzZTMxNDUwMjA0.eYpt0EBEjldfEQ==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/tag/jdk-15%2B36",
- "release_name": "jdk-15+36",
- "release_type": "ga",
- "timestamp": "2020-09-17T07:42:21Z",
- "updated_at": "2020-09-17T07:42:21Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 36,
- "major": 15,
- "minor": 0,
- "openjdk_version": "15+36",
- "security": 0,
- "semver": "15.0.0+36"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 27428,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "aabc3aebb0abf1ba64d9bd5796d0c7eb7239983f6e4c0f015b5b88be5616e4bd",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_mac_hotspot_14_36.tar.gz.sha256.txt",
- "download_count": 19544,
- "link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_mac_hotspot_14_36.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_mac_hotspot_14_36.tar.gz.json",
- "name": "OpenJDK14U-jdk_x64_mac_hotspot_14_36.tar.gz",
- "size": 201087797
- },
- "project": "jdk",
- "scm_ref": "jdk-14+36_adopt",
- "updated_at": "2020-03-18T12:13:05Z"
- }
- ],
- "download_count": 364816,
- "id": "MDc6UmVsZWFzZTI0NjMxMDAy.AY7rtvmrnWWlIg==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/tag/jdk-14%2B36",
- "release_name": "jdk-14+36",
- "release_type": "ga",
- "timestamp": "2020-03-18T12:11:08Z",
- "updated_at": "2020-03-18T12:11:08Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 36,
- "major": 14,
- "minor": 0,
- "openjdk_version": "14+36",
- "security": 0,
- "semver": "14.0.0+36.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 63201,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "0ddb24efdf5aab541898d19b7667b149a1a64a8bd039b708fc58ee0284fa7e07",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_mac_hotspot_13.0.2_8.tar.gz.sha256.txt",
- "download_count": 32531,
- "link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_mac_hotspot_13.0.2_8.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_mac_hotspot_13.0.2_8.tar.gz.json",
- "name": "OpenJDK13U-jdk_x64_mac_hotspot_13.0.2_8.tar.gz",
- "size": 198206427
- },
- "project": "jdk",
- "scm_ref": "jdk-13.0.2+8_adopt",
- "updated_at": "2020-01-20T16:46:24Z"
- }
- ],
- "download_count": 349677,
- "id": "MDc6UmVsZWFzZTIyOTgxNTM1.gtZYwGfBgkb3Gg==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/tag/jdk-13.0.2%2B8",
- "release_name": "jdk-13.0.2+8",
- "release_type": "ga",
- "timestamp": "2020-01-20T16:42:35Z",
- "updated_at": "2020-01-20T16:42:35Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 8,
- "major": 13,
- "minor": 0,
- "openjdk_version": "13.0.2+8",
- "security": 2,
- "semver": "13.0.2+8.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 41508,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "9c82de98ce9bc2353bcf314d85366c9a2c572db034e10a71aa47e804e13748c1",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.1%2B9/OpenJDK13U-jdk_x64_mac_hotspot_13.0.1_9.tar.gz.sha256.txt",
- "download_count": 32262,
- "link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.1%2B9/OpenJDK13U-jdk_x64_mac_hotspot_13.0.1_9.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.1%2B9/OpenJDK13U-jdk_x64_mac_hotspot_13.0.1_9.tar.gz.json",
- "name": "OpenJDK13U-jdk_x64_mac_hotspot_13.0.1_9.tar.gz",
- "size": 198205689
- },
- "project": "jdk",
- "scm_ref": "jdk-13.0.1+9_adopt",
- "updated_at": "2019-10-26T14:44:27Z"
- }
- ],
- "download_count": 680021,
- "id": "MDc6UmVsZWFzZTIwOTk4NDA0.srlG2TmLho/j0w==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/tag/jdk-13.0.1%2B9",
- "release_name": "jdk-13.0.1+9",
- "release_type": "ga",
- "timestamp": "2019-10-26T14:43:52Z",
- "updated_at": "2019-10-26T14:43:52Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 9,
- "major": 13,
- "minor": 0,
- "openjdk_version": "13.0.1+9",
- "security": 1,
- "semver": "13.0.1+9.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 37738,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "f948be96daba250b6695e22cb51372d2ba3060e4d778dd09c89548889783099f",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz.sha256.txt",
- "download_count": 37738,
- "link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13%2B33/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz.json",
- "name": "OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz",
- "size": 198189530
- },
- "project": "jdk",
- "scm_ref": "jdk-13+33_adopt",
- "updated_at": "2019-09-19T10:20:21Z"
- }
- ],
- "download_count": 226200,
- "id": "MDc6UmVsZWFzZTIwMTA0MTUy.trK7qCbNtlMWFw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/tag/jdk-13%2B33",
- "release_name": "jdk-13+33",
- "release_type": "ga",
- "timestamp": "2019-09-19T10:19:58Z",
- "updated_at": "2019-09-19T10:19:58Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 33,
- "major": 13,
- "minor": 0,
- "openjdk_version": "13+33",
- "security": 0,
- "semver": "13.0.0+33.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 24493,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "9919eee037554d40c7d2f219bbd654f2bf119e16a2f4d284d8dedaf525ee59e6",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.sha256.txt",
- "download_count": 22907,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.json",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "size": 198392994
- },
- "project": "jdk",
- "scm_ref": "jdk-12.0.2+10_adopt",
- "updated_at": "2019-07-18T20:27:24Z"
- }
- ],
- "download_count": 396318,
- "id": "MDc6UmVsZWFzZTE4NzE2Mzk5.S/VUFSgnrVIv8A==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.2%2B10",
- "release_name": "jdk-12.0.2+10",
- "release_type": "ga",
- "timestamp": "2019-07-18T20:26:29Z",
- "updated_at": "2019-07-18T20:26:29Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 10,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12.0.2+10",
- "security": 2,
- "semver": "12.0.2+10.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 5539,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "7acd697e816491d31b24d0ae1867fd63060aa738cfa388757946ae312a60b4f2",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.3/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.sha256.txt",
- "download_count": 5539,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.3/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.3/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.json",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "size": 198429049
- },
- "project": "jdk",
- "scm_ref": "jdk-12.0.2+10_adopt",
- "updated_at": "2019-09-19T17:17:37Z"
- }
- ],
- "download_count": 5879,
- "id": "MDc6UmVsZWFzZTIwMTE2ODQ3.QGQl8Nj1qkma4Q==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.2%2B10.3",
- "release_name": "jdk-12.0.2+10.3",
- "release_type": "ga",
- "timestamp": "2019-09-19T17:17:26Z",
- "updated_at": "2019-12-06T15:10:37Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 3,
- "build": 10,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12.0.2+10",
- "security": 2,
- "semver": "12.0.2+10.3"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 22794,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "2c1a46c0fab6d4bdbc443f23c3f6a313c2de47fbbd9c16b5c1133a88f6c1ab8f",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.2/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.sha256.txt",
- "download_count": 637,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.2/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10.2/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.json",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "size": 198862174
- },
- "project": "jdk",
- "scm_ref": "jdk-12.0.2+10_adopt",
- "updated_at": "2019-08-06T10:41:10Z"
- }
- ],
- "download_count": 23563,
- "id": "MDc6UmVsZWFzZTE5MTAzMTI3.in65dKG+veAxOg==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.2%2B10.2",
- "release_name": "jdk-12.0.2+10.2",
- "release_type": "ga",
- "timestamp": "2019-08-06T10:40:44Z",
- "updated_at": "2019-08-06T10:40:44Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 2,
- "build": 10,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12.0.2+10",
- "security": 2,
- "semver": "12.0.2+10.2"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 24493,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "9919eee037554d40c7d2f219bbd654f2bf119e16a2f4d284d8dedaf525ee59e6",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.sha256.txt",
- "download_count": 22907,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.2%2B10/OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz.json",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.tar.gz",
- "size": 198392994
- },
- "project": "jdk",
- "scm_ref": "jdk-12.0.2+9_adopt",
- "updated_at": "2019-07-18T20:27:24Z"
- }
- ],
- "download_count": 396318,
- "id": "MDc6UmVsZWFzZTE4NzE2Mzk5.S/VUFSgnrVIv8A==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.2%2B10",
- "release_name": "jdk-12.0.2+9",
- "release_type": "ga",
- "timestamp": "2019-07-18T20:26:29Z",
- "updated_at": "2019-07-18T20:26:29Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 10,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12.0.2+9",
- "security": 2,
- "semver": "12.0.2+9.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 39519,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "dcb2ab681247298eda018df24166ba01674127083fb02892acf087e6181d8c56",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.1%2B12/OpenJDK12U-jdk_x64_mac_hotspot_12.0.1_12.tar.gz.sha256.txt",
- "download_count": 33306,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.1%2B12/OpenJDK12U-jdk_x64_mac_hotspot_12.0.1_12.tar.gz",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12.0.1_12.tar.gz",
- "size": 198112975
- },
- "project": "jdk",
- "updated_at": "2019-04-21T15:12:34Z"
- }
- ],
- "download_count": 1038669,
- "id": "MDc6UmVsZWFzZTE2ODg3NDU3",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12.0.1%2B12",
- "release_name": "jdk-12.0.1+12",
- "release_type": "ga",
- "timestamp": "2019-04-21T15:11:56Z",
- "updated_at": "2019-04-21T15:11:56Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 12,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12.0.1+12",
- "security": 1,
- "semver": "12.0.1+12"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 3136,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "985036459d4ef0867a3fe83b0bf87877d8e66a121c7b9c145bb97bd921aaf3f1",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12%2B33/OpenJDK12U-jdk_x64_mac_hotspot_12_33.tar.gz.sha256.txt",
- "download_count": 1905,
- "link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12%2B33/OpenJDK12U-jdk_x64_mac_hotspot_12_33.tar.gz",
- "name": "OpenJDK12U-jdk_x64_mac_hotspot_12_33.tar.gz",
- "size": 198099074
- },
- "project": "jdk",
- "updated_at": "2019-03-22T12:09:13Z"
- }
- ],
- "download_count": 757289,
- "id": "MDc6UmVsZWFzZTE2MjgyMjM2",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/tag/jdk-12%2B33",
- "release_name": "jdk-12+33",
- "release_type": "ga",
- "timestamp": "2019-03-22T12:08:43Z",
- "updated_at": "2019-03-22T12:08:43Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 33,
- "major": 12,
- "minor": 0,
- "openjdk_version": "12+33",
- "security": 0,
- "semver": "12.0.0+33"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 75576,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "ee7c98c9d79689aca6e717965747b8bf4eec5413e89d5444cc2bd6dbd59e3811",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz.sha256.txt",
- "download_count": 17426,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz",
- "size": 186160219
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.10+9_adopt",
- "updated_at": "2021-01-22T14:16:47Z"
- }
- ],
- "download_count": 636180,
- "id": "MDc6UmVsZWFzZTM2NzcwNDUy.hAVJRiZZTufG+w==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.10%2B9",
- "release_name": "jdk-11.0.10+9",
- "release_type": "ga",
- "timestamp": "2021-01-22T14:15:12Z",
- "updated_at": "2021-01-22T14:15:12Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 9,
- "major": 11,
- "minor": 0,
- "openjdk_version": "11.0.10+9",
- "security": 10,
- "semver": "11.0.10+9"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 108441,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "96bc469f9b02a3b84382a0685b0bd7935e1ad1bd82a0aab9befb5b42a17cbd77",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9.1_1.tar.gz.sha256.txt",
- "download_count": 22211,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9.1_1.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9.1_1.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.9.1_1.tar.gz",
- "size": 185368626
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.9.1+1_adopt",
- "updated_at": "2020-11-12T14:10:45Z"
- }
- ],
- "download_count": 815676,
- "id": "MDc6UmVsZWFzZTMzODU4MDE1.94IbKUd3vvhzsA==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.9.1%2B1",
- "release_name": "jdk-11.0.9.1+1",
- "release_type": "ga",
- "timestamp": "2020-11-12T14:08:55Z",
- "updated_at": "2020-11-12T14:08:55Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 1,
- "major": 11,
- "minor": 0,
- "openjdk_version": "11.0.9.1+1",
- "patch": 1,
- "security": 9,
- "semver": "11.0.9+101"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 45450,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "7b21961ffb2649e572721a0dfad64169b490e987937b661cb4e13a594c21e764",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11.1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz.sha256.txt",
- "download_count": 11117,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11.1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11.1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz",
- "size": 186006796
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.9+11_adopt",
- "updated_at": "2020-10-25T14:43:54Z"
- }
- ],
- "download_count": 423635,
- "id": "MDc6UmVsZWFzZTMzMDI4MDcz.dRvNNRwJCgY3Xw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.9%2B11.1",
- "release_name": "jdk-11.0.9+11.1",
- "release_type": "ga",
- "timestamp": "2020-10-25T13:31:15Z",
- "updated_at": "2020-10-25T13:31:15Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "adopt_build_number": 1,
- "build": 11,
- "major": 11,
- "minor": 0,
- "openjdk_version": "11.0.9+11",
- "security": 9,
- "semver": "11.0.9+11.1"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 2456,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "e84b00d74f08f059829bbf121c8423dc37ff65135968c1fcda5839600be4f542",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz.sha256.txt",
- "download_count": 1046,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11/OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.9_11.tar.gz",
- "size": 185532704
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.9+11_adopt",
- "updated_at": "2020-10-25T13:28:33Z"
- }
- ],
- "download_count": 359580,
- "id": "MDc6UmVsZWFzZTMyOTk4MzM5.6h9TT9pzYTK2Kg==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.9%2B11",
- "release_name": "jdk-11.0.9+11",
- "release_type": "ga",
- "timestamp": "2020-10-23T20:52:14Z",
- "updated_at": "2020-10-23T20:52:14Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 11,
- "major": 11,
- "minor": 0,
- "openjdk_version": "11.0.9+11",
- "security": 9,
- "semver": "11.0.9+11"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 149393,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "4a8dadd58cdc32c7e59978971d56aec610be7ee0ddf0dc1d137bb8b78456499f",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz.sha256.txt",
- "download_count": 40158,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz",
- "size": 185054456
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.8+10_adopt",
- "updated_at": "2020-07-15T14:30:51Z"
- }
- ],
- "download_count": 1968658,
- "id": "MDc6UmVsZWFzZTI4NTg5Nzcz.pCNBA7G9E1o7pw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.8%2B10",
- "release_name": "jdk-11.0.8+10",
- "release_type": "ga",
- "timestamp": "2020-07-15T14:29:27Z",
- "updated_at": "2020-07-15T14:29:27Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 10,
- "major": 11,
- "minor": 0,
- "openjdk_version": "11.0.8+10",
- "security": 8,
- "semver": "11.0.8+10"
- }
- },
- {
- "binaries": [],
- "download_count": 1968658,
- "id": "MDc6UmVsZWFzZTI4NTg5Nzcz.pCNBA7G9E1o7pw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.8%2B10",
- "release_name": "jdk-11.0.8+10",
- "release_type": "ga",
- "timestamp": "2020-07-15T14:29:27Z",
- "updated_at": "2020-07-15T14:29:27Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 10,
- "major": 9,
- "minor": 0,
- "openjdk_version": "9.0.8+10",
- "security": 8,
- "semver": "9.0.8+10"
- }
- },
- {
- "binaries": [
- {
- "architecture": "x64",
- "download_count": 149393,
- "heap_size": "normal",
- "image_type": "jdk",
- "jvm_impl": "hotspot",
- "os": "mac",
- "package": {
- "checksum": "4a8dadd58cdc32c7e59978971d56aec610be7ee0ddf0dc1d137bb8b78456499f",
- "checksum_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz.sha256.txt",
- "download_count": 40158,
- "link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz",
- "metadata_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz.json",
- "name": "OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz",
- "size": 185054456
- },
- "project": "jdk",
- "scm_ref": "jdk-11.0.8+10_adopt",
- "updated_at": "2020-07-15T14:30:51Z"
- }
- ],
- "download_count": 1968658,
- "id": "MDc6UmVsZWFzZTI4NTg5Nzcz.pCNBA7G9E1o7pw==",
- "release_link": "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.8%2B10",
- "release_name": "jdk-11.0.8+10",
- "release_type": "ga",
- "timestamp": "2020-07-15T14:29:27Z",
- "updated_at": "2020-07-15T14:29:27Z",
- "vendor": "adoptopenjdk",
- "version_data": {
- "build": 10,
- "major": 9,
- "minor": 0,
- "openjdk_version": "9.0.8+10",
- "security": 8,
- "semver": "9.0.7+10"
- }
- }
-]
\ No newline at end of file
diff --git a/__tests__/data/jetbrains.json b/__tests__/data/jetbrains.json
new file mode 100644
index 000000000..535bb5cba
--- /dev/null
+++ b/__tests__/data/jetbrains.json
@@ -0,0 +1,1454 @@
+[
+ {
+ "tag_name": "jbr-release-21.0.3b465.3",
+ "semver": "21.0.3",
+ "build": "465.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b465.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b458.1",
+ "semver": "21.0.3",
+ "build": "458.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b458.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b453.2",
+ "semver": "21.0.3",
+ "build": "453.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b453.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.11b1207.24",
+ "semver": "17.0.11",
+ "build": "1207.24",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.11-linux-x64-b1207.24.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.11b1207.23",
+ "semver": "17.0.11",
+ "build": "1207.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.11-linux-x64-b1207.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b446.1",
+ "semver": "21.0.3",
+ "build": "446.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b446.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.14",
+ "semver": "17.0.10",
+ "build": "1207.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b829.27",
+ "semver": "17.0.10",
+ "build": "829.27",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b829.27.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.23",
+ "semver": "17.0.10",
+ "build": "1087.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.12",
+ "semver": "17.0.10",
+ "build": "1207.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.12.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.21",
+ "semver": "17.0.10",
+ "build": "1087.21",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.21.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.6",
+ "semver": "17.0.10",
+ "build": "1207.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b375.1",
+ "semver": "21.0.2",
+ "build": "375.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b375.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.1",
+ "semver": "17.0.10",
+ "build": "1207.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1186.1",
+ "semver": "17.0.10",
+ "build": "1186.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1186.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1171.14",
+ "semver": "17.0.10",
+ "build": "1171.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1171.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b829.26",
+ "semver": "17.0.10",
+ "build": "829.26",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b829.26.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b346.3",
+ "semver": "21.0.2",
+ "build": "346.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b346.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1000.48",
+ "semver": "17.0.10",
+ "build": "1000.48",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1000.48.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b341.4",
+ "semver": "21.0.2",
+ "build": "341.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b341.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.17",
+ "semver": "17.0.10",
+ "build": "1087.17",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.17.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1166.2",
+ "semver": "17.0.9",
+ "build": "1166.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1166.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1162.7",
+ "semver": "17.0.9",
+ "build": "1162.7",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1162.7.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.11",
+ "semver": "17.0.9",
+ "build": "1087.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.9",
+ "semver": "17.0.9",
+ "build": "1087.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.9.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.7",
+ "semver": "17.0.9",
+ "build": "1087.7",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.7.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1000.47",
+ "semver": "17.0.9",
+ "build": "1000.47",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1000.47.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1000.46",
+ "semver": "17.0.9",
+ "build": "1000.46",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1000.46.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.3",
+ "semver": "17.0.9",
+ "build": "1087.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1080.1",
+ "semver": "17.0.8.1",
+ "build": "1080.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1080.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1072.1",
+ "semver": "17.0.8.1",
+ "build": "1072.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1072.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1070.2",
+ "semver": "17.0.8.1",
+ "build": "1070.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1070.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1063.1",
+ "semver": "17.0.8.1",
+ "build": "1063.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1063.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1000.32",
+ "semver": "17.0.8.1",
+ "build": "1000.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1000.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1059.3",
+ "semver": "17.0.8.1",
+ "build": "1059.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1059.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8b1000.22",
+ "semver": "17.0.8",
+ "build": "1000.22",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8-linux-x64-b1000.22.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8b1000.8",
+ "semver": "17.0.8",
+ "build": "1000.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8-linux-x64-b1000.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.6",
+ "semver": "17.0.7",
+ "build": "1000.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.5",
+ "semver": "17.0.7",
+ "build": "1000.5",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.5.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.2",
+ "semver": "17.0.7",
+ "build": "1000.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b985.2",
+ "semver": "17.0.7",
+ "build": "985.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b985.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b979.4",
+ "semver": "17.0.7",
+ "build": "979.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b979.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b829.16",
+ "semver": "17.0.7",
+ "build": "829.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b829.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b966.2",
+ "semver": "17.0.7",
+ "build": "966.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b966.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b964.1",
+ "semver": "17.0.7",
+ "build": "964.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b964.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b829.14",
+ "semver": "17.0.7",
+ "build": "829.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b829.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b953.1",
+ "semver": "17.0.7",
+ "build": "953.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b953.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.9",
+ "semver": "17.0.6",
+ "build": "829.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.9.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b469.82",
+ "semver": "17.0.6",
+ "build": "469.82",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b469.82.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.5",
+ "semver": "17.0.6",
+ "build": "829.5",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.5.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b653.34",
+ "semver": "17.0.6",
+ "build": "653.34",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b653.34.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.4",
+ "semver": "17.0.6",
+ "build": "829.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.1",
+ "semver": "17.0.6",
+ "build": "829.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b653.32",
+ "semver": "17.0.6",
+ "build": "653.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b653.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b802.4",
+ "semver": "17.0.6",
+ "build": "802.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b802.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b802.1",
+ "semver": "17.0.6",
+ "build": "802.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b802.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b785.1",
+ "semver": "17.0.6",
+ "build": "785.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b785.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b779.1",
+ "semver": "17.0.6",
+ "build": "779.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b779.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b762.1",
+ "semver": "17.0.5",
+ "build": "762.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b762.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.25",
+ "semver": "17.0.5",
+ "build": "653.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b759.1",
+ "semver": "17.0.5",
+ "build": "759.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b759.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.23",
+ "semver": "17.0.5",
+ "build": "653.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.14",
+ "semver": "17.0.5",
+ "build": "653.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b469.71",
+ "semver": "17.0.5",
+ "build": "469.71",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b469.71.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_16b2043.64",
+ "semver": "11.0.16",
+ "build": "2043.64",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_16-linux-x64-b2043.64.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.6",
+ "semver": "17.0.5",
+ "build": "653.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b469.67",
+ "semver": "17.0.5",
+ "build": "469.67",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b469.67.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b653.1",
+ "semver": "17.0.4.1",
+ "build": "653.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b653.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b646.8",
+ "semver": "17.0.4.1",
+ "build": "646.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b646.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b629.2",
+ "semver": "17.0.4.1",
+ "build": "629.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b629.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b617.2",
+ "semver": "17.0.4.1",
+ "build": "617.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b617.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b469.62",
+ "semver": "17.0.4.1",
+ "build": "469.62",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b469.62.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b597.1",
+ "semver": "17.0.4.1",
+ "build": "597.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b597.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4b469.53",
+ "semver": "17.0.4",
+ "build": "469.53",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4-linux-x64-b469.53.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4b469.44",
+ "semver": "17.0.4",
+ "build": "469.44",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4-linux-x64-b469.44.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.3b469.37",
+ "semver": "17.0.3",
+ "build": "469.37",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.37.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.32",
+ "semver": "17.0.3",
+ "build": "469.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.30",
+ "semver": "17.0.3",
+ "build": "469.30",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.30.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.19",
+ "semver": "17.0.3",
+ "build": "469.19",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.19.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b498.3",
+ "semver": "17.0.3",
+ "build": "498.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b498.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.16",
+ "semver": "17.0.3",
+ "build": "469.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.12",
+ "semver": "17.0.3",
+ "build": "469.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.12.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.3",
+ "semver": "17.0.3",
+ "build": "469.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b463.3",
+ "semver": "17.0.3",
+ "build": "463.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b463.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b423.10",
+ "semver": "17.0.3",
+ "build": "423.10",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b423.10.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_15b2043.56",
+ "semver": "11.0.15",
+ "build": "2043.56",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_15-linux-x64-b2043.56.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.45",
+ "semver": "11.0.14.1",
+ "build": "2043.45",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_14_1-linux-x64-b2043.45.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.2b396.4",
+ "semver": "17.0.2",
+ "build": "396.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.2-linux-x64-b396.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.25",
+ "semver": "11.0.14.1",
+ "build": "2043.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.22",
+ "semver": "11.0.14.1",
+ "build": "2043.22",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.22.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.17",
+ "semver": "11.0.14.1",
+ "build": "2043.17",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.17.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.14",
+ "semver": "11.0.14.1",
+ "build": "2043.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.11",
+ "semver": "11.0.14.1",
+ "build": "2043.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b2043.2",
+ "semver": "11.0.14",
+ "build": "2043.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b2043.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b1751.46",
+ "semver": "11.0.14.1",
+ "build": "1751.46",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b1751.46.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b1993.2",
+ "semver": "11.0.14",
+ "build": "1993.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b1993.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_2b315.1",
+ "semver": "17.0.2",
+ "build": "315.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_2-linux-x64-b315.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b1982.1",
+ "semver": "11.0.14",
+ "build": "1982.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b1982.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1890.3",
+ "semver": "11.0.13",
+ "build": "1890.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1890.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.25",
+ "semver": "11.0.13",
+ "build": "1751.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.24",
+ "semver": "11.0.13",
+ "build": "1751.24",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.24.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.21",
+ "semver": "11.0.13",
+ "build": "1751.21",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.21.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_1b164.8",
+ "semver": "17.0.1",
+ "build": "164.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_1-linux-x64-b164.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.19",
+ "semver": "11.0.13",
+ "build": "1751.19",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.19.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_13-b1504.49",
+ "semver": "11.0.13",
+ "build": "1504.49",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1504.49.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_1b164.4",
+ "semver": "17.0.1",
+ "build": "164.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_1-linux-x64-b164.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.16",
+ "semver": "11.0.13",
+ "build": "1751.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1751.11",
+ "semver": "11.0.12",
+ "build": "1751.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1751.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1729.1",
+ "semver": "11.0.12",
+ "build": "1729.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1729.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1715.4",
+ "semver": "11.0.12",
+ "build": "1715.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1715.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1692.9",
+ "semver": "11.0.12",
+ "build": "1692.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1692.9.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.37",
+ "semver": "11.0.12",
+ "build": "1504.37",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.37.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1665.1",
+ "semver": "11.0.12",
+ "build": "1665.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1665.1.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.28",
+ "semver": "11.0.12",
+ "build": "1504.28",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.28.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.27",
+ "semver": "11.0.12",
+ "build": "1504.27",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.27.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.16",
+ "semver": "11.0.11",
+ "build": "1504.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.16.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.13",
+ "semver": "11.0.11",
+ "build": "1504.13",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.13.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.12",
+ "semver": "11.0.11",
+ "build": "1504.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.12.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1542.1",
+ "semver": "11.0.11",
+ "build": "1542.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1542.1.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.8",
+ "semver": "11.0.11",
+ "build": "1504.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.8.tar.gz"
+ },
+ {
+ "tag_name": "11_0_11b1536.2",
+ "semver": "11.0.11",
+ "build": "1536.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1536.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b465.3",
+ "semver": "21.0.3",
+ "build": "465.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b465.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b458.1",
+ "semver": "21.0.3",
+ "build": "458.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b458.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b453.2",
+ "semver": "21.0.3",
+ "build": "453.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b453.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.11b1207.24",
+ "semver": "17.0.11",
+ "build": "1207.24",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.11-linux-x64-b1207.24.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.11b1207.23",
+ "semver": "17.0.11",
+ "build": "1207.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.11-linux-x64-b1207.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.3b446.1",
+ "semver": "21.0.3",
+ "build": "446.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.3-linux-x64-b446.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.14",
+ "semver": "17.0.10",
+ "build": "1207.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b829.27",
+ "semver": "17.0.10",
+ "build": "829.27",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b829.27.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.23",
+ "semver": "17.0.10",
+ "build": "1087.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.12",
+ "semver": "17.0.10",
+ "build": "1207.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.12.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.21",
+ "semver": "17.0.10",
+ "build": "1087.21",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.21.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.6",
+ "semver": "17.0.10",
+ "build": "1207.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b375.1",
+ "semver": "21.0.2",
+ "build": "375.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b375.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1207.1",
+ "semver": "17.0.10",
+ "build": "1207.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1207.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1186.1",
+ "semver": "17.0.10",
+ "build": "1186.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1186.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1171.14",
+ "semver": "17.0.10",
+ "build": "1171.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1171.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b829.26",
+ "semver": "17.0.10",
+ "build": "829.26",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b829.26.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b346.3",
+ "semver": "21.0.2",
+ "build": "346.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b346.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1000.48",
+ "semver": "17.0.10",
+ "build": "1000.48",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1000.48.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-21.0.2b341.4",
+ "semver": "21.0.2",
+ "build": "341.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.2-linux-x64-b341.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.10b1087.17",
+ "semver": "17.0.10",
+ "build": "1087.17",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.10-linux-x64-b1087.17.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1166.2",
+ "semver": "17.0.9",
+ "build": "1166.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1166.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1162.7",
+ "semver": "17.0.9",
+ "build": "1162.7",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1162.7.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.11",
+ "semver": "17.0.9",
+ "build": "1087.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.9",
+ "semver": "17.0.9",
+ "build": "1087.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.9.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.7",
+ "semver": "17.0.9",
+ "build": "1087.7",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.7.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1000.47",
+ "semver": "17.0.9",
+ "build": "1000.47",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1000.47.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1000.46",
+ "semver": "17.0.9",
+ "build": "1000.46",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1000.46.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.9b1087.3",
+ "semver": "17.0.9",
+ "build": "1087.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.9-linux-x64-b1087.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1080.1",
+ "semver": "17.0.8.1",
+ "build": "1080.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1080.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1072.1",
+ "semver": "17.0.8.1",
+ "build": "1072.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1072.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1070.2",
+ "semver": "17.0.8.1",
+ "build": "1070.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1070.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1063.1",
+ "semver": "17.0.8.1",
+ "build": "1063.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1063.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1000.32",
+ "semver": "17.0.8.1",
+ "build": "1000.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1000.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8.1b1059.3",
+ "semver": "17.0.8.1",
+ "build": "1059.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8.1-linux-x64-b1059.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8b1000.22",
+ "semver": "17.0.8",
+ "build": "1000.22",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8-linux-x64-b1000.22.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.8b1000.8",
+ "semver": "17.0.8",
+ "build": "1000.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.8-linux-x64-b1000.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.6",
+ "semver": "17.0.7",
+ "build": "1000.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.5",
+ "semver": "17.0.7",
+ "build": "1000.5",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.5.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b1000.2",
+ "semver": "17.0.7",
+ "build": "1000.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b1000.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b985.2",
+ "semver": "17.0.7",
+ "build": "985.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b985.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b979.4",
+ "semver": "17.0.7",
+ "build": "979.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b979.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b829.16",
+ "semver": "17.0.7",
+ "build": "829.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b829.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b966.2",
+ "semver": "17.0.7",
+ "build": "966.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b966.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b964.1",
+ "semver": "17.0.7",
+ "build": "964.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b964.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b829.14",
+ "semver": "17.0.7",
+ "build": "829.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b829.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.7b953.1",
+ "semver": "17.0.7",
+ "build": "953.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.7-linux-x64-b953.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.9",
+ "semver": "17.0.6",
+ "build": "829.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.9.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b469.82",
+ "semver": "17.0.6",
+ "build": "469.82",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b469.82.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.5",
+ "semver": "17.0.6",
+ "build": "829.5",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.5.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b653.34",
+ "semver": "17.0.6",
+ "build": "653.34",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b653.34.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.4",
+ "semver": "17.0.6",
+ "build": "829.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b829.1",
+ "semver": "17.0.6",
+ "build": "829.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b829.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b653.32",
+ "semver": "17.0.6",
+ "build": "653.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b653.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b802.4",
+ "semver": "17.0.6",
+ "build": "802.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b802.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b802.1",
+ "semver": "17.0.6",
+ "build": "802.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b802.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b785.1",
+ "semver": "17.0.6",
+ "build": "785.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b785.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.6b779.1",
+ "semver": "17.0.6",
+ "build": "779.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.6-linux-x64-b779.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b762.1",
+ "semver": "17.0.5",
+ "build": "762.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b762.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.25",
+ "semver": "17.0.5",
+ "build": "653.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b759.1",
+ "semver": "17.0.5",
+ "build": "759.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b759.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.23",
+ "semver": "17.0.5",
+ "build": "653.23",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.23.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.14",
+ "semver": "17.0.5",
+ "build": "653.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b469.71",
+ "semver": "17.0.5",
+ "build": "469.71",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b469.71.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_16b2043.64",
+ "semver": "11.0.16",
+ "build": "2043.64",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_16-linux-x64-b2043.64.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b653.6",
+ "semver": "17.0.5",
+ "build": "653.6",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b653.6.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.5b469.67",
+ "semver": "17.0.5",
+ "build": "469.67",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.5-linux-x64-b469.67.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b653.1",
+ "semver": "17.0.4.1",
+ "build": "653.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b653.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b646.8",
+ "semver": "17.0.4.1",
+ "build": "646.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b646.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b629.2",
+ "semver": "17.0.4.1",
+ "build": "629.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b629.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b617.2",
+ "semver": "17.0.4.1",
+ "build": "617.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b617.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b469.62",
+ "semver": "17.0.4.1",
+ "build": "469.62",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b469.62.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4.1b597.1",
+ "semver": "17.0.4.1",
+ "build": "597.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4.1-linux-x64-b597.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4b469.53",
+ "semver": "17.0.4",
+ "build": "469.53",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4-linux-x64-b469.53.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.4b469.44",
+ "semver": "17.0.4",
+ "build": "469.44",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.4-linux-x64-b469.44.tar.gz"
+ },
+ {
+ "tag_name": "jbr-release-17.0.3b469.37",
+ "semver": "17.0.3",
+ "build": "469.37",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.37.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.32",
+ "semver": "17.0.3",
+ "build": "469.32",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.32.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.30",
+ "semver": "17.0.3",
+ "build": "469.30",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.30.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.19",
+ "semver": "17.0.3",
+ "build": "469.19",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.19.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b498.3",
+ "semver": "17.0.3",
+ "build": "498.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b498.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.16",
+ "semver": "17.0.3",
+ "build": "469.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.12",
+ "semver": "17.0.3",
+ "build": "469.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.12.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b469.3",
+ "semver": "17.0.3",
+ "build": "469.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b469.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b463.3",
+ "semver": "17.0.3",
+ "build": "463.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b463.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.3b423.10",
+ "semver": "17.0.3",
+ "build": "423.10",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.3-linux-x64-b423.10.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_15b2043.56",
+ "semver": "11.0.15",
+ "build": "2043.56",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_15-linux-x64-b2043.56.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.45",
+ "semver": "11.0.14.1",
+ "build": "2043.45",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_nomod-11_0_14_1-linux-x64-b2043.45.tar.gz"
+ },
+ {
+ "tag_name": "jbr17.0.2b396.4",
+ "semver": "17.0.2",
+ "build": "396.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17.0.2-linux-x64-b396.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.25",
+ "semver": "11.0.14.1",
+ "build": "2043.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.22",
+ "semver": "11.0.14.1",
+ "build": "2043.22",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.22.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.17",
+ "semver": "11.0.14.1",
+ "build": "2043.17",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.17.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.14",
+ "semver": "11.0.14.1",
+ "build": "2043.14",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.14.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b2043.11",
+ "semver": "11.0.14.1",
+ "build": "2043.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b2043.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b2043.2",
+ "semver": "11.0.14",
+ "build": "2043.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b2043.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14_1b1751.46",
+ "semver": "11.0.14.1",
+ "build": "1751.46",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14_1-linux-x64-b1751.46.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b1993.2",
+ "semver": "11.0.14",
+ "build": "1993.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b1993.2.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_2b315.1",
+ "semver": "17.0.2",
+ "build": "315.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_2-linux-x64-b315.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_14b1982.1",
+ "semver": "11.0.14",
+ "build": "1982.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_14-linux-x64-b1982.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1890.3",
+ "semver": "11.0.13",
+ "build": "1890.3",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1890.3.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.25",
+ "semver": "11.0.13",
+ "build": "1751.25",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.25.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.24",
+ "semver": "11.0.13",
+ "build": "1751.24",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.24.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.21",
+ "semver": "11.0.13",
+ "build": "1751.21",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.21.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_1b164.8",
+ "semver": "17.0.1",
+ "build": "164.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_1-linux-x64-b164.8.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.19",
+ "semver": "11.0.13",
+ "build": "1751.19",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.19.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_13-b1504.49",
+ "semver": "11.0.13",
+ "build": "1504.49",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1504.49.tar.gz"
+ },
+ {
+ "tag_name": "jbr17_0_1b164.4",
+ "semver": "17.0.1",
+ "build": "164.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-17_0_1-linux-x64-b164.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_13b1751.16",
+ "semver": "11.0.13",
+ "build": "1751.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_13-linux-x64-b1751.16.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1751.11",
+ "semver": "11.0.12",
+ "build": "1751.11",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1751.11.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1729.1",
+ "semver": "11.0.12",
+ "build": "1729.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1729.1.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1715.4",
+ "semver": "11.0.12",
+ "build": "1715.4",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1715.4.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1692.9",
+ "semver": "11.0.12",
+ "build": "1692.9",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1692.9.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.37",
+ "semver": "11.0.12",
+ "build": "1504.37",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.37.tar.gz"
+ },
+ {
+ "tag_name": "jbr11_0_12b1665.1",
+ "semver": "11.0.12",
+ "build": "1665.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1665.1.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.28",
+ "semver": "11.0.12",
+ "build": "1504.28",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.28.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_12-b1504.27",
+ "semver": "11.0.12",
+ "build": "1504.27",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_12-linux-x64-b1504.27.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.16",
+ "semver": "11.0.11",
+ "build": "1504.16",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.16.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.13",
+ "semver": "11.0.11",
+ "build": "1504.13",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.13.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.12",
+ "semver": "11.0.11",
+ "build": "1504.12",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.12.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1542.1",
+ "semver": "11.0.11",
+ "build": "1542.1",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1542.1.tar.gz"
+ },
+ {
+ "tag_name": "jb11_0_11-b1504.8",
+ "semver": "11.0.11",
+ "build": "1504.8",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1504.8.tar.gz"
+ },
+ {
+ "tag_name": "11_0_11b1536.2",
+ "semver": "11.0.11",
+ "build": "1536.2",
+ "url": "https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-11_0_11-linux-x64-b1536.2.tar.gz"
+ }
+]
\ No newline at end of file
diff --git a/__tests__/data/kona.json b/__tests__/data/kona.json
new file mode 100644
index 000000000..7dc24c38d
--- /dev/null
+++ b/__tests__/data/kona.json
@@ -0,0 +1,202 @@
+{
+ "8": [
+ {
+ "version": "8.0.20",
+ "jdkVersion": "8u432",
+ "latest": true,
+ "baseUrl": "https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/",
+ "files": [
+ {
+ "os": "linux",
+ "arch": "aarch64",
+ "filename": "TencentKona8.0.20.b1_jdk_linux-aarch64_8u432.tar.gz",
+ "checksum": "8e6ab38b17f98d7ba727037cb49bbd174f3103a6ddacafb1fb7c0231006a80a7"
+ },
+ {
+ "os": "linux",
+ "arch": "x86_64",
+ "filename": "TencentKona8.0.20.b1_jdk_linux-x86_64_8u432.tar.gz",
+ "checksum": "384cdb36b38993f4b7292682a5dfd8d5d33ba7bdbca2d95018d1341c792d2823"
+ },
+ {
+ "os": "macos",
+ "arch": "aarch64",
+ "filename": "TencentKona8.0.20.b1_jdk_macosx-aarch64_8u432_notarized.tar.gz",
+ "checksum": "829c46691a4b519f14fedfcdca32a94d7793d3570c4a51b3a5072cc394619f25"
+ },
+ {
+ "os": "macos",
+ "arch": "x86_64",
+ "filename": "TencentKona8.0.20.b1_jdk_macosx-x86_64_8u432_notarized.tar.gz",
+ "checksum": ""
+ },
+ {
+ "os": "windows",
+ "arch": "x86_64",
+ "filename": "TencentKona8.0.20.b1_jdk_windows-x86_64_8u432_signed.zip",
+ "checksum": "339646817254dbcb5c17904807bbfdeafaa8e4bac9f2aae25434870cdeaba296"
+ }
+ ]
+ }
+ ],
+ "11": [
+ {
+ "version": "11.0.25",
+ "jdkVersion": "11.0.25",
+ "latest": true,
+ "baseUrl": "https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/",
+ "files": [
+ {
+ "os": "linux",
+ "arch": "aarch64",
+ "filename": "TencentKona-11.0.25.b1-jdk_linux-aarch64.tar.gz",
+ "checksum": "887ca5eeb675dd9b9d22833a8b0c1031ee1a031227d6cf2d8c1920cc585d2b71"
+ },
+ {
+ "os": "linux",
+ "arch": "x86_64",
+ "filename": "TencentKona-11.0.25.b1-jdk_linux-x86_64.tar.gz",
+ "checksum": "6642d7cccf98f33b3ec55cdbf77979c614f0d3cbbd282e8d0df52233edc52f9a"
+ },
+ {
+ "os": "macos",
+ "arch": "aarch64",
+ "filename": "TencentKona-11.0.25.b1_jdk_macosx-aarch64_notarized.tar.gz",
+ "checksum": "8f07242d3191a35c3b2fca1122f315518c7312f0155e98ac7ae39ea083f93e21"
+ },
+ {
+ "os": "macos",
+ "arch": "x86_64",
+ "filename": "TencentKona-11.0.25.b1_jdk_macosx-x86_64_notarized.tar.gz",
+ "checksum": "0832b93d8d8122cb72db85321ddd85c9a6086e0f28327733fc2da3c0ecc9c455"
+ },
+ {
+ "os": "windows",
+ "arch": "x86_64",
+ "filename": "TencentKona-11.0.25.b1_jdk_windows-x86_64_signed.zip",
+ "checksum": "05c470c5da4b3bc1844117f611ecd241d3ae9e5d01c17ffafffde0f23825aad7"
+ }
+ ]
+ }
+ ],
+ "17": [
+ {
+ "version": "17.0.13",
+ "jdkVersion": "17.0.13",
+ "latest": true,
+ "baseUrl": "https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/",
+ "files": [
+ {
+ "os": "linux",
+ "arch": "aarch64",
+ "filename": "TencentKona-17.0.13.b1-jdk_linux-aarch64.tar.gz",
+ "checksum": "372411dff5b42f6e419f1dd40772d98141a15c3d180ed1af6f2b49bdbbd32d52"
+ },
+ {
+ "os": "linux",
+ "arch": "x86_64",
+ "filename": "TencentKona-17.0.13.b1-jdk_linux-x86_64.tar.gz",
+ "checksum": "b54bb023d1187737b23ca34d0857d2d40822b14e38d28c7948c8ff6b5927e523"
+ },
+ {
+ "os": "macos",
+ "arch": "aarch64",
+ "filename": "TencentKona-17.0.13.b1_jdk_macosx-aarch64_notarized.tar.gz",
+ "checksum": "22f5d296c407fc137e6af9ce275e662346ca82f1a5acfc407247efd8cedf5256"
+ },
+ {
+ "os": "macos",
+ "arch": "x86_64",
+ "filename": "TencentKona-17.0.13.b1_jdk_macosx-x86_64_notarized.tar.gz",
+ "checksum": "87ace41ac9718f2a9512b24bad0f735bc5ac61b8198b4cd5634199f124883b36"
+ },
+ {
+ "os": "windows",
+ "arch": "x86_64",
+ "filename": "TencentKona-17.0.13.b1_jdk_windows-x86_64_signed.zip",
+ "checksum": "616089018151e8e5daf8e88276063633a2cb28a718a2afce49bb8fc10541e83d"
+ }
+ ]
+ }
+ ],
+ "21": [
+ {
+ "version": "21.0.5",
+ "jdkVersion": "21.0.5",
+ "latest": true,
+ "baseUrl": "https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/",
+ "files": [
+ {
+ "os": "linux",
+ "arch": "aarch64",
+ "filename": "TencentKona-21.0.5.b1-jdk_linux-aarch64.tar.gz",
+ "checksum": "d8ca108147db3f19134d7aa995bac14e1fb3d124b0300a9a7893266a8f028104"
+ },
+ {
+ "os": "linux",
+ "arch": "x86_64",
+ "filename": "TencentKona-21.0.5.b1-jdk_linux-x86_64.tar.gz",
+ "checksum": "afae039d9666fadcb84940c5350b29cd061019b0cc43700f0bf0342320892adf"
+ },
+ {
+ "os": "macos",
+ "arch": "aarch64",
+ "filename": "TencentKona-21.0.5.b1_jdk_macosx-aarch64_notarized.tar.gz",
+ "checksum": "7621a218767bfbd3023b176dc6d9dd019677f8efec0d48a4eb2b2ed2b50bd1fb"
+ },
+ {
+ "os": "macos",
+ "arch": "x86_64",
+ "filename": "TencentKona-21.0.5.b1_jdk_macosx-x86_64_notarized.tar.gz",
+ "checksum": "6c54d46f979ad998b708f664c5aeeeef855660ef527d584a7c2930951cca9999"
+ },
+ {
+ "os": "windows",
+ "arch": "x86_64",
+ "filename": "TencentKona-21.0.5.b1_jdk_windows-x86_64_signed.zip",
+ "checksum": "ee1ee730fc5e02268d91b9df602b65122dad25b3d3898069331ebc8338005da1"
+ }
+ ]
+ }
+ ],
+ "25": [
+ {
+ "version": "25.0.3",
+ "jdkVersion": "25.0.3",
+ "latest": true,
+ "baseUrl": "https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/",
+ "files": [
+ {
+ "os": "linux",
+ "arch": "aarch64",
+ "filename": "TencentKona-25.0.3.b1-jdk_linux-aarch64.tar.gz",
+ "checksum": "2fb77e3ba9c00045ca497ea22210f18dae4bf7df4c87029f5abadd42a5daf8c7"
+ },
+ {
+ "os": "linux",
+ "arch": "x86_64",
+ "filename": "TencentKona-25.0.3.b1-jdk_linux-x86_64.tar.gz",
+ "checksum": "47445e6fad020e834055a705bb48fa3cd0727a2c57ad6f1c5206a45f4efb2d67"
+ },
+ {
+ "os": "macos",
+ "arch": "aarch64",
+ "filename": "TencentKona-25.0.3.b1_jdk_macosx-aarch64_notarized.tar.gz",
+ "checksum": "e29405eff95da412ed7ecc890e6ef5ebbfcd9ab334005b3d32d1700bbe4204d2"
+ },
+ {
+ "os": "macos",
+ "arch": "x86_64",
+ "filename": "TencentKona-25.0.3.b1_jdk_macosx-x86_64_notarized.tar.gz",
+ "checksum": "d512db5c079db16bd3a9c86d9cb979808994e90e4de29e17d27e5219fe488659"
+ },
+ {
+ "os": "windows",
+ "arch": "x86_64",
+ "filename": "TencentKona-25.0.3.b1_jdk_windows-x86_64_signed.zip",
+ "checksum": "865bce92ccbbca75115076e618a98baa1d0f30fcccdce954c0a22bee33d6ae83"
+ }
+ ]
+ }
+ ]
+}
diff --git a/__tests__/data/liberica-nik.json b/__tests__/data/liberica-nik.json
new file mode 100644
index 000000000..e5d920515
--- /dev/null
+++ b/__tests__/data/liberica-nik.json
@@ -0,0 +1,739 @@
+[
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+3-25.0.1+16/bellsoft-liberica-vm-openjdk25.0.1+16-25.0.1+3-linux-amd64.tar.gz",
+ "version": "25.0.1+3",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25.0.1+16",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.0+1-23+38/bellsoft-liberica-vm-openjdk23+38-24.1.0+1-linux-amd64.tar.gz",
+ "version": "24.1.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "23+38",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk11.0.15.1+2-21.3.2+2-linux-amd64.tar.gz",
+ "version": "21.3.2+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.15.1+2",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.0/bellsoft-liberica-vm-openjdk17.0.5+8-22.3.0+2-linux-amd64.tar.gz",
+ "version": "22.3.0+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.5+8",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.9+1-17.0.16+13/bellsoft-liberica-vm-openjdk17.0.16+13-23.0.9+1-linux-amd64.tar.gz",
+ "version": "23.0.9+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.16+13",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-openjdk17.0.7+7-23.0.0+1-src.tar.gz",
+ "version": "23.0.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.7+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.2+1-25.0.2+13/bellsoft-liberica-vm-openjdk25.0.2+13-25.0.2+1-linux-amd64.tar.gz",
+ "version": "25.0.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25.0.2+13",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.1+1-23.0.1+13/bellsoft-liberica-vm-openjdk23.0.1+13-24.1.1+1-linux-amd64.tar.gz",
+ "version": "24.1.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "23.0.1+13",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.12+1-17.0.19+12/bellsoft-liberica-vm-openjdk17.0.19+12-23.0.12+1-linux-amd64.tar.gz",
+ "version": "23.0.12+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.19+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.3+1-17.0.10+13/bellsoft-liberica-vm-openjdk17.0.10+13-23.0.3+1-linux-amd64.tar.gz",
+ "version": "23.0.3+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.10+13",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk11-21.3.2-src.tar.gz",
+ "version": "21.3.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.15+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk11.0.20+8-22.3.3+1-src.tar.gz",
+ "version": "22.3.3+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.20+8",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.8+1-17.0.15+10/bellsoft-liberica-vm-openjdk17.0.15+10-23.0.8+1-linux-amd64.tar.gz",
+ "version": "23.0.8+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.15+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk17.0.4-21.3.3-src.tar.gz",
+ "version": "21.3.3+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.4+8",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.7+1-21.0.7+9/bellsoft-liberica-vm-openjdk21.0.7+9-23.1.7+1-linux-amd64.tar.gz",
+ "version": "23.1.7+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.7+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.8+1-21.0.8+13/bellsoft-liberica-vm-openjdk21.0.8+13-23.1.8+1-linux-amd64.tar.gz",
+ "version": "23.1.8+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.8+13",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.0.0.2/bellsoft-liberica-vm-openjdk11-21.0.0.2-src.tar.gz",
+ "version": "21.0.0.2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.10+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.0.1/bellsoft-liberica-vm-openjdk17.0.8+7-23.0.1+1-linux-amd64.tar.gz",
+ "version": "23.0.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.8+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.0+1-22+37/bellsoft-liberica-vm-openjdk22+37-24.0.0+1-linux-amd64.tar.gz",
+ "version": "24.0.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "22+37",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.1.0/bellsoft-liberica-vm-openjdk17-22.1.0-src.tar.gz",
+ "version": "22.1.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.3+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.2+1-22.0.2+11/bellsoft-liberica-vm-openjdk22.0.2+11-24.0.2+1-linux-amd64.tar.gz",
+ "version": "24.0.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "22.0.2+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.0.1/bellsoft-liberica-vm-openjdk20.0.2+10-23.0.1+1-src.tar.gz",
+ "version": "23.0.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "20.0.2+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.1.0/bellsoft-liberica-vm-openjdk21+37-23.1.0+1-linux-amd64.tar.gz",
+ "version": "23.1.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21+37",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.4+3-21.0.4+9/bellsoft-liberica-vm-openjdk21.0.4+9-23.1.4+3-linux-amd64.tar.gz",
+ "version": "23.1.4+3",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.4+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk11.0.20.1+1-22.3.3+2-linux-amd64.tar.gz",
+ "version": "22.3.3+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.20.1+1",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.4+1-17.0.11+10/bellsoft-liberica-vm-openjdk17.0.11+10-23.0.4+1-linux-amd64.tar.gz",
+ "version": "23.0.4+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.11+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.2+1-23.0.2+9/bellsoft-liberica-vm-openjdk23.0.2+9-24.1.2+1-linux-amd64.tar.gz",
+ "version": "24.1.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "23.0.2+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.10+1-17.0.17+12/bellsoft-liberica-vm-openjdk17.0.17+12-23.0.10+1-linux-amd64.tar.gz",
+ "version": "23.0.10+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.17+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.1/bellsoft-liberica-vm-openjdk11.0.18+10-22.3.1+1-src.tar.gz",
+ "version": "22.3.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.18+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-openjdk17-22.0.0.2-src.tar.gz",
+ "version": "22.0.0.2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.2+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-openjdk11-22.0.0.2-linux-amd64.tar.gz",
+ "version": "22.0.0.2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.14.1+1",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+2-25.0.1+14/bellsoft-liberica-vm-openjdk25.0.1+14-25.0.1+2-linux-amd64.tar.gz",
+ "version": "25.0.1+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25.0.1+14",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk11.0.16-21.3.3-src.tar.gz",
+ "version": "21.3.3+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.16+8",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.5+1-21.0.5+11/bellsoft-liberica-vm-openjdk21.0.5+11-23.1.5+1-linux-amd64.tar.gz",
+ "version": "23.1.5+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.5+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.4/bellsoft-liberica-vm-openjdk17.0.9+11-22.3.4+1-linux-amd64.tar.gz",
+ "version": "22.3.4+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.9+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.0+1-25+37/bellsoft-liberica-vm-openjdk25+37-25.0.0+1-linux-amd64.tar.gz",
+ "version": "25.0.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25+37",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk17.0.8.1+1-22.3.3+2-linux-amd64.tar.gz",
+ "version": "22.3.3+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.8.1+1",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.3+1-21.0.3+10/bellsoft-liberica-vm-openjdk21.0.3+10-23.1.3+1-linux-amd64.tar.gz",
+ "version": "23.1.3+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.3+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.0+1-24+37/bellsoft-liberica-vm-openjdk24+37-24.2.0+1-linux-amd64.tar.gz",
+ "version": "24.2.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "24+37",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.1.1/bellsoft-liberica-vm-openjdk21.0.1+12-23.1.1+1-linux-amd64.tar.gz",
+ "version": "23.1.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.1+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk17.0.4.1-21.3.3-src.tar.gz",
+ "version": "21.3.3+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.4.1+1",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.11+2-21.0.11+12/bellsoft-liberica-vm-openjdk21.0.11+12-23.1.11+2-linux-amd64.tar.gz",
+ "version": "23.1.11+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.11+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.2/bellsoft-liberica-vm-openjdk11.0.19+7-22.3.2+1-src.tar.gz",
+ "version": "22.3.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.19+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.4/bellsoft-liberica-vm-openjdk11.0.21+10-22.3.4+1-src.tar.gz",
+ "version": "22.3.4+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.21+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.3+2-25.0.3+12/bellsoft-liberica-vm-openjdk25.0.3+12-25.0.3+2-linux-amd64.tar.gz",
+ "version": "25.0.3+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25.0.3+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk17.0.3.1+2-21.3.2+2-linux-amd64.tar.gz",
+ "version": "21.3.2+2",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.3.1+2",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.1+1-24.0.1+11/bellsoft-liberica-vm-openjdk24.0.1+11-24.2.1+1-linux-amd64.tar.gz",
+ "version": "24.2.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "24.0.1+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.2.0/bellsoft-liberica-vm-openjdk11.0.16.1+1-22.2.0+3-linux-amd64.tar.gz",
+ "version": "22.2.0+3",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.16.1+1",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.6+1-17.0.13+12/bellsoft-liberica-vm-openjdk17.0.13+12-23.0.6+1-linux-amd64.tar.gz",
+ "version": "23.0.6+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.13+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-openjdk20.0.1+10-23.0.0+1-linux-amd64.tar.gz",
+ "version": "23.0.0+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "20.0.1+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.10+1-21.0.10+11/bellsoft-liberica-vm-openjdk21.0.10+11-23.1.10+1-linux-amd64.tar.gz",
+ "version": "23.1.10+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.10+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/22.3.1/bellsoft-liberica-vm-openjdk17.0.6+10-22.3.1+1-src.tar.gz",
+ "version": "22.3.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.6+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.0/bellsoft-liberica-vm-openjdk17-21.3.0-src.tar.gz",
+ "version": "21.3.0",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.1+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.0/bellsoft-liberica-vm-openjdk11-21.3.0-src.tar.gz",
+ "version": "21.3.0",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.13+8",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.1+1-22.0.1+10/bellsoft-liberica-vm-openjdk22.0.1+10-24.0.1+1-linux-amd64.tar.gz",
+ "version": "24.0.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "22.0.1+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.7+1-17.0.14+10/bellsoft-liberica-vm-openjdk17.0.14+10-23.0.7+1-linux-amd64.tar.gz",
+ "version": "23.0.7+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.14+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.1.0/bellsoft-liberica-vm-openjdk11-21.1.0-src.tar.gz",
+ "version": "21.1.0",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.11+9",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.6+1-21.0.6+10/bellsoft-liberica-vm-openjdk21.0.6+10-23.1.6+1-linux-amd64.tar.gz",
+ "version": "23.1.6+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.6+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+1-25.0.1+12/bellsoft-liberica-vm-openjdk25.0.1+12-25.0.1+1-linux-amd64.tar.gz",
+ "version": "25.0.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "25.0.1+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.9+1-21.0.9+12/bellsoft-liberica-vm-openjdk21.0.9+12-23.1.9+1-linux-amd64.tar.gz",
+ "version": "23.1.9+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.9+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/22.3.5+1-11.0.22+12/bellsoft-liberica-vm-openjdk11.0.22+12-22.3.5+1-linux-amd64.tar.gz",
+ "version": "22.3.5+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.22+12",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.5+1-17.0.12+10/bellsoft-liberica-vm-openjdk17.0.12+10-23.0.5+1-linux-amd64.tar.gz",
+ "version": "23.0.5+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.12+10",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.3.3.1/bellsoft-liberica-vm-openjdk11.0.17+7-21.3.3.1+1-linux-amd64.tar.gz",
+ "version": "21.3.3.1+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.17+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://download.bell-sw.com/vm/21.2.0/bellsoft-liberica-vm-openjdk11-21.2.0-linux-amd64.tar.gz",
+ "version": "21.2.0",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "11.0.12+7",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.11+1-17.0.18+11/bellsoft-liberica-vm-openjdk17.0.18+11-23.0.11+1-linux-amd64.tar.gz",
+ "version": "23.0.11+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "17.0.18+11",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.2+1-21.0.2+14/bellsoft-liberica-vm-openjdk21.0.2+14-23.1.2+1-linux-amd64.tar.gz",
+ "version": "23.1.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "21.0.2+14",
+ "embedded": true
+ }
+ ]
+ },
+ {
+ "downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.2+1-24.0.2+13/bellsoft-liberica-vm-openjdk24.0.2+13-24.2.2+1-linux-amd64.tar.gz",
+ "version": "24.2.2+1",
+ "components": [
+ {
+ "component": "liberica",
+ "version": "24.0.2+13",
+ "embedded": true
+ }
+ ]
+ }
+]
diff --git a/__tests__/data/microsoft.json b/__tests__/data/microsoft.json
index 18e67d9d3..b67b9447d 100644
--- a/__tests__/data/microsoft.json
+++ b/__tests__/data/microsoft.json
@@ -1,4 +1,47 @@
[
+ {
+ "version": "25.0.0",
+ "stable": true,
+ "release_url": "https://aka.ms/download-jdk",
+ "files": [
+ {
+ "filename": "microsoft-jdk-25.0.0-macos-x64.tar.gz",
+ "arch": "x64",
+ "platform": "darwin",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-x64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-25.0.0-linux-x64.tar.gz",
+ "arch": "x64",
+ "platform": "linux",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-x64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-25.0.0-windows-x64.zip",
+ "arch": "x64",
+ "platform": "win32",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-x64.zip"
+ },
+ {
+ "filename": "microsoft-jdk-25.0.0-macos-aarch64.tar.gz",
+ "arch": "aarch64",
+ "platform": "darwin",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-aarch64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-25.0.0-linux-aarch64.tar.gz",
+ "arch": "aarch64",
+ "platform": "linux",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-aarch64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-25.0.0-windows-aarch64.zip",
+ "arch": "aarch64",
+ "platform": "win32",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-aarch64.zip"
+ }
+ ]
+ },
{
"version": "21.0.0",
"stable": true,
@@ -36,6 +79,49 @@
}
]
},
+ {
+ "version": "17.0.18",
+ "stable": true,
+ "release_url": "https://aka.ms/download-jdk",
+ "files": [
+ {
+ "filename": "microsoft-jdk-17.0.18-macos-x64.tar.gz",
+ "arch": "x64",
+ "platform": "darwin",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-macos-x64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-17.0.18-linux-x64.tar.gz",
+ "arch": "x64",
+ "platform": "linux",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-linux-x64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-17.0.18-windows-x64.zip",
+ "arch": "x64",
+ "platform": "win32",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-windows-x64.zip"
+ },
+ {
+ "filename": "microsoft-jdk-17.0.18-macos-aarch64.tar.gz",
+ "arch": "aarch64",
+ "platform": "darwin",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-macos-aarch64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-17.0.18-linux-aarch64.tar.gz",
+ "arch": "aarch64",
+ "platform": "linux",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-linux-aarch64.tar.gz"
+ },
+ {
+ "filename": "microsoft-jdk-17.0.18-windows-aarch64.zip",
+ "arch": "aarch64",
+ "platform": "win32",
+ "download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.18-windows-aarch64.zip"
+ }
+ ]
+ },
{
"version": "17.0.7",
"stable": true,
diff --git a/__tests__/data/redhat-package-details.json b/__tests__/data/redhat-package-details.json
new file mode 100644
index 000000000..5a954df45
--- /dev/null
+++ b/__tests__/data/redhat-package-details.json
@@ -0,0 +1,11 @@
+{
+ "result": [
+ {
+ "filename": "java-21-openjdk-21.0.8.0.9-1.portable.jdk.x86_64.tar.xz",
+ "direct_download_uri": "https://developers.redhat.com/content-gateway/file/pub/openjdk/java-21-openjdk-21.0.8.0.9-1.portable.jdk.x86_64.tar.xz",
+ "checksum": "91a6f3284cbded9de17f65985a4fca48dd4fd0aa295162178631c23ade335aad",
+ "checksum_type": "sha256"
+ }
+ ],
+ "message": ""
+}
diff --git a/__tests__/data/redhat-packages.json b/__tests__/data/redhat-packages.json
new file mode 100644
index 000000000..427551e32
--- /dev/null
+++ b/__tests__/data/redhat-packages.json
@@ -0,0 +1,71 @@
+{
+ "result": [
+ {
+ "id": "redhat-21.0.8-jdk-linux-x64",
+ "archive_type": "tar.xz",
+ "distribution": "redhat",
+ "java_version": "21.0.8+9",
+ "release_status": "ga",
+ "operating_system": "linux",
+ "architecture": "x64",
+ "package_type": "jdk",
+ "directly_downloadable": true
+ },
+ {
+ "id": "redhat-21.0.7-jdk-linux-x64",
+ "archive_type": "tar.xz",
+ "distribution": "redhat",
+ "java_version": "21.0.7+6",
+ "release_status": "ga",
+ "operating_system": "linux",
+ "architecture": "x64",
+ "package_type": "jdk",
+ "directly_downloadable": true
+ },
+ {
+ "id": "redhat-17.0.16-jdk-linux-x64",
+ "archive_type": "tar.xz",
+ "distribution": "redhat",
+ "java_version": "17.0.16+8",
+ "release_status": "ga",
+ "operating_system": "linux",
+ "architecture": "x64",
+ "package_type": "jdk",
+ "directly_downloadable": true
+ },
+ {
+ "id": "redhat-9-jdk-linux-x64",
+ "archive_type": "tar.xz",
+ "distribution": "redhat",
+ "java_version": "9+181",
+ "release_status": "ga",
+ "operating_system": "linux",
+ "architecture": "x64",
+ "package_type": "jdk",
+ "directly_downloadable": true
+ },
+ {
+ "id": "redhat-21.0.8-jre-linux-x64",
+ "archive_type": "tar.xz",
+ "distribution": "redhat",
+ "java_version": "21.0.8+9",
+ "release_status": "ga",
+ "operating_system": "linux",
+ "architecture": "x64",
+ "package_type": "jre",
+ "directly_downloadable": true
+ },
+ {
+ "id": "redhat-17.0.16-jdk-windows-x64",
+ "archive_type": "zip",
+ "distribution": "redhat",
+ "java_version": "17.0.16+8",
+ "release_status": "ga",
+ "operating_system": "windows",
+ "architecture": "x64",
+ "package_type": "jdk",
+ "directly_downloadable": true
+ }
+ ],
+ "message": "6 package(s) found"
+}
diff --git a/__tests__/data/sapmachine-release-classes.json b/__tests__/data/sapmachine-release-classes.json
new file mode 100644
index 000000000..79e88f6cd
--- /dev/null
+++ b/__tests__/data/sapmachine-release-classes.json
@@ -0,0 +1,73 @@
+{
+ "25": {
+ "lts": "false",
+ "updates": {
+ "25.0.2": {
+ "sapmachine-25.0.2": {
+ "release_url": "https://example.test/releases/25.0.2",
+ "ea": false,
+ "assets": {
+ "jdk": {
+ "linux-x64": {
+ "tar.gz": {
+ "name": "sapmachine-jdk-25.0.2_linux-x64_bin.tar.gz",
+ "checksum": "stable-boolean",
+ "url": "https://example.test/sapmachine-25.0.2-ga.tar.gz"
+ }
+ }
+ }
+ }
+ }
+ },
+ "25.0.1": {
+ "sapmachine-25.0.1": {
+ "release_url": "https://example.test/releases/25.0.1",
+ "ea": "false",
+ "assets": {
+ "jdk": {
+ "linux-x64": {
+ "tar.gz": {
+ "name": "sapmachine-jdk-25.0.1_linux-x64_bin.tar.gz",
+ "checksum": "stable-string",
+ "url": "https://example.test/sapmachine-25.0.1-ga.tar.gz"
+ }
+ }
+ }
+ }
+ }
+ },
+ "25": {
+ "sapmachine-25+11": {
+ "release_url": "https://example.test/releases/25+11",
+ "ea": true,
+ "assets": {
+ "jdk": {
+ "linux-x64": {
+ "tar.gz": {
+ "name": "sapmachine-jdk-25-ea.11_linux-x64_bin.tar.gz",
+ "checksum": "ea-boolean",
+ "url": "https://example.test/sapmachine-25-ea.11.tar.gz"
+ }
+ }
+ }
+ }
+ },
+ "sapmachine-25+10": {
+ "release_url": "https://example.test/releases/25+10",
+ "ea": "true",
+ "assets": {
+ "jdk": {
+ "linux-x64": {
+ "tar.gz": {
+ "name": "sapmachine-jdk-25-ea.10_linux-x64_bin.tar.gz",
+ "checksum": "ea-string",
+ "url": "https://example.test/sapmachine-25-ea.10.tar.gz"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/__tests__/data/sdkman-java-versions.csv b/__tests__/data/sdkman-java-versions.csv
new file mode 100644
index 000000000..edbdc265c
--- /dev/null
+++ b/__tests__/data/sdkman-java-versions.csv
@@ -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
+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
+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
+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
+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
+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
+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
+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
+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
+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
+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
\ No newline at end of file
diff --git a/__tests__/data/temurin.json b/__tests__/data/temurin.json
index 7ce00d2c7..cec2c631a 100644
--- a/__tests__/data/temurin.json
+++ b/__tests__/data/temurin.json
@@ -15,7 +15,8 @@
"link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz.json",
"name": "OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz",
- "size": 205463525
+ "size": 205463525,
+ "signature_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-16.0.2+7_adopt",
@@ -44,7 +45,8 @@
"link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_mac_hotspot_16.0.2_7.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_mac_hotspot_16.0.2_7.tar.gz.json",
"name": "OpenJDK16U-jdk_x64_mac_hotspot_16.0.2_7.tar.gz",
- "size": 206621395
+ "size": 206621395,
+ "signature_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_mac_hotspot_16.0.2_7.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-16.0.2+7_adopt",
@@ -73,7 +75,8 @@
"link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_windows_hotspot_16.0.2_7.zip",
"metadata_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_windows_hotspot_16.0.2_7.zip.json",
"name": "OpenJDK16U-jdk_x64_windows_hotspot_16.0.2_7.zip",
- "size": 203448494
+ "size": 203448494,
+ "signature_link": "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_windows_hotspot_16.0.2_7.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-16.0.2+7_adopt",
@@ -113,7 +116,8 @@
"link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz.json",
"name": "OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz",
- "size": 102954777
+ "size": 102954777,
+ "signature_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u302b08.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk8u302-b08",
@@ -142,7 +146,8 @@
"link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u302b08.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u302b08.tar.gz.json",
"name": "OpenJDK8U-jdk_x64_mac_hotspot_8u302b08.tar.gz",
- "size": 107303398
+ "size": 107303398,
+ "signature_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u302b08.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk8u302-b08",
@@ -171,7 +176,8 @@
"link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip",
"metadata_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip.json",
"name": "OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip",
- "size": 104297671
+ "size": 104297671,
+ "signature_link": "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u302-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u302b08.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk8u302-b08",
@@ -211,7 +217,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-31-00-07.tar.gz",
- "size": 188909250
+ "size": 188909250,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-16-ge39bf269d60",
@@ -240,7 +247,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-31-00-07.tar.gz",
- "size": 192952713
+ "size": 192952713,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -260,7 +268,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-31-00-07.tar.gz",
- "size": 188816971
+ "size": 188816971,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-16-ge39bf269d60",
@@ -280,7 +289,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-31-00-07.tar.gz",
- "size": 182299353
+ "size": 182299353,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -300,7 +310,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-31-00-07.tar.gz",
- "size": 187674392
+ "size": 187674392,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-46-gea8d2c72e83",
@@ -320,7 +331,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-31-00-07.tar.gz",
- "size": 179501342
+ "size": 179501342,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-21-ge39bf269d60",
@@ -340,7 +352,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-29-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-29-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-29-23-34.tar.gz",
- "size": 192126971
+ "size": 192126971,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-29-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -360,7 +373,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-31-00-07.tar.gz",
- "size": 192015878
+ "size": 192015878,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-21-ge39bf269d60",
@@ -389,7 +403,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-31-00-07.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-31-00-07.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-31-00-07.tar.gz",
- "size": 192422068
+ "size": 192422068,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-31-00-07.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -418,7 +433,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-31-00-07.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-31-00-07.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-31-00-07.zip",
- "size": 188694175
+ "size": 188694175,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-31-00-07.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -447,7 +463,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-31-00-07.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-31-00-07.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-31-00-07.zip",
- "size": 184618115
+ "size": 184618115,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-31-00-07.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+33_adopt-219-ge39bf269d60",
@@ -489,7 +506,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-27-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-27-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-27-23-34.tar.gz",
- "size": 192125161
+ "size": 192125161,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-31-00-07-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-27-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-242-gce1857dd7a1",
@@ -531,7 +549,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-23-03-09.tar.gz",
- "size": 188911467
+ "size": 188911467,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-42-g4596b4e9d4e",
@@ -560,7 +579,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-23-03-09.tar.gz",
- "size": 192950510
+ "size": 192950510,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -580,7 +600,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-23-03-09.tar.gz",
- "size": 188815685
+ "size": 188815685,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-36-g4596b4e9d4e",
@@ -600,7 +621,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-23-03-09.tar.gz",
- "size": 182307654
+ "size": 182307654,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -620,7 +642,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-23-03-09.tar.gz",
- "size": 187698851
+ "size": 187698851,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-36-g4596b4e9d4e",
@@ -640,7 +663,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-23-03-09.tar.gz",
- "size": 179501218
+ "size": 179501218,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-40-g4596b4e9d4e",
@@ -660,7 +684,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-22-23-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-22-23-30.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-22-23-30.tar.gz",
- "size": 192124471
+ "size": 192124471,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-22-23-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -680,7 +705,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-23-03-09.tar.gz",
- "size": 192015026
+ "size": 192015026,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-40-g4596b4e9d4e",
@@ -709,7 +735,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-23-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-23-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-23-03-09.tar.gz",
- "size": 193003513
+ "size": 193003513,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-23-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -738,7 +765,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-23-03-09.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-23-03-09.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-23-03-09.zip",
- "size": 188694996
+ "size": 188694996,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-23-03-09.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -767,7 +795,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-23-03-09.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-23-03-09.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-23-03-09.zip",
- "size": 184626937
+ "size": 184626937,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-23-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-23-03-09.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+32_adopt-217-g4596b4e9d4e",
@@ -809,7 +838,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-21-03-09.tar.gz",
- "size": 188891565
+ "size": 188891565,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "a342f28aaec",
@@ -829,7 +859,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-21-03-09.tar.gz",
- "size": 188790907
+ "size": 188790907,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "a342f28aaec",
@@ -849,7 +880,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-21-03-09.tar.gz",
- "size": 182276594
+ "size": 182276594,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-191-ga342f28aaec",
@@ -869,7 +901,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-21-03-09.tar.gz",
- "size": 187678422
+ "size": 187678422,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-26-ga342f28aaec",
@@ -889,7 +922,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-21-03-09.tar.gz",
- "size": 179475721
+ "size": 179475721,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-26-ga342f28aaec",
@@ -909,7 +943,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-20-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-20-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-20-23-34.tar.gz",
- "size": 192104689
+ "size": 192104689,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-20-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-191-ga342f28aaec",
@@ -929,7 +964,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-21-03-09.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-21-03-09.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-21-03-09.tar.gz",
- "size": 191982821
+ "size": 191982821,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-21-03-09.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "a342f28aaec",
@@ -958,7 +994,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-21-03-09.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-21-03-09.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-21-03-09.zip",
- "size": 188685330
+ "size": 188685330,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-21-03-09.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-191-ga342f28aaec",
@@ -987,7 +1024,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-21-03-09.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-21-03-09.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-21-03-09.zip",
- "size": 184607457
+ "size": 184607457,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-21-03-09-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-21-03-09.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-191-ga342f28aaec",
@@ -1029,7 +1067,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-16-10-58.tar.gz",
- "size": 188896773
+ "size": 188896773,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-14-g20418a26958",
@@ -1058,7 +1097,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-16-10-58.tar.gz",
- "size": 192948484
+ "size": 192948484,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-179-g20418a26958",
@@ -1078,7 +1118,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-16-10-58.tar.gz",
- "size": 188791964
+ "size": 188791964,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-14-g20418a26958",
@@ -1098,7 +1139,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-16-10-58.tar.gz",
- "size": 182281944
+ "size": 182281944,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-179-g20418a26958",
@@ -1118,7 +1160,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-16-10-58.tar.gz",
- "size": 187650365
+ "size": 187650365,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-23-g20418a26958",
@@ -1138,7 +1181,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-16-10-58.tar.gz",
- "size": 179483622
+ "size": 179483622,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-55-g20418a26958",
@@ -1158,7 +1202,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-15-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-15-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-15-23-34.tar.gz",
- "size": 192108731
+ "size": 192108731,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-15-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-179-g20418a26958",
@@ -1178,7 +1223,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-16-10-58.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-16-10-58.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-16-10-58.tar.gz",
- "size": 191985123
+ "size": 191985123,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-16-10-58.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-14-g20418a26958",
@@ -1207,7 +1253,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-16-10-58.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-16-10-58.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-16-10-58.zip",
- "size": 188688539
+ "size": 188688539,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-16-10-58.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-179-g20418a26958",
@@ -1236,7 +1283,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-16-10-58.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-16-10-58.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-16-10-58.zip",
- "size": 184612045
+ "size": 184612045,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-16-10-58-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-16-10-58.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+31_adopt-179-g20418a26958",
@@ -1278,7 +1326,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-14-11-30.tar.gz",
- "size": 188899456
+ "size": 188899456,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "ce22197617d",
@@ -1307,7 +1356,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-14-11-30.tar.gz",
- "size": 192953428
+ "size": 192953428,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-200-gce22197617d",
@@ -1327,7 +1377,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-14-11-30.tar.gz",
- "size": 188792852
+ "size": 188792852,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-66-gce22197617d",
@@ -1347,7 +1398,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-14-11-30.tar.gz",
- "size": 187678600
+ "size": 187678600,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "ce22197617d",
@@ -1367,7 +1419,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-14-11-30.tar.gz",
- "size": 179480996
+ "size": 179480996,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "ce22197617d",
@@ -1387,7 +1440,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-13-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-13-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-13-23-34.tar.gz",
- "size": 192105446
+ "size": 192105446,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-13-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-200-gce22197617d",
@@ -1407,7 +1461,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-14-11-30.tar.gz",
- "size": 191986856
+ "size": 191986856,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "ce22197617d",
@@ -1436,7 +1491,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-14-11-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-14-11-30.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-14-11-30.tar.gz",
- "size": 192995067
+ "size": 192995067,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-14-11-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-200-gce22197617d",
@@ -1465,7 +1521,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-14-11-30.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-14-11-30.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-14-11-30.zip",
- "size": 188686556
+ "size": 188686556,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-14-11-30.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-200-gce22197617d",
@@ -1494,7 +1551,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-14-11-30.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-14-11-30.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-14-11-30.zip",
- "size": 184620492
+ "size": 184620492,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-14-11-30-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-14-11-30.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-200-gce22197617d",
@@ -1536,7 +1594,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-09-12-54.tar.gz",
- "size": 188896299
+ "size": 188896299,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1565,7 +1624,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-09-12-54.tar.gz",
- "size": 192941671
+ "size": 192941671,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1585,7 +1645,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-09-12-54.tar.gz",
- "size": 188838708
+ "size": 188838708,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-161-g3e7e5bc2003",
@@ -1605,7 +1666,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-09-12-54.tar.gz",
- "size": 182274073
+ "size": 182274073,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-40-g3e7e5bc2003",
@@ -1625,7 +1687,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-09-12-54.tar.gz",
- "size": 187666608
+ "size": 187666608,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-40-g3e7e5bc2003",
@@ -1645,7 +1708,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-09-12-54.tar.gz",
- "size": 179472325
+ "size": 179472325,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-30-g3e7e5bc2003",
@@ -1665,7 +1729,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-08-23-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-08-23-35.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-08-23-35.tar.gz",
- "size": 192098387
+ "size": 192098387,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-08-23-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1685,7 +1750,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-09-12-54.tar.gz",
- "size": 191983708
+ "size": 191983708,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1714,7 +1780,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-09-12-54.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-09-12-54.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-09-12-54.tar.gz",
- "size": 193004476
+ "size": 193004476,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-09-12-54.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1743,7 +1810,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-09-12-54.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-09-12-54.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-09-12-54.zip",
- "size": 188681640
+ "size": 188681640,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-09-12-54.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1772,7 +1840,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-09-12-54.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-09-12-54.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-09-12-54.zip",
- "size": 184605514
+ "size": 184605514,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-09-12-54-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-09-12-54.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+30_adopt-164-g3e7e5bc2003",
@@ -1823,7 +1892,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-07-11-35.tar.gz",
- "size": 192962903
+ "size": 192962903,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-172-g06428c22b61",
@@ -1843,7 +1913,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-07-11-35.tar.gz",
- "size": 188800217
+ "size": 188800217,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "06428c22b61",
@@ -1863,7 +1934,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-07-11-35.tar.gz",
- "size": 187663978
+ "size": 187663978,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-78-g06428c22b61",
@@ -1883,7 +1955,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-07-11-35.tar.gz",
- "size": 179496669
+ "size": 179496669,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-78-g06428c22b61",
@@ -1903,7 +1976,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-06-23-34.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-06-23-34.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-06-23-34.tar.gz",
- "size": 192113242
+ "size": 192113242,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-06-23-34.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-172-g06428c22b61",
@@ -1923,7 +1997,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-07-11-35.tar.gz",
- "size": 192021951
+ "size": 192021951,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-172-g06428c22b61",
@@ -1952,7 +2027,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-07-11-35.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-07-11-35.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-07-11-35.tar.gz",
- "size": 193018554
+ "size": 193018554,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-07-11-35.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-172-g06428c22b61",
@@ -1981,7 +2057,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-07-11-35.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-07-11-35.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-07-11-35.zip",
- "size": 188702463
+ "size": 188702463,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-07-11-35-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-07-11-35.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-172-g06428c22b61",
@@ -2023,7 +2100,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-02-12-00.tar.gz",
- "size": 188953178
+ "size": 188953178,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2052,7 +2130,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-02-12-00.tar.gz",
- "size": 192957934
+ "size": 192957934,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2072,7 +2151,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-07-02-12-00.tar.gz",
- "size": 188797466
+ "size": 188797466,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-43-g6d3debb5c12",
@@ -2092,7 +2172,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-02-12-00.tar.gz",
- "size": 182292580
+ "size": 182292580,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2112,7 +2193,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-02-12-00.tar.gz",
- "size": 187684930
+ "size": 187684930,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-64-g6d3debb5c12",
@@ -2132,7 +2214,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-07-02-12-00.tar.gz",
- "size": 179484390
+ "size": 179484390,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-54-g6d3debb5c12",
@@ -2152,7 +2235,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-01-23-30.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-01-23-30.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-01-23-30.tar.gz",
- "size": 192114561
+ "size": 192114561,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-07-01-23-30.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2172,7 +2256,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-07-02-12-00.tar.gz",
- "size": 192014644
+ "size": 192014644,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2201,7 +2286,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-02-12-00.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-02-12-00.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-07-02-12-00.tar.gz",
- "size": 192425033
+ "size": 192425033,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-07-02-12-00.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2230,7 +2316,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-02-12-00.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-02-12-00.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-07-02-12-00.zip",
- "size": 188697393
+ "size": 188697393,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-07-02-12-00.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2259,7 +2346,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-02-12-00.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-02-12-00.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-02-12-00.zip",
- "size": 184618232
+ "size": 184618232,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-07-02-12-00-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-07-02-12-00.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+29_adopt-138-g6d3debb5c12",
@@ -2301,7 +2389,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_linux_hotspot_2021-06-30-09-16.tar.gz",
- "size": 188940191
+ "size": 188940191,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_linux_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2330,7 +2419,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_aarch64_mac_hotspot_2021-06-30-09-16.tar.gz",
- "size": 192953718
+ "size": 192953718,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_aarch64_mac_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2350,7 +2440,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_arm_linux_hotspot_2021-06-30-09-16.tar.gz",
- "size": 188795343
+ "size": 188795343,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_arm_linux_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "0fe0d0825e7",
@@ -2370,7 +2461,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64_aix_hotspot_2021-06-30-09-16.tar.gz",
- "size": 182285782
+ "size": 182285782,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64_aix_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "0fe0d0825e7",
@@ -2390,7 +2482,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_ppc64le_linux_hotspot_2021-06-30-09-16.tar.gz",
- "size": 187652430
+ "size": 187652430,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_ppc64le_linux_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "0fe0d0825e7",
@@ -2410,7 +2503,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_s390x_linux_hotspot_2021-06-30-09-16.tar.gz",
- "size": 179489547
+ "size": 179489547,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_s390x_linux_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "0fe0d0825e7",
@@ -2430,7 +2524,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-06-29-23-33.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-06-29-23-33.tar.gz.json",
"name": "OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-06-29-23-33.tar.gz",
- "size": 192109453
+ "size": 192109453,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_alpine-linux_hotspot_2021-06-29-23-33.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2450,7 +2545,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_x64_linux_hotspot_2021-06-30-09-16.tar.gz",
- "size": 192013559
+ "size": 192013559,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_linux_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2479,7 +2575,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-06-30-09-16.tar.gz",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-06-30-09-16.tar.gz.json",
"name": "OpenJDK17-jdk_x64_mac_hotspot_2021-06-30-09-16.tar.gz",
- "size": 192419518
+ "size": 192419518,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_mac_hotspot_2021-06-30-09-16.tar.gz.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2508,7 +2605,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-06-30-09-16.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-06-30-09-16.zip.json",
"name": "OpenJDK17-jdk_x64_windows_hotspot_2021-06-30-09-16.zip",
- "size": 188672489
+ "size": 188672489,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x64_windows_hotspot_2021-06-30-09-16.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-130-g0fe0d0825e7",
@@ -2537,7 +2635,8 @@
"link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-06-30-09-16.zip",
"metadata_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-06-30-09-16.zip.json",
"name": "OpenJDK17-jdk_x86-32_windows_hotspot_2021-06-30-09-16.zip",
- "size": 184626094
+ "size": 184626094,
+ "signature_link": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk17-2021-06-30-09-16-beta/OpenJDK17-jdk_x86-32_windows_hotspot_2021-06-30-09-16.zip.sig"
},
"project": "jdk",
"scm_ref": "jdk-17+28_adopt-132-g23fbf51b850",
diff --git a/__tests__/data/zulu-linux.json b/__tests__/data/zulu-linux.json
index 1f2fa2716..c74487e2c 100644
--- a/__tests__/data/zulu-linux.json
+++ b/__tests__/data/zulu-linux.json
@@ -1,254 +1,686 @@
-[
+[
{
- "id": 10996,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-linux.tar.gz",
+ "package_uuid": "test-uuid-10996",
"name": "zulu1.8.0_05-8.1.0.10-linux.tar.gz",
- "zulu_version": [8, 1, 0, 10],
- "jdk_version": [8, 0, 5, 13]
- },
- {
- "id": 10997,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-linux.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-linux.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 8,
+ 1,
+ 0,
+ 10
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10997",
"name": "zulu1.8.0_11-8.2.0.1-linux.tar.gz",
- "zulu_version": [8, 2, 0, 1],
- "jdk_version": [8, 0, 11, 12]
- },
- {
- "id": 10346,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-linux.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 11
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 8,
+ 2,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10346",
"name": "zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
- "zulu_version": [8, 21, 0, 1],
- "jdk_version": [8, 0, 131, 11]
- },
- {
- "id": 10362,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 131
+ ],
+ "openjdk_build_number": 11,
+ "distro_version": [
+ 8,
+ 21,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10362",
"name": "zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
- "zulu_version": [8, 23, 0, 3],
- "jdk_version": [8, 0, 144, 1]
- },
- {
- "id": 10399,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 144
+ ],
+ "openjdk_build_number": 1,
+ "distro_version": [
+ 8,
+ 23,
+ 0,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10399",
"name": "zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
- "zulu_version": [8, 25, 0, 1],
- "jdk_version": [8, 0, 152, 16]
- },
- {
- "id": 11355,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 152
+ ],
+ "openjdk_build_number": 16,
+ "distro_version": [
+ 8,
+ 25,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11355",
"name": "zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
- "zulu_version": [8, 46, 0, 19],
- "jdk_version": [8, 0, 252, 14]
- },
- {
- "id": 11481,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 252
+ ],
+ "openjdk_build_number": 14,
+ "distro_version": [
+ 8,
+ 46,
+ 0,
+ 19
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11481",
"name": "zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
- "zulu_version": [8, 48, 0, 47],
- "jdk_version": [8, 0, 262, 17]
- },
- {
- "id": 11622,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 17,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 47
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11622",
"name": "zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
- "zulu_version": [8, 48, 0, 51],
- "jdk_version": [8, 0, 262, 19]
- },
- {
- "id": 11535,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 19,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 51
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11535",
"name": "zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
- "zulu_version": [8, 48, 0, 49],
- "jdk_version": [8, 0, 262, 18]
- },
- {
- "id": 12424,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 18,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 49
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12424",
"name": "zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
- "zulu_version": [8, 52, 0, 23],
- "jdk_version": [8, 0, 282, 8]
- },
- {
- "id": 10383,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 282
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 8,
+ 52,
+ 0,
+ 23
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10383",
"name": "zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
- "zulu_version": [9, 0, 0, 15],
- "jdk_version": [9, 0, 0, 0]
- },
- {
- "id": 10413,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 0,
+ 15
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10413",
"name": "zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
- "zulu_version": [9, 0, 1, 3],
- "jdk_version": [9, 0, 1, 0]
- },
- {
- "id": 10503,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 1,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10503",
"name": "zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
- "zulu_version": [10, 2, 3, 0],
- "jdk_version": [10, 0, 1, 9]
- },
- {
- "id": 10541,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 10,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10541",
"name": "zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
- "zulu_version": [10, 3, 5, 0],
- "jdk_version": [10, 0, 2, 13]
- },
- {
- "id": 10576,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 10,
+ 3,
+ 5,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10576",
"name": "zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
- "zulu_version": [11, 2, 3, 0],
- "jdk_version": [11, 0, 1, 13]
- },
- {
- "id": 10604,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 11,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10604",
"name": "zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
- "zulu_version": [11, 29, 3, 0],
- "jdk_version": [11, 0, 2, 7]
- },
- {
- "id": 10687,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 29,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10687",
"name": "zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
- "zulu_version": [11, 31, 11, 0],
- "jdk_version": [11, 0, 3, 7]
- },
- {
- "id": 10856,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 3
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 31,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10856",
"name": "zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
- "zulu_version": [11, 35, 13, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
- "zulu_version": [11, 35, 15, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
- "zulu_version": [11, 35, 11, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 12397,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12397",
"name": "zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
- "zulu_version": [11, 45, 27, 0],
- "jdk_version": [11, 0, 10, 9]
- },
- {
- "id": 10667,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 10
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 11,
+ 45,
+ 27,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10667",
"name": "zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
- "zulu_version": [12, 1, 3, 0],
- "jdk_version": [12, 0, 0, 33]
- },
- {
- "id": 10710,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 12,
+ 1,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10710",
"name": "zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
- "zulu_version": [12, 2, 3, 0],
- "jdk_version": [12, 0, 1, 12]
- },
- {
- "id": 10780,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 12,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10780",
"name": "zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
- "zulu_version": [12, 3, 11, 0],
- "jdk_version": [12, 0, 2, 3]
- },
- {
- "id": 10846,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 3,
+ "distro_version": [
+ 12,
+ 3,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10846",
"name": "zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
- "zulu_version": [13, 27, 9, 0],
- "jdk_version": [13, 0, 0, 33]
- },
- {
- "id": 10888,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 13,
+ 27,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10888",
"name": "zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
- "zulu_version": [13, 28, 11, 0],
- "jdk_version": [13, 0, 1, 10]
- },
- {
- "id": 11073,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 13,
+ 28,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11073",
"name": "zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
- "zulu_version": [13, 29, 9, 0],
- "jdk_version": [13, 0, 2, 6]
- },
- {
- "id": 12408,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 6,
+ "distro_version": [
+ 13,
+ 29,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12408",
"name": "zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
- "zulu_version": [13, 37, 21, 0],
- "jdk_version": [13, 0, 6, 5]
- },
- {
- "id": 11236,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 6
+ ],
+ "openjdk_build_number": 5,
+ "distro_version": [
+ 13,
+ 37,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11236",
"name": "zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
- "zulu_version": [14, 27, 1, 0],
- "jdk_version": [14, 0, 0, 36]
- },
- {
- "id": 11349,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 14,
+ 27,
+ 1,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11349",
"name": "zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
- "zulu_version": [14, 28, 21, 0],
- "jdk_version": [14, 0, 1, 8]
- },
- {
- "id": 11513,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 14,
+ 28,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11513",
"name": "zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
- "zulu_version": [14, 29, 23, 0],
- "jdk_version": [14, 0, 2, 12]
- },
- {
- "id": 11780,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 14,
+ 29,
+ 23,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11780",
"name": "zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
- "zulu_version": [15, 27, 17, 0],
- "jdk_version": [15, 0, 0, 36]
- },
- {
- "id": 11924,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 15,
+ 27,
+ 17,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11924",
"name": "zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
- "zulu_version": [15, 28, 13, 0],
- "jdk_version": [15, 0, 1, 8]
- },
- {
- "id": 12101,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 15,
+ 28,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12101",
"name": "zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
- "zulu_version": [15, 28, 51, 0],
- "jdk_version": [15, 0, 1, 9]
- },
- {
- "id": 12445,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 15,
+ 28,
+ 51,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12445",
"name": "zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
- "zulu_version": [15, 29, 15, 0],
- "jdk_version": [15, 0, 2, 7]
- },
- {
- "id": 12447,
- "url": "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 15,
+ 29,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12447",
"name": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
- "zulu_version": [21, 32, 17, 0],
- "jdk_version": [21, 0, 2, 6]
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
+ "java_version": [
+ 21,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 6,
+ "distro_version": [
+ 21,
+ 32,
+ 17,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
}
-]
\ No newline at end of file
+]
diff --git a/__tests__/data/zulu-releases-default.json b/__tests__/data/zulu-releases-default.json
index f23a87d43..16ed97772 100644
--- a/__tests__/data/zulu-releases-default.json
+++ b/__tests__/data/zulu-releases-default.json
@@ -1,247 +1,667 @@
[
{
- "id": 10996,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
+ "package_uuid": "test-uuid-10996",
"name": "zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
- "zulu_version": [8, 1, 0, 10],
- "jdk_version": [8, 0, 5, 13]
- },
- {
- "id": 10997,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 8,
+ 1,
+ 0,
+ 10
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10997",
"name": "zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
- "zulu_version": [8, 2, 0, 1],
- "jdk_version": [8, 0, 11, 12]
- },
- {
- "id": 10346,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 11
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 8,
+ 2,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10346",
"name": "zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
- "zulu_version": [8, 21, 0, 1],
- "jdk_version": [8, 0, 131, 11]
- },
- {
- "id": 10362,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 131
+ ],
+ "openjdk_build_number": 11,
+ "distro_version": [
+ 8,
+ 21,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10362",
"name": "zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
- "zulu_version": [8, 23, 0, 3],
- "jdk_version": [8, 0, 144, 1]
- },
- {
- "id": 10399,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 144
+ ],
+ "openjdk_build_number": 1,
+ "distro_version": [
+ 8,
+ 23,
+ 0,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10399",
"name": "zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
- "zulu_version": [8, 25, 0, 1],
- "jdk_version": [8, 0, 152, 16]
- },
- {
- "id": 11355,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 152
+ ],
+ "openjdk_build_number": 16,
+ "distro_version": [
+ 8,
+ 25,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11355",
"name": "zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
- "zulu_version": [8, 46, 0, 19],
- "jdk_version": [8, 0, 252, 14]
- },
- {
- "id": 11481,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 252
+ ],
+ "openjdk_build_number": 14,
+ "distro_version": [
+ 8,
+ 46,
+ 0,
+ 19
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11481",
"name": "zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
- "zulu_version": [8, 48, 0, 47],
- "jdk_version": [8, 0, 262, 17]
- },
- {
- "id": 11622,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 17,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 47
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11622",
"name": "zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
- "zulu_version": [8, 48, 0, 51],
- "jdk_version": [8, 0, 262, 19]
- },
- {
- "id": 11535,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 19,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 51
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11535",
"name": "zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
- "zulu_version": [8, 48, 0, 49],
- "jdk_version": [8, 0, 262, 18]
- },
- {
- "id": 12424,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 18,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 49
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12424",
"name": "zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
- "zulu_version": [8, 52, 0, 23],
- "jdk_version": [8, 0, 282, 8]
- },
- {
- "id": 10383,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 282
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 8,
+ 52,
+ 0,
+ 23
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10383",
"name": "zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
- "zulu_version": [9, 0, 0, 15],
- "jdk_version": [9, 0, 0, 0]
- },
- {
- "id": 10413,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 0,
+ 15
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10413",
"name": "zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
- "zulu_version": [9, 0, 1, 3],
- "jdk_version": [9, 0, 1, 0]
- },
- {
- "id": 10503,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 1,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10503",
"name": "zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
- "zulu_version": [10, 2, 3, 0],
- "jdk_version": [10, 0, 1, 9]
- },
- {
- "id": 10541,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 10,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10541",
"name": "zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
- "zulu_version": [10, 3, 5, 0],
- "jdk_version": [10, 0, 2, 13]
- },
- {
- "id": 10576,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 10,
+ 3,
+ 5,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10576",
"name": "zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
- "zulu_version": [11, 2, 3, 0],
- "jdk_version": [11, 0, 1, 13]
- },
- {
- "id": 10604,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 11,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10604",
"name": "zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
- "zulu_version": [11, 29, 3, 0],
- "jdk_version": [11, 0, 2, 7]
- },
- {
- "id": 10687,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 29,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10687",
"name": "zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
- "zulu_version": [11, 31, 11, 0],
- "jdk_version": [11, 0, 3, 7]
- },
- {
- "id": 10856,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 3
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 31,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10856",
"name": "zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
- "zulu_version": [11, 35, 13, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
- "zulu_version": [11, 35, 15, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
- "zulu_version": [11, 35, 11, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 12397,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12397",
"name": "zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
- "zulu_version": [11, 45, 27, 0],
- "jdk_version": [11, 0, 10, 9]
- },
- {
- "id": 10667,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 10
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 11,
+ 45,
+ 27,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10667",
"name": "zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
- "zulu_version": [12, 1, 3, 0],
- "jdk_version": [12, 0, 0, 33]
- },
- {
- "id": 10710,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 12,
+ 1,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10710",
"name": "zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
- "zulu_version": [12, 2, 3, 0],
- "jdk_version": [12, 0, 1, 12]
- },
- {
- "id": 10780,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 12,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10780",
"name": "zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
- "zulu_version": [12, 3, 11, 0],
- "jdk_version": [12, 0, 2, 3]
- },
- {
- "id": 10846,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 3,
+ "distro_version": [
+ 12,
+ 3,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10846",
"name": "zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
- "zulu_version": [13, 27, 9, 0],
- "jdk_version": [13, 0, 0, 33]
- },
- {
- "id": 10888,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 13,
+ 27,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10888",
"name": "zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
- "zulu_version": [13, 28, 11, 0],
- "jdk_version": [13, 0, 1, 10]
- },
- {
- "id": 11073,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 13,
+ 28,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11073",
"name": "zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
- "zulu_version": [13, 29, 9, 0],
- "jdk_version": [13, 0, 2, 6]
- },
- {
- "id": 12408,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 6,
+ "distro_version": [
+ 13,
+ 29,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12408",
"name": "zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
- "zulu_version": [13, 37, 21, 0],
- "jdk_version": [13, 0, 6, 5]
- },
- {
- "id": 11236,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 6
+ ],
+ "openjdk_build_number": 5,
+ "distro_version": [
+ 13,
+ 37,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11236",
"name": "zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
- "zulu_version": [14, 27, 1, 0],
- "jdk_version": [14, 0, 0, 36]
- },
- {
- "id": 11349,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 14,
+ 27,
+ 1,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11349",
"name": "zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
- "zulu_version": [14, 28, 21, 0],
- "jdk_version": [14, 0, 1, 8]
- },
- {
- "id": 11513,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 14,
+ 28,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11513",
"name": "zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
- "zulu_version": [14, 29, 23, 0],
- "jdk_version": [14, 0, 2, 12]
- },
- {
- "id": 11780,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 14,
+ 29,
+ 23,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11780",
"name": "zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
- "zulu_version": [15, 27, 17, 0],
- "jdk_version": [15, 0, 0, 36]
- },
- {
- "id": 11924,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 15,
+ 27,
+ 17,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11924",
"name": "zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
- "zulu_version": [15, 28, 13, 0],
- "jdk_version": [15, 0, 1, 8]
- },
- {
- "id": 12101,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 15,
+ 28,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12101",
"name": "zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
- "zulu_version": [15, 28, 51, 0],
- "jdk_version": [15, 0, 1, 9]
- },
- {
- "id": 12445,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 15,
+ 28,
+ 51,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12445",
"name": "zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
- "zulu_version": [15, 29, 15, 0],
- "jdk_version": [15, 0, 2, 7]
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 15,
+ 29,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
}
]
diff --git a/__tests__/data/zulu-windows.json b/__tests__/data/zulu-windows.json
index e4ce99538..dcfb9462f 100644
--- a/__tests__/data/zulu-windows.json
+++ b/__tests__/data/zulu-windows.json
@@ -1,254 +1,686 @@
-[
+[
{
- "id": 10996,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-windows.tar.gz",
+ "package_uuid": "test-uuid-10996",
"name": "zulu1.8.0_05-8.1.0.10-windows.tar.gz",
- "zulu_version": [8, 1, 0, 10],
- "jdk_version": [8, 0, 5, 13]
- },
- {
- "id": 10997,
- "url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-windows.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-windows.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 8,
+ 1,
+ 0,
+ 10
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10997",
"name": "zulu1.8.0_11-8.2.0.1-windows.tar.gz",
- "zulu_version": [8, 2, 0, 1],
- "jdk_version": [8, 0, 11, 12]
- },
- {
- "id": 10346,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-windows.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 11
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 8,
+ 2,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10346",
"name": "zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
- "zulu_version": [8, 21, 0, 1],
- "jdk_version": [8, 0, 131, 11]
- },
- {
- "id": 10362,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 131
+ ],
+ "openjdk_build_number": 11,
+ "distro_version": [
+ 8,
+ 21,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10362",
"name": "zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
- "zulu_version": [8, 23, 0, 3],
- "jdk_version": [8, 0, 144, 1]
- },
- {
- "id": 10399,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 144
+ ],
+ "openjdk_build_number": 1,
+ "distro_version": [
+ 8,
+ 23,
+ 0,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10399",
"name": "zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
- "zulu_version": [8, 25, 0, 1],
- "jdk_version": [8, 0, 152, 16]
- },
- {
- "id": 11355,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 152
+ ],
+ "openjdk_build_number": 16,
+ "distro_version": [
+ 8,
+ 25,
+ 0,
+ 1
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11355",
"name": "zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
- "zulu_version": [8, 46, 0, 19],
- "jdk_version": [8, 0, 252, 14]
- },
- {
- "id": 11481,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 252
+ ],
+ "openjdk_build_number": 14,
+ "distro_version": [
+ 8,
+ 46,
+ 0,
+ 19
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11481",
"name": "zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
- "zulu_version": [8, 48, 0, 47],
- "jdk_version": [8, 0, 262, 17]
- },
- {
- "id": 11622,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 17,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 47
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11622",
"name": "zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
- "zulu_version": [8, 48, 0, 51],
- "jdk_version": [8, 0, 262, 19]
- },
- {
- "id": 11535,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 19,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 51
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11535",
"name": "zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
- "zulu_version": [8, 48, 0, 49],
- "jdk_version": [8, 0, 262, 18]
- },
- {
- "id": 12424,
- "url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 262
+ ],
+ "openjdk_build_number": 18,
+ "distro_version": [
+ 8,
+ 48,
+ 0,
+ 49
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12424",
"name": "zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
- "zulu_version": [8, 52, 0, 23],
- "jdk_version": [8, 0, 282, 8]
- },
- {
- "id": 10383,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
+ "java_version": [
+ 8,
+ 0,
+ 282
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 8,
+ 52,
+ 0,
+ 23
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10383",
"name": "zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
- "zulu_version": [9, 0, 0, 15],
- "jdk_version": [9, 0, 0, 0]
- },
- {
- "id": 10413,
- "url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 0,
+ 15
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10413",
"name": "zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
- "zulu_version": [9, 0, 1, 3],
- "jdk_version": [9, 0, 1, 0]
- },
- {
- "id": 10503,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 9,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 0,
+ "distro_version": [
+ 9,
+ 0,
+ 1,
+ 3
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10503",
"name": "zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
- "zulu_version": [10, 2, 3, 0],
- "jdk_version": [10, 0, 1, 9]
- },
- {
- "id": 10541,
- "url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 10,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10541",
"name": "zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
- "zulu_version": [10, 3, 5, 0],
- "jdk_version": [10, 0, 2, 13]
- },
- {
- "id": 10576,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 10,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 10,
+ 3,
+ 5,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10576",
"name": "zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
- "zulu_version": [11, 2, 3, 0],
- "jdk_version": [11, 0, 1, 13]
- },
- {
- "id": 10604,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 13,
+ "distro_version": [
+ 11,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10604",
"name": "zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
- "zulu_version": [11, 29, 3, 0],
- "jdk_version": [11, 0, 2, 7]
- },
- {
- "id": 10687,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 29,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10687",
"name": "zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
- "zulu_version": [11, 31, 11, 0],
- "jdk_version": [11, 0, 3, 7]
- },
- {
- "id": 10856,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 3
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 11,
+ 31,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10856",
"name": "zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
- "zulu_version": [11, 35, 13, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
- "zulu_version": [11, 35, 15, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 10933,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10933",
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
- "zulu_version": [11, 35, 11, 0],
- "jdk_version": [11, 0, 5, 10]
- },
- {
- "id": 12397,
- "url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 5
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 11,
+ 35,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12397",
"name": "zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
- "zulu_version": [11, 45, 27, 0],
- "jdk_version": [11, 0, 10, 9]
- },
- {
- "id": 10667,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
+ "java_version": [
+ 11,
+ 0,
+ 10
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 11,
+ 45,
+ 27,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10667",
"name": "zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
- "zulu_version": [12, 1, 3, 0],
- "jdk_version": [12, 0, 0, 33]
- },
- {
- "id": 10710,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 12,
+ 1,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10710",
"name": "zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
- "zulu_version": [12, 2, 3, 0],
- "jdk_version": [12, 0, 1, 12]
- },
- {
- "id": 10780,
- "url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 12,
+ 2,
+ 3,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10780",
"name": "zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
- "zulu_version": [12, 3, 11, 0],
- "jdk_version": [12, 0, 2, 3]
- },
- {
- "id": 10846,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 12,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 3,
+ "distro_version": [
+ 12,
+ 3,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10846",
"name": "zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
- "zulu_version": [13, 27, 9, 0],
- "jdk_version": [13, 0, 0, 33]
- },
- {
- "id": 10888,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 33,
+ "distro_version": [
+ 13,
+ 27,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-10888",
"name": "zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
- "zulu_version": [13, 28, 11, 0],
- "jdk_version": [13, 0, 1, 10]
- },
- {
- "id": 11073,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 10,
+ "distro_version": [
+ 13,
+ 28,
+ 11,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11073",
"name": "zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
- "zulu_version": [13, 29, 9, 0],
- "jdk_version": [13, 0, 2, 6]
- },
- {
- "id": 12408,
- "url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 6,
+ "distro_version": [
+ 13,
+ 29,
+ 9,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12408",
"name": "zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
- "zulu_version": [13, 37, 21, 0],
- "jdk_version": [13, 0, 6, 5]
- },
- {
- "id": 11236,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
+ "java_version": [
+ 13,
+ 0,
+ 6
+ ],
+ "openjdk_build_number": 5,
+ "distro_version": [
+ 13,
+ 37,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11236",
"name": "zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
- "zulu_version": [14, 27, 1, 0],
- "jdk_version": [14, 0, 0, 36]
- },
- {
- "id": 11349,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 14,
+ 27,
+ 1,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11349",
"name": "zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
- "zulu_version": [14, 28, 21, 0],
- "jdk_version": [14, 0, 1, 8]
- },
- {
- "id": 11513,
- "url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 14,
+ 28,
+ 21,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11513",
"name": "zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
- "zulu_version": [14, 29, 23, 0],
- "jdk_version": [14, 0, 2, 12]
- },
- {
- "id": 11780,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 14,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 12,
+ "distro_version": [
+ 14,
+ 29,
+ 23,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11780",
"name": "zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
- "zulu_version": [15, 27, 17, 0],
- "jdk_version": [15, 0, 0, 36]
- },
- {
- "id": 11924,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 0
+ ],
+ "openjdk_build_number": 36,
+ "distro_version": [
+ 15,
+ 27,
+ 17,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-11924",
"name": "zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
- "zulu_version": [15, 28, 13, 0],
- "jdk_version": [15, 0, 1, 8]
- },
- {
- "id": 12101,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 8,
+ "distro_version": [
+ 15,
+ 28,
+ 13,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12101",
"name": "zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
- "zulu_version": [15, 28, 51, 0],
- "jdk_version": [15, 0, 1, 9]
- },
- {
- "id": 12445,
- "url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 1
+ ],
+ "openjdk_build_number": 9,
+ "distro_version": [
+ 15,
+ 28,
+ 51,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12445",
"name": "zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
- "zulu_version": [15, 29, 15, 0],
- "jdk_version": [15, 0, 2, 7]
- },
- {
- "id": 12446,
- "url": "https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip",
- "name": "zulu17.48.15-ca-jdk17.0.10-win_aarhc4.zip",
- "zulu_version": [17, 48, 15, 0],
- "jdk_version": [17, 0, 10, 7]
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
+ "java_version": [
+ 15,
+ 0,
+ 2
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 15,
+ 29,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
+ },
+ {
+ "package_uuid": "test-uuid-12446",
+ "name": "zulu17.48.15-ca-jdk17.0.10-win_aarch64.zip",
+ "download_url": "https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip",
+ "java_version": [
+ 17,
+ 0,
+ 10
+ ],
+ "openjdk_build_number": 7,
+ "distro_version": [
+ 17,
+ 48,
+ 15,
+ 0
+ ],
+ "latest": false,
+ "availability_type": "ca"
}
-]
\ No newline at end of file
+]
diff --git a/__tests__/distributors/adopt-installer.test.ts b/__tests__/distributors/adopt-installer.test.ts
deleted file mode 100644
index 8a112243f..000000000
--- a/__tests__/distributors/adopt-installer.test.ts
+++ /dev/null
@@ -1,297 +0,0 @@
-import {HttpClient} from '@actions/http-client';
-import {IAdoptAvailableVersions} from '../../src/distributions/adopt/models';
-import {
- AdoptDistribution,
- AdoptImplementation
-} from '../../src/distributions/adopt/installer';
-import {JavaInstallerOptions} from '../../src/distributions/base-models';
-
-import os from 'os';
-
-import manifestData from '../data/adopt.json';
-
-describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
-
- beforeEach(() => {
- spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
- spyHttpClient.mockReturnValue({
- statusCode: 200,
- headers: {},
- result: []
- });
- });
-
- afterEach(() => {
- jest.resetAllMocks();
- jest.clearAllMocks();
- jest.restoreAllMocks();
- });
-
- it.each([
- [
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot,
- 'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
- ],
- [
- {
- version: '11',
- architecture: 'x86',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot,
- 'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
- ],
- [
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jre',
- checkLatest: false
- },
- AdoptImplementation.Hotspot,
- 'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
- ],
- [
- {
- version: '11-ea',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot,
- 'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
- ],
- [
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.OpenJ9,
- 'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
- ],
- [
- {
- version: '11',
- architecture: 'x86',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.OpenJ9,
- 'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
- ],
- [
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jre',
- checkLatest: false
- },
- AdoptImplementation.OpenJ9,
- 'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
- ],
- [
- {
- version: '11-ea',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.OpenJ9,
- 'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=openj9&page_size=20&page=0'
- ]
- ])(
- 'build correct url for %s',
- async (
- installerOptions: JavaInstallerOptions,
- impl: AdoptImplementation,
- expectedParameters
- ) => {
- const distribution = new AdoptDistribution(installerOptions, impl);
- const baseUrl =
- 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
- const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
- distribution['getPlatformOption'] = () => 'mac';
-
- await distribution['getAvailableVersions']();
-
- expect(spyHttpClient.mock.calls).toHaveLength(1);
- expect(spyHttpClient.mock.calls[0][0]).toBe(expectedUrl);
- }
- );
-
- it('load available versions', async () => {
- spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
- spyHttpClient
- .mockReturnValueOnce({
- statusCode: 200,
- headers: {},
- result: manifestData as any
- })
- .mockReturnValueOnce({
- statusCode: 200,
- headers: {},
- result: manifestData as any
- })
- .mockReturnValueOnce({
- statusCode: 200,
- headers: {},
- result: []
- });
-
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot
- );
- const availableVersions = await distribution['getAvailableVersions']();
- expect(availableVersions).not.toBeNull();
- expect(availableVersions.length).toBe(manifestData.length * 2);
- });
-
- it.each([
- [AdoptImplementation.Hotspot, 'jdk', 'Java_Adopt_jdk'],
- [AdoptImplementation.Hotspot, 'jre', 'Java_Adopt_jre'],
- [AdoptImplementation.OpenJ9, 'jdk', 'Java_Adopt-OpenJ9_jdk'],
- [AdoptImplementation.OpenJ9, 'jre', 'Java_Adopt-OpenJ9_jre']
- ])(
- 'find right toolchain folder',
- (impl: AdoptImplementation, packageType: string, expected: string) => {
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: packageType,
- checkLatest: false
- },
- impl
- );
-
- // @ts-ignore - because it is protected
- expect(distribution.toolcacheFolderName).toBe(expected);
- }
- );
-
- it.each([
- ['amd64', 'x64'],
- ['arm64', 'aarch64']
- ])(
- 'defaults to os.arch(): %s mapped to distro arch: %s',
- async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
-
- const installerOptions: JavaInstallerOptions = {
- version: '17',
- architecture: '', // to get default value
- packageType: 'jdk',
- checkLatest: false
- };
-
- const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
-
- const distribution = new AdoptDistribution(
- installerOptions,
- AdoptImplementation.Hotspot
- );
- const baseUrl =
- 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
- const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
- distribution['getPlatformOption'] = () => 'mac';
-
- await distribution['getAvailableVersions']();
-
- expect(spyHttpClient.mock.calls).toHaveLength(1);
- expect(spyHttpClient.mock.calls[0][0]).toBe(expectedUrl);
- }
- );
-});
-
-describe('findPackageForDownload', () => {
- it.each([
- ['9', '9.0.7+10'],
- ['15', '15.0.2+7'],
- ['15.0', '15.0.2+7'],
- ['15.0.2', '15.0.2+7'],
- ['15.0.1', '15.0.1+9.1'],
- ['11.x', '11.0.10+9'],
- ['x', '15.0.2+7'],
- ['12', '12.0.2+10.3'], // make sure that '12.0.2+10.1', '12.0.2+10.3', '12.0.2+10.2' are sorted correctly
- ['12.0.2+10.1', '12.0.2+10.1'],
- ['15.0.1+9', '15.0.1+9'],
- ['15.0.1+9.1', '15.0.1+9.1']
- ])('version is resolved correctly %s -> %s', async (input, expected) => {
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot
- );
- distribution['getAvailableVersions'] = async () => manifestData as any;
- const resolvedVersion = await distribution['findPackageForDownload'](input);
- expect(resolvedVersion.version).toBe(expected);
- });
-
- it('version is found but binaries list is empty', async () => {
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot
- );
- distribution['getAvailableVersions'] = async () => manifestData as any;
- await expect(
- distribution['findPackageForDownload']('9.0.8')
- ).rejects.toThrow(/Could not find satisfied version for SemVer */);
- });
-
- it('version is not found', async () => {
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot
- );
- distribution['getAvailableVersions'] = async () => manifestData as any;
- await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
- );
- });
-
- it('version list is empty', async () => {
- const distribution = new AdoptDistribution(
- {
- version: '11',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
- },
- AdoptImplementation.Hotspot
- );
- distribution['getAvailableVersions'] = async () => [];
- await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
- );
- });
-});
diff --git a/__tests__/distributors/base-installer.test.ts b/__tests__/distributors/base-installer.test.ts
index b2c610260..1016a8fe6 100644
--- a/__tests__/distributors/base-installer.test.ts
+++ b/__tests__/distributors/base-installer.test.ts
@@ -1,19 +1,113 @@
-import * as tc from '@actions/tool-cache';
-import * as core from '@actions/core';
-import * as util from '../../src/util';
-
-import path from 'path';
-import * as semver from 'semver';
-
-import {JavaBase} from '../../src/distributions/base-installer';
import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {
JavaDownloadRelease,
JavaInstallerOptions,
JavaInstallerResults
-} from '../../src/distributions/base-models';
+} from '../../src/distributions/base-models.js';
+
+import path from 'path';
+import * as semver from 'semver';
+import fs from 'fs';
+import {createHash} from 'crypto';
+import {HttpClient} from '@actions/http-client';
import os from 'os';
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ find: jest.fn(),
+ findAllVersions: jest.fn(),
+ downloadTool: jest.fn(),
+ extractZip: jest.fn(),
+ extractTar: jest.fn(),
+ extract7z: jest.fn(),
+ extractXar: jest.fn(),
+ cacheDir: jest.fn(),
+ cacheFile: jest.fn(),
+ getManifestFromRepo: jest.fn(),
+ findFromManifest: jest.fn(),
+ evaluateVersions: jest.fn(),
+ HTTPError: class HTTPError extends Error {
+ httpStatusCode: number;
+ constructor(statusCode: number) {
+ super(`HTTP Error: ${statusCode}`);
+ this.httpStatusCode = statusCode;
+ }
+ }
+}));
+
+jest.unstable_mockModule('../../src/jdk-cache.js', () => ({
+ getJdkVerificationIdentity: jest.fn(
+ (verified: boolean, enforced: boolean, key?: string) =>
+ verified
+ ? `${enforced ? 'enforced' : 'check-and-warn'}:${key ? 'custom' : 'bundled'}`
+ : 'disabled'
+ ),
+ registerJdk: jest.fn(),
+ restoreJdk: jest.fn()
+}));
+
+jest.unstable_mockModule('../../src/jdk-resolution-cache.js', () => ({
+ registerJdkResolution: jest.fn(),
+ restoreJdkResolution: jest.fn()
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getToolcachePath: jest.fn(),
+ isJobStatusSuccess: jest.fn(),
+ renameWinArchive: jest.fn(),
+ isVersionSatisfies: real_util_module.isVersionSatisfies,
+ getTempDir: real_util_module.getTempDir
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const tc = await import('@actions/tool-cache');
+const util = await import('../../src/util.js');
+const jdkCache = await import('../../src/jdk-cache.js');
+const jdkResolutionCache = await import('../../src/jdk-resolution-cache.js');
+const {getJavaPlatformIdentity} =
+ await import('../../src/distributions/platform-types.js');
+const {JavaBase} = await import('../../src/distributions/base-installer.js');
+
class EmptyJavaBase extends JavaBase {
constructor(installerOptions: JavaInstallerOptions) {
super('Empty', installerOptions);
@@ -38,7 +132,7 @@ class EmptyJavaBase extends JavaBase {
): Promise {
const availableVersion = '11.0.9';
if (!semver.satisfies(availableVersion, range)) {
- throw new Error('Available version not found');
+ throw this.createVersionNotFoundError(range, [availableVersion]);
}
return {
@@ -46,6 +140,58 @@ class EmptyJavaBase extends JavaBase {
url: `some/random_url/java/${availableVersion}`
};
}
+
+ public downloadRelease(javaRelease: JavaDownloadRelease): Promise {
+ return this.downloadAndVerify(javaRelease);
+ }
+
+ public fetchChecksumForTest(
+ checksumUrl: string,
+ algorithm: 'sha256' | 'sha512' | ('sha256' | 'sha512')[]
+ ) {
+ return this.fetchChecksum(checksumUrl, algorithm);
+ }
+}
+
+class FloatingJavaBase extends JavaBase {
+ static actualVersion = '21.0.8+9';
+ static checksum: string | undefined = 'artifact-one';
+ static fingerprint: string | undefined = undefined;
+
+ constructor(installerOptions: JavaInstallerOptions) {
+ super('Floating', installerOptions);
+ }
+
+ protected async downloadTool(): Promise {
+ return {
+ version: FloatingJavaBase.actualVersion,
+ path: path.join(
+ 'toolcache',
+ this.toolcacheFolderName,
+ FloatingJavaBase.actualVersion.replace('+', '-'),
+ this.architecture
+ )
+ };
+ }
+
+ protected async findPackageForDownload(): Promise {
+ return {
+ version: '21',
+ url: 'https://example.com/java/21/latest/jdk-21.tar.gz',
+ checksum: FloatingJavaBase.checksum
+ ? {
+ algorithm: 'sha256',
+ value: FloatingJavaBase.checksum
+ }
+ : undefined,
+ floating: true,
+ fingerprint: FloatingJavaBase.fingerprint
+ };
+ }
+
+ protected requiresRemoteResolution(): boolean {
+ return true;
+ }
}
describe('findInToolcache', () => {
@@ -53,12 +199,12 @@ describe('findInToolcache', () => {
const javaPath = path.join('Java_Empty_jdk', actualJavaVersion, 'x64');
let mockJavaBase: EmptyJavaBase;
- let spyGetToolcachePath: jest.SpyInstance;
- let spyTcFindAllVersions: jest.SpyInstance;
+ let spyGetToolcachePath: any;
+ let spyTcFindAllVersions: any;
beforeEach(() => {
- spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
- spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
+ spyGetToolcachePath = util.getToolcachePath as jest.Mock;
+ spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
});
afterEach(() => {
@@ -241,16 +387,23 @@ describe('setupJava', () => {
let mockJavaBase: EmptyJavaBase;
- let spyGetToolcachePath: jest.SpyInstance;
- let spyTcFindAllVersions: jest.SpyInstance;
- let spyCoreDebug: jest.SpyInstance;
- let spyCoreInfo: jest.SpyInstance;
- let spyCoreExportVariable: jest.SpyInstance;
- let spyCoreAddPath: jest.SpyInstance;
- let spyCoreSetOutput: jest.SpyInstance;
+ let spyGetToolcachePath: any;
+ let spyTcFindAllVersions: any;
+ let spyCoreDebug: any;
+ let spyCoreInfo: any;
+ let spyCoreExportVariable: any;
+ let spyCoreAddPath: any;
+ let spyCoreSetOutput: any;
+ let spyCoreError: any;
beforeEach(() => {
- spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
+ (jdkCache.getJdkVerificationIdentity as jest.Mock).mockImplementation(
+ (verified: boolean, enforced: boolean, key?: string) =>
+ verified
+ ? `${enforced ? 'enforced' : 'check-and-warn'}:${key ? 'custom' : 'bundled'}`
+ : 'disabled'
+ );
+ spyGetToolcachePath = util.getToolcachePath as jest.Mock;
spyGetToolcachePath.mockImplementation(
(toolname: string, javaVersion: string, architecture: string) => {
const semverVersion = new semver.Range(javaVersion);
@@ -268,26 +421,31 @@ describe('setupJava', () => {
}
);
- spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
+ spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
spyTcFindAllVersions.mockReturnValue([installedJavaVersion]);
// Spy on core methods
- spyCoreDebug = jest.spyOn(core, 'debug');
+ spyCoreDebug = core.debug as jest.Mock;
spyCoreDebug.mockImplementation(() => undefined);
- spyCoreInfo = jest.spyOn(core, 'info');
+ spyCoreInfo = core.info as jest.Mock;
spyCoreInfo.mockImplementation(() => undefined);
- spyCoreAddPath = jest.spyOn(core, 'addPath');
+ spyCoreAddPath = core.addPath as jest.Mock;
spyCoreAddPath.mockImplementation(() => undefined);
- spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
+ spyCoreExportVariable = core.exportVariable as jest.Mock;
spyCoreExportVariable.mockImplementation(() => undefined);
- spyCoreSetOutput = jest.spyOn(core, 'setOutput');
+ spyCoreSetOutput = core.setOutput as jest.Mock;
spyCoreSetOutput.mockImplementation(() => undefined);
- jest.spyOn(os, 'arch').mockReturnValue('x86');
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => undefined);
+
+ jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType);
+ FloatingJavaBase.fingerprint = undefined;
});
afterEach(() => {
@@ -344,6 +502,438 @@ describe('setupJava', () => {
expect(spyCoreInfo).not.toHaveBeenCalledWith('Trying to download...');
});
+ it('should resolve the latest version from remote when java-version is "latest", even if a version is cached', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: 'latest',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: actualJavaVersion,
+ path: javaPathInstalled
+ });
+
+ // `latest` must bypass the tool-cache short-circuit and always resolve remotely
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ 'Trying to resolve the latest version from remote'
+ );
+ expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
+ expect(spyCoreInfo).not.toHaveBeenCalledWith(
+ `Resolved Java ${installedJavaVersion} from tool-cache`
+ );
+ });
+
+ describe('floating tool-cache reuse', () => {
+ let toolCacheRoot: string;
+
+ const installVersion = (toolcacheVersion: string): string => {
+ const architecturePath = path.join(
+ toolCacheRoot,
+ 'Java_Floating_jdk',
+ toolcacheVersion,
+ 'x64'
+ );
+ fs.mkdirSync(architecturePath, {recursive: true});
+ fs.writeFileSync(`${architecturePath}.complete`, '');
+ return architecturePath;
+ };
+
+ beforeEach(() => {
+ toolCacheRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-java-tc-'));
+ process.env['RUNNER_TOOL_CACHE'] = toolCacheRoot;
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = 'artifact-one';
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+ spyTcFindAllVersions.mockReturnValue([]);
+ });
+
+ afterEach(() => {
+ fs.rmSync(toolCacheRoot, {recursive: true, force: true});
+ delete process.env['RUNNER_TOOL_CACHE'];
+ });
+
+ const createDistribution = (forceDownload = false) =>
+ new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true,
+ forceDownload
+ });
+
+ it('reuses a tool-cache installation once the resolution cache identifies the floating version', async () => {
+ const installedPath = installVersion('21.0.8-9');
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: {version: '21.0.8+9'}
+ });
+ const distribution = createDistribution();
+ const downloadTool = jest.spyOn(distribution as any, 'downloadTool');
+
+ await expect(distribution.setupJava()).resolves.toEqual({
+ version: '21.0.8+9',
+ path: installedPath
+ });
+
+ // The artifact behind the mutable URL is already installed, so neither a
+ // download nor a cache round-trip is needed.
+ expect(downloadTool).not.toHaveBeenCalled();
+ expect(jdkCache.restoreJdk).not.toHaveBeenCalled();
+ });
+
+ it('ignores a tool-cache installation of a version the resolution cache did not vouch for', async () => {
+ installVersion('21.0.7-6');
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: {version: '21.0.8+9'}
+ });
+ const distribution = createDistribution();
+ const downloadTool = jest.spyOn(distribution as any, 'downloadTool');
+
+ await distribution.setupJava();
+
+ expect(downloadTool).toHaveBeenCalled();
+ });
+
+ it('never reuses the tool-cache for a floating artifact the resolution cache cannot identify', async () => {
+ installVersion('21.0.8-9');
+ spyTcFindAllVersions.mockReturnValue(['21.0.8-9']);
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue(
+ undefined
+ );
+ const distribution = createDistribution();
+ const downloadTool = jest.spyOn(distribution as any, 'downloadTool');
+
+ await distribution.setupJava();
+
+ // Nothing ties the installed bytes to what the URL serves right now.
+ expect(downloadTool).toHaveBeenCalled();
+ });
+
+ it('still downloads a resolution-cache-identified version when force-download is set', async () => {
+ installVersion('21.0.8-9');
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: {version: '21.0.8+9'}
+ });
+ const distribution = createDistribution(true);
+ const downloadTool = jest.spyOn(distribution as any, 'downloadTool');
+
+ await distribution.setupJava();
+
+ expect(downloadTool).toHaveBeenCalled();
+ });
+ });
+
+ it('uses the concrete versions of two different floating artifacts under the same major', async () => {
+ spyTcFindAllVersions.mockReturnValue(['21.0.8-9']);
+ spyGetToolcachePath.mockImplementation(
+ (_toolname: string, version: string, architecture: string) =>
+ path.join('toolcache', 'Java_Floating_jdk', version, architecture)
+ );
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue(
+ undefined
+ );
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = 'artifact-one';
+ const first = new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ });
+ await expect(first.setupJava()).resolves.toEqual({
+ version: '21.0.8+9',
+ path: path.join('toolcache', 'Java_Floating_jdk', '21.0.8-9', 'x64')
+ });
+
+ FloatingJavaBase.actualVersion = '21.0.9+7';
+ FloatingJavaBase.checksum = 'artifact-two';
+ const second = new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ });
+ await expect(second.setupJava()).resolves.toEqual({
+ version: '21.0.9+7',
+ path: path.join('toolcache', 'Java_Floating_jdk', '21.0.9-7', 'x64')
+ });
+
+ expect(spyCoreSetOutput).toHaveBeenNthCalledWith(3, 'version', '21.0.8+9');
+ expect(spyCoreSetOutput).toHaveBeenNthCalledWith(6, 'version', '21.0.9+7');
+ expect(jdkCache.registerJdk).toHaveBeenNthCalledWith(
+ 1,
+ expect.objectContaining({
+ version: '21.0.8+9',
+ source: 'sha256:artifact-one'
+ })
+ );
+ expect(jdkCache.registerJdk).toHaveBeenNthCalledWith(
+ 2,
+ expect.objectContaining({
+ version: '21.0.9+7',
+ source: 'sha256:artifact-two'
+ })
+ );
+ expect(jdkResolutionCache.registerJdkResolution).toHaveBeenNthCalledWith(
+ 2,
+ expect.objectContaining({source: 'sha256:artifact-two'}),
+ expect.objectContaining({version: '21.0.9+7', floating: true})
+ );
+ });
+
+ it('does not trust a matching tool-cache version for a floating artifact', async () => {
+ spyTcFindAllVersions.mockReturnValue(['21.0.8-9']);
+ spyGetToolcachePath.mockReturnValue(
+ path.join('toolcache', 'Java_Floating_jdk', '21.0.8-9', 'x64')
+ );
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: {
+ version: '21.0.8+9',
+ url: 'https://example.com/java/21/latest/jdk-21.tar.gz',
+ checksum: {algorithm: 'sha256', value: 'artifact-republished'},
+ floating: true
+ },
+ fresh: true
+ });
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = 'artifact-republished';
+ const distribution = new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ });
+ const downloadTool = jest.spyOn(distribution as any, 'downloadTool');
+
+ await distribution.setupJava();
+
+ expect(jdkCache.restoreJdk).toHaveBeenCalled();
+ expect(downloadTool).toHaveBeenCalled();
+ });
+
+ it('does not cache a floating artifact with no way to identify its bytes', async () => {
+ spyTcFindAllVersions.mockReturnValue(['21.0.8-9']);
+ spyGetToolcachePath.mockReturnValue(
+ path.join('toolcache', 'Java_Floating_jdk', '21.0.8-9', 'x64')
+ );
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = undefined;
+ FloatingJavaBase.fingerprint = undefined;
+ const distribution = new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ });
+
+ await distribution.setupJava();
+
+ expect(jdkResolutionCache.restoreJdkResolution).not.toHaveBeenCalled();
+ expect(jdkResolutionCache.registerJdkResolution).not.toHaveBeenCalled();
+ expect(jdkCache.restoreJdk).not.toHaveBeenCalled();
+ expect(jdkCache.registerJdk).not.toHaveBeenCalled();
+ });
+
+ it('caches a checksum-less floating artifact identified by its response fingerprint', async () => {
+ spyTcFindAllVersions.mockReturnValue([]);
+ spyGetToolcachePath.mockReturnValue(
+ path.join('toolcache', 'Java_Floating_jdk', '21.0.8-9', 'x64')
+ );
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = undefined;
+ FloatingJavaBase.fingerprint = 'etag:"artifact-one"';
+ const distribution = new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ });
+
+ await distribution.setupJava();
+
+ // The fingerprint changes when the vendor republishes, so it is a safe
+ // identity even though no checksum is available.
+ expect(jdkResolutionCache.registerJdkResolution).toHaveBeenCalledWith(
+ expect.objectContaining({source: 'etag:"artifact-one"'}),
+ expect.objectContaining({version: '21.0.8+9'})
+ );
+ expect(jdkCache.registerJdk).toHaveBeenCalledWith(
+ expect.objectContaining({source: 'etag:"artifact-one"'})
+ );
+ });
+
+ it('separates the cache identities of two builds served by the same floating URL', async () => {
+ const sources: string[] = [];
+ (jdkCache.registerJdk as jest.Mock).mockImplementation((entry: any) => {
+ sources.push(entry.source);
+ });
+ spyTcFindAllVersions.mockReturnValue([]);
+ spyGetToolcachePath.mockReturnValue(
+ path.join('toolcache', 'Java_Floating_jdk', '21.0.8-9', 'x64')
+ );
+ FloatingJavaBase.actualVersion = '21.0.8+9';
+ FloatingJavaBase.checksum = undefined;
+
+ for (const fingerprint of ['etag:"before"', 'etag:"after"']) {
+ FloatingJavaBase.fingerprint = fingerprint;
+ await new FloatingJavaBase({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ }).setupJava();
+ }
+
+ expect(sources).toEqual(['etag:"before"', 'etag:"after"']);
+ });
+
+ it('should download java when force-download is enabled, even if the version is cached', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: actualJavaVersion,
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ forceDownload: true,
+ cacheJdk: true
+ });
+
+ const findInToolcache = jest.fn(() => ({
+ version: actualJavaVersion,
+ path: javaPathInstalled
+ }));
+ mockJavaBase['findInToolcache'] = findInToolcache;
+
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: actualJavaVersion,
+ path: javaPathInstalled
+ });
+
+ expect(findInToolcache).not.toHaveBeenCalled();
+ expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ `Java ${actualJavaVersion} was downloaded`
+ );
+ expect(spyCoreInfo).not.toHaveBeenCalledWith(
+ `Resolved Java ${actualJavaVersion} from tool-cache`
+ );
+ expect(jdkCache.restoreJdk).not.toHaveBeenCalled();
+ expect(jdkCache.registerJdk).toHaveBeenCalledWith(
+ expect.objectContaining({
+ version: actualJavaVersion,
+ verification: 'disabled'
+ })
+ );
+ });
+
+ it.each([
+ [false, false, false, false],
+ [false, true, true, true],
+ [true, false, false, false],
+ [true, true, false, true]
+ ])(
+ 'handles force-download=%s and cache-jdk=%s',
+ async (forceDownload, cacheJdkEnabled, restores, registers) => {
+ mockJavaBase = new EmptyJavaBase({
+ version: actualJavaVersion,
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: true,
+ forceDownload,
+ cacheJdk: cacheJdkEnabled
+ });
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkCache.restoreJdk).toHaveBeenCalledTimes(restores ? 1 : 0);
+ expect(jdkCache.registerJdk).toHaveBeenCalledTimes(registers ? 1 : 0);
+ }
+ );
+
+ it('restores the exact resolved JDK before downloading', async () => {
+ const toolCachePath = path.join('toolcache');
+ jest.replaceProperty(process, 'env', {
+ ...process.env,
+ RUNNER_TOOL_CACHE: toolCachePath
+ });
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: true,
+ cacheJdk: true
+ });
+ const downloadTool = jest.spyOn(mockJavaBase as any, 'downloadTool');
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(true);
+ jest
+ .spyOn(mockJavaBase as any, 'getRestoredJdkPath')
+ .mockReturnValue(javaPathInstalled);
+
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: actualJavaVersion,
+ path: javaPathInstalled
+ });
+
+ expect(jdkCache.restoreJdk).toHaveBeenCalledWith({
+ distribution: 'Empty',
+ packageType: 'jdk',
+ architecture: 'x86',
+ version: actualJavaVersion,
+ source: `some/random_url/java/${actualJavaVersion}`,
+ verification: 'disabled',
+ path: path.join(toolCachePath, 'Java_Empty_jdk', actualJavaVersion)
+ });
+ expect(downloadTool).not.toHaveBeenCalled();
+ expect(spyCoreInfo).not.toHaveBeenCalledWith('Trying to download...');
+ // A restored entry is already stored under its key; it must not be
+ // re-registered for a post-job save.
+ expect(jdkCache.registerJdk).not.toHaveBeenCalled();
+ });
+
+ it('registers the downloaded JDK identity after a JDK cache miss', async () => {
+ const toolCachePath = path.join('toolcache');
+ jest.replaceProperty(process, 'env', {
+ ...process.env,
+ RUNNER_TOOL_CACHE: toolCachePath
+ });
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: true,
+ cacheJdk: true
+ });
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+
+ await mockJavaBase.setupJava();
+
+ const expectedIdentity = {
+ distribution: 'Empty',
+ packageType: 'jdk',
+ architecture: 'x86',
+ version: actualJavaVersion,
+ source: `some/random_url/java/${actualJavaVersion}`,
+ verification: 'disabled',
+ path: path.join(toolCachePath, 'Java_Empty_jdk', actualJavaVersion)
+ };
+ expect(jdkCache.restoreJdk).toHaveBeenCalledWith(expectedIdentity);
+ // Registration happens after the installation exists, so the post-job save
+ // can detect a later step replacing it.
+ expect(jdkCache.registerJdk).toHaveBeenCalledWith(expectedIdentity);
+ expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
+ });
+
it.each([
[
{
@@ -459,6 +1049,49 @@ describe('setupJava', () => {
}
);
+ it('should fail when verify-signature is enabled for unsupported distributions', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ });
+
+ await expect(mockJavaBase.setupJava()).rejects.toThrow(
+ "Input 'verify-signature' is not supported for distribution 'Empty'."
+ );
+ expect(spyTcFindAllVersions).not.toHaveBeenCalled();
+ expect(spyCoreAddPath).not.toHaveBeenCalled();
+ expect(spyCoreExportVariable).not.toHaveBeenCalled();
+ expect(spyCoreSetOutput).not.toHaveBeenCalled();
+ });
+
+ it('should not repeat version resolution when downloadTool fails', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ forceDownload: true
+ });
+ const findPackageForDownload = jest.fn(async () => ({
+ version: '11.0.9',
+ url: 'https://example.com/jdk.tar.gz'
+ }));
+ const downloadError = new Error('download failed');
+ const downloadTool = jest.fn(async () => {
+ throw downloadError;
+ });
+ mockJavaBase['findPackageForDownload'] = findPackageForDownload;
+ mockJavaBase['downloadTool'] = downloadTool;
+
+ await expect(mockJavaBase.setupJava()).rejects.toBe(downloadError);
+
+ expect(findPackageForDownload).toHaveBeenCalledTimes(1);
+ expect(downloadTool).toHaveBeenCalledTimes(1);
+ });
+
it.each([
[
{
@@ -530,30 +1163,606 @@ describe('setupJava', () => {
checkLatest: false
}
]
- ])(
- 'should throw an error for Available version not found for %s',
- async input => {
- mockJavaBase = new EmptyJavaBase(input);
+ ])('should throw an error for version not found for %s', async input => {
+ mockJavaBase = new EmptyJavaBase(input);
+ await expect(mockJavaBase.setupJava()).rejects.toThrow(
+ `No matching version found for SemVer '${input.version}'`
+ );
+ expect(spyTcFindAllVersions).toHaveBeenCalled();
+ expect(spyCoreAddPath).not.toHaveBeenCalled();
+ expect(spyCoreExportVariable).not.toHaveBeenCalled();
+ expect(spyCoreSetOutput).not.toHaveBeenCalled();
+ });
+
+ it('should not set JAVA_HOME and PATH when setDefault is false', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ setDefault: false
+ });
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: installedJavaVersion,
+ path: javaPath
+ });
+ expect(spyCoreExportVariable).not.toHaveBeenCalledWith(
+ 'JAVA_HOME',
+ expect.anything()
+ );
+ expect(spyCoreAddPath).not.toHaveBeenCalled();
+ expect(spyCoreExportVariable).toHaveBeenCalledWith(
+ 'JAVA_HOME_11_X86',
+ javaPath
+ );
+ expect(spyCoreSetOutput).toHaveBeenCalledWith(
+ 'version',
+ installedJavaVersion
+ );
+ expect(spyCoreSetOutput).toHaveBeenCalledWith('path', javaPath);
+ expect(spyCoreSetOutput).toHaveBeenCalledWith('distribution', 'Empty');
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ `Installing Java ${installedJavaVersion} (not setting as default)`
+ );
+ });
+
+ it('should set JAVA_HOME and PATH when setDefault is true', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ setDefault: true
+ });
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: installedJavaVersion,
+ path: javaPath
+ });
+ expect(spyCoreExportVariable).toHaveBeenCalledWith('JAVA_HOME', javaPath);
+ expect(spyCoreAddPath).toHaveBeenCalledWith(path.join(javaPath, 'bin'));
+ expect(spyCoreExportVariable).toHaveBeenCalledWith(
+ 'JAVA_HOME_11_X86',
+ javaPath
+ );
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ `Setting Java ${installedJavaVersion} as the default`
+ );
+ });
+
+ it('should default to setting as default when setDefault is not specified', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: installedJavaVersion,
+ path: javaPath
+ });
+ expect(spyCoreExportVariable).toHaveBeenCalledWith('JAVA_HOME', javaPath);
+ expect(spyCoreAddPath).toHaveBeenCalledWith(path.join(javaPath, 'bin'));
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ `Setting Java ${installedJavaVersion} as the default`
+ );
+ });
+
+ it('should download and not set default when setDefault is false', async () => {
+ mockJavaBase = new EmptyJavaBase({
+ version: '11',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ setDefault: false
+ });
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: '11.0.9',
+ path: path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64')
+ });
+ expect(spyCoreExportVariable).not.toHaveBeenCalledWith(
+ 'JAVA_HOME',
+ expect.anything()
+ );
+ expect(spyCoreAddPath).not.toHaveBeenCalled();
+ expect(spyCoreExportVariable).toHaveBeenCalledWith(
+ 'JAVA_HOME_11_X64',
+ path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64')
+ );
+ expect(spyCoreSetOutput).toHaveBeenCalledWith('version', '11.0.9');
+ expect(spyCoreSetOutput).toHaveBeenCalledWith(
+ 'path',
+ path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64')
+ );
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ 'Installing Java 11.0.9 (not setting as default)'
+ );
+ });
+
+ describe('resolution cache', () => {
+ // 11.0.9 is not in the mocked tool-cache, so the tool-cache short-circuit
+ // misses and the release has to be resolved, exactly as it does for every
+ // distribution that is not preinstalled on hosted runners.
+ const options: JavaInstallerOptions = {
+ version: '11.0.9',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ cacheJdk: true
+ };
+ const cachedRelease = {
+ version: '11.0.9',
+ url: 'https://example.com/java/11.0.9'
+ };
+
+ const expectedRequest = {
+ distribution: 'Empty',
+ packageType: 'jdk',
+ platform: getJavaPlatformIdentity(),
+ architecture: 'x86',
+ versionSpec: '11.0.9',
+ stable: true
+ };
+
+ beforeEach(() => {
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue(
+ undefined
+ );
+ });
+
+ it('skips the metadata API on a fresh cached resolution', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+ const findPackageForDownload = jest.spyOn(
+ mockJavaBase as any,
+ 'findPackageForDownload'
+ );
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: cachedRelease,
+ fresh: true
+ });
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkResolutionCache.restoreJdkResolution).toHaveBeenCalledWith(
+ expectedRequest
+ );
+ expect(findPackageForDownload).not.toHaveBeenCalled();
+ expect(jdkResolutionCache.registerJdkResolution).not.toHaveBeenCalled();
+ expect(spyCoreInfo).toHaveBeenCalledWith(
+ 'Resolved Empty 11.0.9 from the resolution cache'
+ );
+ });
+
+ it('re-resolves and records the release on a miss', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkResolutionCache.registerJdkResolution).toHaveBeenCalledWith(
+ expectedRequest,
+ {version: '11.0.9', url: 'some/random_url/java/11.0.9'}
+ );
+ });
+
+ it('re-resolves when the cached resolution is stale', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+ const findPackageForDownload = jest.spyOn(
+ mockJavaBase as any,
+ 'findPackageForDownload'
+ );
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: cachedRelease,
+ fresh: false
+ });
+
+ await mockJavaBase.setupJava();
+
+ expect(findPackageForDownload).toHaveBeenCalled();
+ expect(jdkResolutionCache.registerJdkResolution).toHaveBeenCalled();
+ });
+
+ it('falls back to a stale resolution when the metadata API fails', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+ const downloadTool = jest
+ .spyOn(mockJavaBase as any, 'downloadTool')
+ .mockResolvedValue({version: '11.0.9', path: javaPathInstalled});
+ jest
+ .spyOn(mockJavaBase as any, 'findPackageForDownload')
+ .mockRejectedValue(new Error('503 Service Unavailable'));
+ (jdkResolutionCache.restoreJdkResolution as jest.Mock).mockResolvedValue({
+ release: cachedRelease,
+ fresh: false
+ });
+
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: '11.0.9',
+ path: javaPathInstalled
+ });
+
+ expect(downloadTool).toHaveBeenCalledWith(cachedRelease);
+ expect(jdkResolutionCache.registerJdkResolution).not.toHaveBeenCalled();
+ expect(core.warning).toHaveBeenCalledWith(
+ expect.stringContaining('falling back to the cached resolution')
+ );
+ });
+
+ it('fails when the metadata API fails and nothing was cached', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+ jest
+ .spyOn(mockJavaBase as any, 'findPackageForDownload')
+ .mockRejectedValue(new Error('503 Service Unavailable'));
+
await expect(mockJavaBase.setupJava()).rejects.toThrow(
- 'Available version not found'
+ '503 Service Unavailable'
+ );
+ });
+
+ it('records the concrete version for a checksum-bound floating release', async () => {
+ mockJavaBase = new EmptyJavaBase(options);
+ jest
+ .spyOn(mockJavaBase as any, 'findPackageForDownload')
+ .mockResolvedValue({
+ version: '11.0.9',
+ url: 'https://example.com/java/11/latest/jdk-11.tar.gz',
+ checksum: {algorithm: 'sha256', value: 'abc'},
+ floating: true
+ });
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkResolutionCache.registerJdkResolution).toHaveBeenCalledWith(
+ {
+ distribution: 'Empty',
+ packageType: 'jdk',
+ platform: getJavaPlatformIdentity(),
+ architecture: 'x86',
+ versionSpec: '11.0.9',
+ stable: true,
+ source: 'sha256:abc'
+ },
+ {
+ version: '11.0.9',
+ url: 'https://example.com/java/11/latest/jdk-11.tar.gz',
+ checksum: {algorithm: 'sha256', value: 'abc'},
+ floating: true
+ }
+ );
+ });
+
+ it.each([
+ ['cache-jdk is disabled', {cacheJdk: false}],
+ ['check-latest is enabled', {checkLatest: true}],
+ ['force-download is enabled', {forceDownload: true}],
+ ['java-version is "latest"', {version: 'latest'}]
+ ])('is bypassed when %s', async (_name, overrides) => {
+ mockJavaBase = new EmptyJavaBase({...options, ...overrides});
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkResolutionCache.restoreJdkResolution).not.toHaveBeenCalled();
+ expect(jdkResolutionCache.registerJdkResolution).not.toHaveBeenCalled();
+ });
+ });
+});
+
+describe('downloadAndVerify', () => {
+ const options: JavaInstallerOptions = {
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ };
+ let temporaryDirectory: string;
+ let archivePath: string;
+
+ beforeEach(async () => {
+ temporaryDirectory = await fs.promises.mkdtemp(
+ path.join(os.tmpdir(), 'setup-java-base-')
+ );
+ archivePath = path.join(temporaryDirectory, 'archive');
+ await fs.promises.writeFile(archivePath, 'downloaded archive');
+ (tc.downloadTool as jest.Mock).mockResolvedValue(archivePath);
+ });
+
+ afterEach(async () => {
+ await fs.promises.rm(temporaryDirectory, {recursive: true, force: true});
+ jest.resetAllMocks();
+ });
+
+ it('returns a download after successful verification', async () => {
+ const distribution = new EmptyJavaBase(options);
+ const result = await distribution.downloadRelease({
+ version: '21.0.8',
+ url: 'https://vendor.example/jdk.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value: createHash('sha256').update('downloaded archive').digest('hex')
+ }
+ });
+
+ expect(result).toBe(archivePath);
+ expect(fs.existsSync(archivePath)).toBe(true);
+ expect(core.debug).toHaveBeenCalledWith(
+ 'Verified sha256 checksum for Empty version 21.0.8.'
+ );
+ });
+
+ it('removes the download after verification failure', async () => {
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.downloadRelease({
+ version: '21.0.8',
+ url: 'https://vendor.example/jdk.tar.gz?token=secret',
+ checksum: {algorithm: 'sha256', value: 'a'.repeat(64)}
+ })
+ ).rejects.toThrow('Checksum verification failed for Empty version 21.0.8');
+
+ expect(fs.existsSync(archivePath)).toBe(false);
+ });
+
+ it('preserves the verification error when removing the download fails', async () => {
+ const distribution = new EmptyJavaBase(options);
+ const cleanupError = new Error('cleanup failed');
+ jest.spyOn(fs.promises, 'rm').mockRejectedValueOnce(cleanupError);
+
+ const result = distribution.downloadRelease({
+ version: '21.0.8',
+ url: 'https://vendor.example/jdk.tar.gz',
+ checksum: {algorithm: 'sha256', value: 'a'.repeat(64)}
+ });
+
+ await expect(result).rejects.toMatchObject({
+ message: expect.stringContaining(
+ 'Failed to remove the downloaded archive after verification failure: cleanup failed'
+ ),
+ cause: expect.objectContaining({
+ message: expect.stringContaining(
+ 'Checksum verification failed for Empty version 21.0.8'
+ )
+ })
+ });
+ });
+
+ it('logs when authoritative checksum metadata is unavailable', async () => {
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.downloadRelease({
+ version: '21.0.8',
+ url: 'https://vendor.example/jdk.tar.gz'
+ })
+ ).resolves.toBe(archivePath);
+
+ expect(core.debug).toHaveBeenCalledWith(
+ 'No authoritative checksum is available for Empty version 21.0.8; skipping checksum verification.'
+ );
+ });
+
+ it.each([undefined, '', ' '])(
+ 'skips verification when the vendor digest is %p',
+ async value => {
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.downloadRelease({
+ version: '21.0.8',
+ url: 'https://vendor.example/jdk.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value
+ } as JavaDownloadRelease['checksum']
+ })
+ ).resolves.toBe(archivePath);
+
+ expect(core.debug).toHaveBeenCalledWith(
+ 'No authoritative checksum is available for Empty version 21.0.8; skipping checksum verification.'
);
- expect(spyTcFindAllVersions).toHaveBeenCalled();
- expect(spyCoreAddPath).not.toHaveBeenCalled();
- expect(spyCoreExportVariable).not.toHaveBeenCalled();
- expect(spyCoreSetOutput).not.toHaveBeenCalled();
}
);
});
+describe('fetchChecksum', () => {
+ const options: JavaInstallerOptions = {
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ };
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ function mockGet(statusCode: number, body: string) {
+ return jest.spyOn(HttpClient.prototype, 'get').mockResolvedValue({
+ message: {statusCode},
+ readBody: async () => body
+ } as any);
+ }
+
+ it('parses a bare hex digest', async () => {
+ const digest = 'a'.repeat(64);
+ const spy = mockGet(200, digest);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.sha256',
+ 'sha256'
+ );
+
+ expect(spy).toHaveBeenCalledWith(
+ 'https://vendor.example/jdk.tar.gz.sha256'
+ );
+ expect(checksum).toEqual({
+ algorithm: 'sha256',
+ value: digest,
+ source: 'https://vendor.example/jdk.tar.gz.sha256'
+ });
+ });
+
+ it('parses only the first token of a GNU-style checksum file', async () => {
+ const digest = 'b'.repeat(128);
+ mockGet(200, `${digest} jbrsdk-21.0.3-linux-x64-b465.3.tar.gz\n`);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.checksum',
+ 'sha512'
+ );
+
+ expect(checksum).toEqual({
+ algorithm: 'sha512',
+ value: digest,
+ source: 'https://vendor.example/jdk.tar.gz.checksum'
+ });
+ });
+
+ it('trims surrounding whitespace and newlines', async () => {
+ const digest = 'c'.repeat(64);
+ mockGet(200, `\n ${digest} \n`);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.sha256',
+ 'sha256'
+ );
+
+ expect(checksum.value).toBe(digest);
+ });
+
+ it('skips verification when the sibling checksum is not published', async () => {
+ mockGet(404, 'Not Found');
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.sha256',
+ 'sha256'
+ )
+ ).resolves.toBeUndefined();
+ expect(core.debug).toHaveBeenCalledWith(
+ 'No authoritative sha256 checksum is available for Empty from https://vendor.example/jdk.tar.gz.sha256; skipping checksum verification.'
+ );
+ });
+
+ it('surfaces unexpected HTTP failures without query parameters', async () => {
+ mockGet(500, 'Server Error');
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.sha256?token=secret',
+ 'sha256'
+ )
+ ).rejects.toThrow(
+ 'Failed to fetch the authoritative sha256 checksum for Empty from https://vendor.example/jdk.tar.gz.sha256 (HTTP 500).'
+ );
+ });
+
+ it('rejects an empty successful checksum response', async () => {
+ mockGet(200, ' \n');
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.fetchChecksumForTest(
+ 'https://vendor.example/jdk.tar.gz.sha256',
+ 'sha256'
+ )
+ ).rejects.toThrow(
+ 'Received an empty authoritative sha256 checksum for Empty from https://vendor.example/jdk.tar.gz.sha256.'
+ );
+ });
+
+ describe('with a list of candidate algorithms', () => {
+ it('infers sha512 when the digest is 128 hex characters', async () => {
+ const digest = 'd'.repeat(128);
+ mockGet(200, `${digest} jbrsdk.tar.gz\n`);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jbrsdk.tar.gz.checksum',
+ ['sha512', 'sha256']
+ );
+
+ expect(checksum).toEqual({
+ algorithm: 'sha512',
+ value: digest,
+ source: 'https://vendor.example/jbrsdk.tar.gz.checksum'
+ });
+ });
+
+ it('infers sha256 when the digest is 64 hex characters, even though sha512 was preferred', async () => {
+ // Reproduces older JetBrains JBR builds (e.g. JBR 11), which publish a
+ // SHA-256 digest at the generic `.checksum` sibling instead of SHA-512.
+ const digest = 'e'.repeat(64);
+ mockGet(200, `${digest} jbrsdk_nomod-11_0_16-osx-x64-b2043.64.tar.gz\n`);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jbrsdk_nomod-11_0_16-osx-x64-b2043.64.tar.gz.checksum',
+ ['sha512', 'sha256']
+ );
+
+ expect(checksum).toEqual({
+ algorithm: 'sha256',
+ value: digest,
+ source:
+ 'https://vendor.example/jbrsdk_nomod-11_0_16-osx-x64-b2043.64.tar.gz.checksum'
+ });
+ });
+
+ it('falls back to the first candidate algorithm when the digest length matches none of them', async () => {
+ const digest = 'f'.repeat(40); // e.g. sha1, not supported
+ mockGet(200, `${digest} jbrsdk.tar.gz\n`);
+ const distribution = new EmptyJavaBase(options);
+
+ const checksum = await distribution.fetchChecksumForTest(
+ 'https://vendor.example/jbrsdk.tar.gz.checksum',
+ ['sha512', 'sha256']
+ );
+
+ // No candidate algorithm matches, so the first-listed one is kept;
+ // downstream verification will reject it as malformed.
+ expect(checksum.algorithm).toBe('sha512');
+ expect(checksum.value).toBe(digest);
+ });
+
+ it('reports the checksum as unavailable using a combined algorithm label on 404', async () => {
+ mockGet(404, 'Not Found');
+ const distribution = new EmptyJavaBase(options);
+
+ await expect(
+ distribution.fetchChecksumForTest(
+ 'https://vendor.example/jbrsdk.tar.gz.checksum',
+ ['sha512', 'sha256']
+ )
+ ).resolves.toBeUndefined();
+ expect(core.debug).toHaveBeenCalledWith(
+ 'No authoritative sha512 or sha256 checksum is available for Empty from https://vendor.example/jbrsdk.tar.gz.checksum; skipping checksum verification.'
+ );
+ });
+ });
+});
+
describe('normalizeVersion', () => {
const DummyJavaBase = JavaBase as any;
it.each([
- ['11', {version: '11', stable: true}],
- ['11.0', {version: '11.0', stable: true}],
- ['11.0.10', {version: '11.0.10', stable: true}],
- ['11-ea', {version: '11', stable: false}],
- ['11.0.2-ea', {version: '11.0.2', stable: false}]
+ ['11', {version: '11', stable: true, latest: false}],
+ ['11.0', {version: '11.0', stable: true, latest: false}],
+ ['11.0.10', {version: '11.0.10', stable: true, latest: false}],
+ ['11-ea', {version: '11', stable: false, latest: false}],
+ ['11.0.2-ea', {version: '11.0.2', stable: false, latest: false}],
+ ['18.0.1.1', {version: '18.0.1+1', stable: true, latest: false}],
+ ['11.0.9.1', {version: '11.0.9+1', stable: true, latest: false}],
+ ['12.0.2.1.0', {version: '12.0.2+1.0', stable: true, latest: false}],
+ ['18.0.1.1-ea', {version: '18.0.1+1', stable: false, latest: false}],
+ ['26.0.2.1+1', {version: '26.0.2+1.1', stable: true, latest: false}],
+ ['25.0.4.1+1', {version: '25.0.4+1.1', stable: true, latest: false}],
+ ['latest', {version: 'x', stable: true, latest: true}],
+ ['LATEST', {version: 'x', stable: true, latest: true}],
+ [' Latest ', {version: 'x', stable: true, latest: true}]
])('normalizeVersion from %s to %s', (input, expected) => {
expect(DummyJavaBase.prototype.normalizeVersion.call(null, input)).toEqual(
expected
@@ -568,6 +1777,108 @@ describe('normalizeVersion', () => {
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
);
});
+
+ it.each(['latest-ea', 'latest.1', 'LATEST-EA', ' latest-ea '])(
+ 'normalizeVersion should throw a targeted error for latest combined with a qualifier (%s)',
+ version => {
+ expect(
+ DummyJavaBase.prototype.normalizeVersion.bind(null, version)
+ ).toThrow(
+ `The 'latest' alias resolves stable (GA) releases only and cannot be combined with '-ea' or other qualifiers (received '${version}'). Use 'latest' on its own, or specify a concrete version.`
+ );
+ }
+ );
+});
+
+describe('createVersionNotFoundError', () => {
+ it('should include all required fields in error message without available versions', () => {
+ const mockJavaBase = new EmptyJavaBase({
+ version: '17.0.5',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const error = (mockJavaBase as any).createVersionNotFoundError('17.0.5');
+
+ expect(error.message).toContain(
+ "No matching version found for SemVer '17.0.5'"
+ );
+ expect(error.message).toContain('Distribution: Empty');
+ expect(error.message).toContain('Package type: jdk');
+ expect(error.message).toContain('Architecture: x64');
+ });
+
+ it('should include available versions when provided', () => {
+ const mockJavaBase = new EmptyJavaBase({
+ version: '17.0.5',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const availableVersions = ['11.0.1', '11.0.2', '17.0.1', '17.0.2'];
+ const error = (mockJavaBase as any).createVersionNotFoundError(
+ '17.0.5',
+ availableVersions
+ );
+
+ expect(error.message).toContain(
+ "No matching version found for SemVer '17.0.5'"
+ );
+ expect(error.message).toContain('Distribution: Empty');
+ expect(error.message).toContain('Package type: jdk');
+ expect(error.message).toContain('Architecture: x64');
+ expect(error.message).toContain(
+ 'Available versions: 11.0.1, 11.0.2, 17.0.1, 17.0.2'
+ );
+ });
+
+ it('should truncate available versions when there are many', () => {
+ const mockJavaBase = new EmptyJavaBase({
+ version: '17.0.5',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ // Create 60 versions to test truncation
+ const availableVersions = Array.from({length: 60}, (_, i) => `11.0.${i}`);
+ const error = (mockJavaBase as any).createVersionNotFoundError(
+ '17.0.5',
+ availableVersions
+ );
+
+ expect(error.message).toContain('Available versions:');
+ expect(error.message).toContain('...');
+ expect(error.message).toContain('(showing first 50 of 60 versions');
+ });
+
+ it('should include additional context when provided', () => {
+ const mockJavaBase = new EmptyJavaBase({
+ version: '17.0.5',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const availableVersions = ['11.0.1', '11.0.2'];
+ const additionalContext = 'Platform: linux';
+ const error = (mockJavaBase as any).createVersionNotFoundError(
+ '17.0.5',
+ availableVersions,
+ additionalContext
+ );
+
+ expect(error.message).toContain(
+ "No matching version found for SemVer '17.0.5'"
+ );
+ expect(error.message).toContain('Distribution: Empty');
+ expect(error.message).toContain('Package type: jdk');
+ expect(error.message).toContain('Architecture: x64');
+ expect(error.message).toContain('Platform: linux');
+ expect(error.message).toContain('Available versions: 11.0.1, 11.0.2');
+ });
});
describe('getToolcacheVersionName', () => {
diff --git a/__tests__/distributors/corretto-installer.test.ts b/__tests__/distributors/corretto-installer.test.ts
index a8ffef229..416c21607 100644
--- a/__tests__/distributors/corretto-installer.test.ts
+++ b/__tests__/distributors/corretto-installer.test.ts
@@ -1,16 +1,63 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import fs from 'fs';
+import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
import {HttpClient} from '@actions/http-client';
-import {JavaInstallerOptions} from '../../src/distributions/base-models';
-import {CorrettoDistribution} from '../../src/distributions/corretto/installer';
-import * as util from '../../src/util';
import os from 'os';
-import {isGeneratorFunction} from 'util/types';
-import manifestData from '../data/corretto.json';
+import manifestData from '../data/corretto.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {CorrettoDistribution} =
+ await import('../../src/distributions/corretto/installer.js');
+const util = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: ReturnType;
+ let spyGetDownloadArchiveExtension: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -19,10 +66,12 @@ describe('getAvailableVersions', () => {
headers: {},
result: manifestData
});
- spyGetDownloadArchiveExtension = jest.spyOn(
- util,
- 'getDownloadArchiveExtension'
- );
+ spyGetDownloadArchiveExtension =
+ util.getDownloadArchiveExtension as jest.Mock;
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -150,11 +199,34 @@ describe('getAvailableVersions', () => {
});
mockPlatform(distribution, platform);
- const availableVersion = await distribution['findPackageForDownload'](
- version
- );
+ const availableVersion =
+ await distribution['findPackageForDownload'](version);
expect(availableVersion).not.toBeNull();
expect(availableVersion.url).toBe(expectedLink);
+ expect(availableVersion.checksum).toEqual({
+ algorithm: 'sha256',
+ value: expect.stringMatching(/^[a-f0-9]{64}$/),
+ source:
+ 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'
+ });
+ });
+
+ it('with latest resolves to the newest available major version', async () => {
+ const distribution = new CorrettoDistribution({
+ version: 'latest',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ const availableVersion =
+ await distribution['findPackageForDownload']('x');
+ expect(availableVersion).not.toBeNull();
+ // 18 is the newest major present in the mocked Corretto index
+ expect(availableVersion.url).toBe(
+ 'https://corretto.aws/downloads/resources/18.0.0.37.1/amazon-corretto-18.0.0.37.1-linux-x64.tar.gz'
+ );
});
it('with unstable version expect to throw not supported error', async () => {
@@ -172,19 +244,282 @@ describe('getAvailableVersions', () => {
).rejects.toThrow('Early access versions are not supported');
});
- it('with non major version expect to throw not supported error', async () => {
- const version = '18.0.1';
+ it.each(['18.0.1', '17.0.13.11', '17.0.13.11.1.1'])(
+ 'rejects partial or malformed release %s',
+ async version => {
+ const distribution = new CorrettoDistribution({
+ version,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ await expect(
+ distribution['findPackageForDownload'](version)
+ ).rejects.toThrow(
+ 'Specify a major version or a full Corretto release, such as 25.0.5.0.10'
+ );
+ }
+ );
+
+ it.each([
+ [
+ '25.0.5.0.10',
+ 'linux',
+ 'x64',
+ 'jdk',
+ '25.0.5+0.10',
+ 'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-linux-x64.tar.gz'
+ ],
+ [
+ '25.0.5+0.10',
+ 'macos',
+ 'arm64',
+ 'jdk',
+ '25.0.5+0.10',
+ 'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-macosx-aarch64.tar.gz'
+ ],
+ [
+ '17.0.2.8.1',
+ 'windows',
+ 'x64',
+ 'jdk',
+ '17.0.2+8.1',
+ 'https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-windows-x64-jdk.zip'
+ ],
+ [
+ '25.0.5.0.10',
+ 'alpine',
+ 'aarch64',
+ 'jdk',
+ '25.0.5+0.10',
+ 'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-alpine-linux-aarch64.tar.gz'
+ ],
+ [
+ '11.0.14.10.1',
+ 'linux',
+ 'armv7',
+ 'jdk',
+ '11.0.14+10.1',
+ 'https://corretto.aws/downloads/resources/11.0.14.10.1/amazon-corretto-11.0.14.10.1-linux-armv7.tar.gz'
+ ],
+ [
+ '8.472.8+1',
+ 'linux',
+ 'x64',
+ 'jdk',
+ '8.472.8+1',
+ 'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-linux-x64.tar.gz'
+ ],
+ [
+ '8.472.08.1',
+ 'linux',
+ 'x64',
+ 'jdk',
+ '8.472.8+1',
+ 'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-linux-x64.tar.gz'
+ ],
+ [
+ '8.472.08.1',
+ 'windows',
+ 'x86',
+ 'jre',
+ '8.472.8+1',
+ 'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-windows-x86-jre.zip'
+ ]
+ ])(
+ 'resolves exact release %s on %s/%s (%s)',
+ async (
+ requestedVersion,
+ platform,
+ architecture,
+ packageType,
+ expectedVersion,
+ url
+ ) => {
+ const checksum = 'a'.repeat(64);
+ spyHttpClient.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {
+ body: `|JDK|[archive](${url})|\`md5\` /
\`${checksum}\`|`
+ }
+ });
+ const distribution = new CorrettoDistribution({
+ version: requestedVersion,
+ architecture,
+ packageType,
+ checkLatest: false
+ });
+ mockPlatform(distribution, platform);
+
+ const release = await distribution['findPackageForDownload'](
+ distribution['version']
+ );
+ const rawVersion = new URL(url).pathname.split('/')[3];
+ const source = `https://api.github.com/repos/corretto/corretto-${rawVersion.split('.')[0]}/releases/tags/${rawVersion}`;
+ expect(release).toEqual({
+ version: expectedVersion,
+ url,
+ checksum: {algorithm: 'sha256', value: checksum, source}
+ });
+ expect(spyHttpClient).toHaveBeenCalledTimes(1);
+ expect(spyHttpClient).toHaveBeenCalledWith(
+ source,
+ expect.objectContaining({accept: 'application/vnd.github+json'})
+ );
+ }
+ );
+
+ it('rejects exact releases without an archive for the requested platform', async () => {
+ spyHttpClient.mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: {
+ body:
+ '|[other archive](https://example.com/archive)|`' +
+ 'a'.repeat(64) +
+ '`|'
+ }
+ });
const distribution = new CorrettoDistribution({
- version,
+ version: '25.0.5.0.10',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(
+ 'No linux/x64 jdk archive is listed for Corretto 25.0.5.0.10'
+ );
+ });
+
+ it('rejects historical archives with only an MD5 checksum', async () => {
+ spyHttpClient.mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: {
+ body:
+ '|[archive](https://corretto.aws/downloads/resources/17.0.1.12.1/amazon-corretto-17.0.1.12.1-linux-x64.tar.gz)|`' +
+ 'a'.repeat(32) +
+ '`|'
+ }
+ });
+ const distribution = new CorrettoDistribution({
+ version: '17.0.1.12.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(
+ 'No SHA-256 checksum is published for Corretto 17.0.1.12.1 (linux, x64, jdk)'
+ );
+ });
+ it('does not substitute a JDK for an exact Linux JRE request', async () => {
+ const distribution = new CorrettoDistribution({
+ version: '25.0.5.0.10',
+ architecture: 'x64',
+ packageType: 'jre',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
await expect(
- distribution['findPackageForDownload'](version)
- ).rejects.toThrow('Only major versions are supported');
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow('Corretto JRE archives are only available for Windows');
+ expect(spyHttpClient).not.toHaveBeenCalled();
+ });
+
+ it('resolves catalog-only releases without a GitHub release', async () => {
+ spyHttpClient.mockResolvedValueOnce({
+ statusCode: 404,
+ headers: {},
+ result: null
+ });
+ const distribution = new CorrettoDistribution({
+ version: '15.0.2.7.1',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+ expect(
+ await distribution['findPackageForDownload'](distribution['version'])
+ ).toEqual({
+ version: '15.0.2+7.1',
+ url: 'https://corretto.aws/downloads/resources/15.0.2.7.1/amazon-corretto-15.0.2.7.1-linux-x64.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value: manifestData.linux.x64.jdk['15']['tar.gz'].checksum_sha256,
+ source:
+ 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'
+ }
+ });
+ });
+
+ it('falls back to the catalog when the GitHub lookup fails', async () => {
+ spyHttpClient.mockRejectedValueOnce(new Error('GitHub rate limit'));
+ const distribution = new CorrettoDistribution({
+ version: '15.0.2.7.1',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ expect(
+ await distribution['findPackageForDownload'](distribution['version'])
+ ).toEqual({
+ version: '15.0.2+7.1',
+ url: 'https://corretto.aws/downloads/resources/15.0.2.7.1/amazon-corretto-15.0.2.7.1-linux-x64.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value: manifestData.linux.x64.jdk['15']['tar.gz'].checksum_sha256,
+ source:
+ 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'
+ }
+ });
+ expect(spyHttpClient).toHaveBeenCalledTimes(2);
+ });
+
+ it('reports missing release metadata without substituting the latest release', async () => {
+ spyHttpClient.mockResolvedValueOnce({
+ statusCode: 404,
+ headers: {},
+ result: null
+ });
+ const distribution = new CorrettoDistribution({
+ version: '17.0.0.0.999',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(
+ "Corretto release 17.0.0.0.999 was not found in Amazon's GitHub releases or current download catalog"
+ );
+ });
+
+ it('does not normalize zero-padded major-only inputs', () => {
+ expect(
+ () =>
+ new CorrettoDistribution({
+ version: '08',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ })
+ ).toThrow(
+ "The string '08' is not valid SemVer notation for a Java version"
+ );
});
it('with unfound version throw could not find error', async () => {
@@ -199,41 +534,52 @@ describe('getAvailableVersions', () => {
await expect(
distribution['findPackageForDownload'](version)
- ).rejects.toThrow("Could not find satisfied version for SemVer '4'");
+ ).rejects.toThrow("No matching version found for SemVer '4'");
});
it.each([
- ['arm64', 'aarch64'],
- ['amd64', 'x64']
+ ['amd64', 'x64'],
+ ['arm64', 'aarch64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
- const version = '17';
- const installerOptions: JavaInstallerOptions = {
- version,
+ const distribution = new CorrettoDistribution({
+ version: '17',
architecture: '', // to get default value
packageType: 'jdk',
checkLatest: false
- };
-
- const distribution = new CorrettoDistribution(installerOptions);
+ });
mockPlatform(distribution, 'macos');
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
- const availableVersion = await distribution['findPackageForDownload'](
- version
- );
+ const availableVersion =
+ await distribution['findPackageForDownload']('17');
expect(availableVersion).not.toBeNull();
expect(availableVersion.url).toBe(expectedLink);
}
);
+
+ it('keeps the canonical ARM runner value separate from the vendor value', () => {
+ jest.spyOn(os, 'arch').mockReturnValue('arm');
+ const distribution = new CorrettoDistribution({
+ version: '11',
+ architecture: '',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(distribution['architecture']).toBe('armv7');
+ expect(distribution['distributionArchitecture']()).toBe('arm');
+ });
});
const mockPlatform = (
- distribution: CorrettoDistribution,
+ distribution: InstanceType,
platform: string
) => {
distribution['getPlatformOption'] = () => platform;
@@ -241,3 +587,50 @@ describe('getAvailableVersions', () => {
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
};
});
+
+describe('Corretto getPlatformOption libc selection', () => {
+ const originalPlatform = Object.getOwnPropertyDescriptor(
+ process,
+ 'platform'
+ ) as PropertyDescriptor;
+
+ const setPlatform = (platform: NodeJS.Platform) =>
+ Object.defineProperty(process, 'platform', {
+ ...originalPlatform,
+ value: platform
+ });
+
+ const distribution = new CorrettoDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', originalPlatform);
+ jest.restoreAllMocks();
+ });
+
+ it('selects the musl artifacts on Alpine', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ expect(distribution['getPlatformOption']()).toBe('alpine');
+ });
+
+ it('selects the glibc artifacts on other Linux runners', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ expect(distribution['getPlatformOption']()).toBe('linux');
+ });
+
+ it('does not probe for Alpine off Linux', () => {
+ setPlatform('darwin');
+ const existsSync = jest.spyOn(fs, 'existsSync');
+
+ expect(distribution['getPlatformOption']()).toBe('macos');
+ expect(existsSync).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/distributors/distribution-factory.lazy-loading.test.ts b/__tests__/distributors/distribution-factory.lazy-loading.test.ts
new file mode 100644
index 000000000..a87cc13bb
--- /dev/null
+++ b/__tests__/distributors/distribution-factory.lazy-loading.test.ts
@@ -0,0 +1,23 @@
+import {jest, describe, it, expect} from '@jest/globals';
+
+jest.unstable_mockModule('../../src/distributions/zulu/installer.js', () => {
+ throw new Error(
+ 'Zulu installer module must not be imported on the Temurin fast path'
+ );
+});
+
+const {getJavaDistribution} =
+ await import('../../src/distributions/distribution-factory.js');
+
+describe('distribution factory lazy loading', () => {
+ it('does not load non-selected distribution installers for Temurin', async () => {
+ const distribution = await getJavaDistribution('temurin', {
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(distribution).not.toBeNull();
+ });
+});
diff --git a/__tests__/distributors/distribution-factory.test.ts b/__tests__/distributors/distribution-factory.test.ts
new file mode 100644
index 000000000..c60e7f75b
--- /dev/null
+++ b/__tests__/distributors/distribution-factory.test.ts
@@ -0,0 +1,160 @@
+import {getJavaDistribution} from '../../src/distributions/distribution-factory.js';
+import {RetryingHttpClient} from '../../src/retrying-http-client.js';
+import {
+ JAVA_PACKAGE_CAPABILITIES,
+ JavaDistribution
+} from '../../src/distributions/package-types.js';
+import os from 'os';
+import {validateJavaPlatform} from '../../src/distributions/platform-types.js';
+import {normalizeArchitecture} from '../../src/distributions/platform-types.js';
+
+const supportedDistributionsOnCurrentPlatform = Object.values(
+ JavaDistribution
+).filter(distributionName => {
+ try {
+ validateJavaPlatform(distributionName, process.platform, 'x64', '25');
+ return distributionName !== JavaDistribution.JdkFile;
+ } catch {
+ return false;
+ }
+});
+
+const installerOptions = (packageType: string, version = '25') => ({
+ version,
+ architecture: 'x64',
+ packageType,
+ checkLatest: false
+});
+
+describe('getJavaDistribution', () => {
+ it.each(supportedDistributionsOnCurrentPlatform)(
+ 'uses the shared retrying HTTP client for %s',
+ async distributionName => {
+ const distribution = await getJavaDistribution(distributionName, {
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(distribution).not.toBeNull();
+ expect(distribution!['http']).toBeInstanceOf(RetryingHttpClient);
+ }
+ );
+
+ it.each(
+ Object.entries(JAVA_PACKAGE_CAPABILITIES).flatMap(
+ ([distributionName, packageTypes]) =>
+ supportedDistributionsOnCurrentPlatform.includes(
+ distributionName as JavaDistribution
+ ) || distributionName === JavaDistribution.JdkFile
+ ? packageTypes.map(packageType => [distributionName, packageType])
+ : []
+ )
+ )(
+ 'accepts %s with java-package %s',
+ async (distributionName, packageType) => {
+ expect(
+ await getJavaDistribution(
+ distributionName,
+ installerOptions(packageType as string)
+ )
+ ).not.toBeNull();
+ }
+ );
+
+ it.each(Object.entries(JAVA_PACKAGE_CAPABILITIES))(
+ 'rejects unsupported java-package values for %s',
+ async (distributionName, packageTypes) => {
+ await expect(
+ getJavaDistribution(distributionName, installerOptions('jdk+typo'))
+ ).rejects.toThrow(
+ `Java package 'jdk+typo' is not supported for distribution '${distributionName}'. Supported package types: ${packageTypes.join(', ')}.`
+ );
+ }
+ );
+
+ it("rejects java-package 'jdk+jmods' for non-Temurin distributions", async () => {
+ await expect(
+ getJavaDistribution('zulu', installerOptions('jdk+jmods'))
+ ).rejects.toThrow(
+ "Java package 'jdk+jmods' is not supported for distribution 'zulu'. Supported package types: jdk, jre, jdk+fx, jre+fx, jdk+crac, jre+crac."
+ );
+ });
+
+ it.each(['8', '23.x', '23.0.1.1', '23.0.1.1+1', '<24'])(
+ "rejects Temurin java-package 'jdk+jmods' for version %s",
+ async version => {
+ await expect(
+ getJavaDistribution(
+ JavaDistribution.Temurin,
+ installerOptions('jdk+jmods', version)
+ )
+ ).rejects.toThrow(
+ `Java package 'jdk+jmods' is not supported for distribution 'temurin'. Supported package types: jdk, jre, jdk+jmods. Package 'jdk+jmods' requires Java 24 or later; requested version '${version}'.`
+ );
+ }
+ );
+
+ it.each(['24', '24.0.1.1', '25.0.4.1+1', '25-ea', '>=21', 'latest'])(
+ "accepts Temurin java-package 'jdk+jmods' for version %s",
+ async version => {
+ expect(
+ await getJavaDistribution(
+ JavaDistribution.Temurin,
+ installerOptions('jdk+jmods', version)
+ )
+ ).not.toBeNull();
+ }
+ );
+
+ it('preserves unsupported distribution handling', async () => {
+ expect(
+ await getJavaDistribution(
+ 'not-a-distribution',
+ installerOptions('not-a-package')
+ )
+ ).toBeNull();
+ });
+
+ it.each(['adopt', 'adopt-hotspot', 'adopt-openj9'])(
+ 'does not support legacy Adopt distribution %s',
+ async distributionName => {
+ expect(
+ await getJavaDistribution(distributionName, installerOptions('jdk'))
+ ).toBeNull();
+ }
+ );
+
+ it.each([
+ ['amd64', 'x64'],
+ ['ia32', 'x86'],
+ ['arm64', 'aarch64']
+ ])('passes normalized architecture %s as %s', async (input, expected) => {
+ const normalized = await getJavaDistribution(JavaDistribution.JdkFile, {
+ ...installerOptions('jdk'),
+ architecture: input
+ });
+
+ expect(normalized!['architecture']).toBe(expected);
+ });
+
+ it('uses the runner architecture when the input is empty', async () => {
+ const distribution = await getJavaDistribution(JavaDistribution.Temurin, {
+ ...installerOptions('jdk'),
+ architecture: ''
+ });
+
+ const expected = normalizeArchitecture(os.arch());
+ expect(distribution!['architecture']).toBe(expected);
+ });
+
+ it('rejects an unsupported combination before creating an HTTP client', async () => {
+ await expect(
+ getJavaDistribution(JavaDistribution.Oracle, {
+ ...installerOptions('jdk'),
+ architecture: 'x86'
+ })
+ ).rejects.toThrow(/does not support operating system/);
+ });
+});
diff --git a/__tests__/distributors/dragonwell-installer.test.ts b/__tests__/distributors/dragonwell-installer.test.ts
index 4a680d8f3..143d82666 100644
--- a/__tests__/distributors/dragonwell-installer.test.ts
+++ b/__tests__/distributors/dragonwell-installer.test.ts
@@ -1,12 +1,60 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import fs from 'fs';
import {HttpClient} from '@actions/http-client';
-import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
-import * as utils from '../../src/util';
-import manifestData from '../data/dragonwell.json';
+import manifestData from '../data/dragonwell.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {DragonwellDistribution} =
+ await import('../../src/distributions/dragonwell/installer.js');
+const utils = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyUtilGetDownloadArchiveExtension: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -16,11 +64,13 @@ describe('getAvailableVersions', () => {
result: manifestData
});
- spyUtilGetDownloadArchiveExtension = jest.spyOn(
- utils,
- 'getDownloadArchiveExtension'
- );
+ spyUtilGetDownloadArchiveExtension =
+ utils.getDownloadArchiveExtension as jest.Mock;
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -30,7 +80,7 @@ describe('getAvailableVersions', () => {
});
const mockPlatform = (
- distribution: DragonwellDistribution,
+ distribution: InstanceType,
platform: string
) => {
distribution['getPlatformOption'] = () => platform;
@@ -206,11 +256,14 @@ describe('getAvailableVersions', () => {
});
mockPlatform(distribution, platform);
- const availableVersion = await distribution['findPackageForDownload'](
- jdkVersion
- );
+ const availableVersion =
+ await distribution['findPackageForDownload'](jdkVersion);
expect(availableVersion).not.toBeNull();
expect(availableVersion.url).toBe(expectedLink);
+ expect(availableVersion.checksum).toEqual({
+ algorithm: 'sha256',
+ value: expect.stringMatching(/^[a-f0-9]{64}$/)
+ });
}
);
@@ -220,7 +273,7 @@ describe('getAvailableVersions', () => {
['11', 'macos', 'aarch64'],
['17', 'linux', 'riscv']
])(
- 'should throw when required version of JDK can not be found in the JSON',
+ 'should throw when required version of JDK cannot be found in the JSON',
async (jdkVersion: string, platform: string, arch: string) => {
const distribution = new DragonwellDistribution({
version: jdkVersion,
@@ -233,7 +286,7 @@ describe('getAvailableVersions', () => {
await expect(
distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow(
- `Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".`
+ `No matching version found for SemVer '${jdkVersion}'`
);
}
);
@@ -255,3 +308,50 @@ describe('getAvailableVersions', () => {
});
});
});
+
+describe('Dragonwell getPlatformOption libc selection', () => {
+ const originalPlatform = Object.getOwnPropertyDescriptor(
+ process,
+ 'platform'
+ ) as PropertyDescriptor;
+
+ const setPlatform = (platform: NodeJS.Platform) =>
+ Object.defineProperty(process, 'platform', {
+ ...originalPlatform,
+ value: platform
+ });
+
+ const distribution = new DragonwellDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', originalPlatform);
+ jest.restoreAllMocks();
+ });
+
+ it('selects the musl artifacts on Alpine', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ expect(distribution['getPlatformOption']()).toBe('alpine-linux');
+ });
+
+ it('selects the glibc artifacts on other Linux runners', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ expect(distribution['getPlatformOption']()).toBe('linux');
+ });
+
+ it('does not probe for Alpine off Linux', () => {
+ setPlatform('win32');
+ const existsSync = jest.spyOn(fs, 'existsSync');
+
+ expect(distribution['getPlatformOption']()).toBe('windows');
+ expect(existsSync).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/distributors/graalvm-installer.test.ts b/__tests__/distributors/graalvm-installer.test.ts
index ae2db43cb..16b2c42cb 100644
--- a/__tests__/distributors/graalvm-installer.test.ts
+++ b/__tests__/distributors/graalvm-installer.test.ts
@@ -1,152 +1,1471 @@
-import {GraalVMDistribution} from '../../src/distributions/graalvm/installer';
-import os from 'os';
-import * as core from '@actions/core';
-import {getDownloadArchiveExtension} from '../../src/util';
-import {HttpClient} from '@actions/http-client';
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import path from 'path';
-describe('findPackageForDownload', () => {
- let distribution: GraalVMDistribution;
- let spyDebug: jest.SpyInstance;
- let spyHttpClient: jest.SpyInstance;
+// Mock @actions modules
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ find: jest.fn(),
+ findAllVersions: jest.fn(),
+ downloadTool: jest.fn(),
+ extractZip: jest.fn(),
+ extractTar: jest.fn(),
+ extract7z: jest.fn(),
+ extractXar: jest.fn(),
+ cacheDir: jest.fn(),
+ cacheFile: jest.fn(),
+ getManifestFromRepo: jest.fn(),
+ findFromManifest: jest.fn(),
+ evaluateVersions: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/http-client', () => ({
+ HttpClient: jest.fn().mockImplementation(() => ({
+ getJson: jest.fn(),
+ head: jest.fn(),
+ get: jest.fn()
+ })),
+ HttpClientError: class HttpClientError extends Error {
+ statusCode: number;
+ constructor(message: string, statusCode: number) {
+ super(message);
+ this.statusCode = statusCode;
+ }
+ },
+ HttpCodes: {OK: 200, NotFound: 404, Unauthorized: 401, Forbidden: 403}
+}));
+
+// Get real util first, then mock specific functions
+const realUtil = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...realUtil,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getJavaVersionFromReleaseFile: jest.fn(),
+ renameWinArchive: jest.fn(),
+ getGitHubHttpHeaders: jest.fn().mockReturnValue({Accept: 'application/json'})
+}));
+
+const real_fs_module = await import('fs');
+jest.unstable_mockModule('fs', () => ({
+ ...real_fs_module,
+ default: {
+ ...real_fs_module.default,
+ readdirSync: jest.fn(),
+ existsSync: jest.fn()
+ },
+ readdirSync: jest.fn(),
+ existsSync: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const tc = await import('@actions/tool-cache');
+const http = await import('@actions/http-client');
+const fs = (await import('fs')).default;
+const util = await import('../../src/util.js');
+const {GraalVMCommunityDistribution, GraalVMDistribution} =
+ await import('../../src/distributions/graalvm/installer.js');
+const {getJavaDistribution} =
+ await import('../../src/distributions/distribution-factory.js');
+
+import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
+
+beforeAll(() => {
+ process.env.NODE_ENV = 'test';
+ console.log('✅ All external dependencies are properly mocked');
+});
+
+describe('GraalVMDistribution', () => {
+ let distribution: InstanceType;
+ let communityDistribution: InstanceType;
+ let mockHttpClient: any;
+ let spyCoreError: any;
+
+ const defaultOptions: JavaInstallerOptions = {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ };
beforeEach(() => {
- distribution = new GraalVMDistribution({
- version: '',
- architecture: 'x64',
- packageType: 'jdk',
- checkLatest: false
+ jest.clearAllMocks();
+
+ distribution = new GraalVMDistribution(defaultOptions);
+ communityDistribution = new GraalVMCommunityDistribution(defaultOptions);
+
+ mockHttpClient = new (http.HttpClient as any)();
+ (distribution as any).http = mockHttpClient;
+ (communityDistribution as any).http = mockHttpClient;
+
+ // Default checksum sibling response for `${url}.sha256` requests made by
+ // GraalVM (Oracle) and GraalVM EA. Individual tests override this when
+ // they need to assert the exact URL/digest contract.
+ mockHttpClient.get.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: jest.fn().mockResolvedValue('a'.repeat(64))
+ });
+
+ (util.getDownloadArchiveExtension as jest.Mock).mockReturnValue(
+ 'tar.gz'
+ );
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+ });
+
+ afterAll(() => {
+ jest.restoreAllMocks();
+ jest.clearAllMocks();
+ });
+
+ describe('getPlatform', () => {
+ it('should map darwin to macos', () => {
+ const result = distribution.getPlatform('darwin');
+ expect(result).toBe('macos');
+ });
+
+ it('should map win32 to windows', () => {
+ const result = distribution.getPlatform('win32');
+ expect(result).toBe('windows');
+ });
+
+ it('should map linux to linux', () => {
+ const result = distribution.getPlatform('linux');
+ expect(result).toBe('linux');
});
- spyDebug = jest.spyOn(core, 'debug');
- spyDebug.mockImplementation(() => {});
+ it('should throw error for unsupported platform', () => {
+ expect(() => distribution.getPlatform('aix' as NodeJS.Platform)).toThrow(
+ "Platform 'aix' is not supported. Supported platforms: 'linux', 'macos', 'windows'"
+ );
+ });
});
- it.each([
- [
- '21',
- '21',
- 'https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
- ],
- [
- '21.0.4',
- '21.0.4',
- 'https://download.oracle.com/graalvm/21/archive/graalvm-jdk-21.0.4_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
- ],
- [
- '17',
- '17',
- 'https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
- ],
- [
- '17.0.12',
- '17.0.12',
- 'https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.12_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
- ]
- ])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
- /* Needed only for this particular test because /latest/ urls tend to change */
- spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
- spyHttpClient.mockReturnValue(
- Promise.resolve({
- message: {
- statusCode: 200
+ describe('setJavaDefault', () => {
+ it('should set GRAALVM_HOME for Oracle GraalVM', () => {
+ (distribution as any).setJavaDefault('17.0.5', '/cached/java/path');
+
+ expect(core.exportVariable).toHaveBeenCalledWith(
+ 'GRAALVM_HOME',
+ '/cached/java/path'
+ );
+ });
+
+ it('should set GRAALVM_HOME for GraalVM Community', () => {
+ (communityDistribution as any).setJavaDefault(
+ '17.0.5',
+ '/cached/java/path'
+ );
+
+ expect(core.exportVariable).toHaveBeenCalledWith(
+ 'GRAALVM_HOME',
+ '/cached/java/path'
+ );
+ });
+ });
+
+ describe('downloadTool', () => {
+ const javaRelease = {
+ version: '17.0.5',
+ url: 'https://example.com/graalvm.tar.gz'
+ };
+
+ beforeEach(() => {
+ (tc.downloadTool as any).mockResolvedValue('/tmp/archive.tar.gz');
+ (tc.cacheDir as any).mockResolvedValue('/cached/java/path');
+
+ (util.extractJdkFile as any).mockResolvedValue('/tmp/extracted');
+
+ // Mock renameWinArchive - it returns the same path (no renaming)
+ (util.renameWinArchive as any).mockImplementation((p: string) => p);
+
+ (util.getDownloadArchiveExtension as jest.Mock).mockReturnValue(
+ 'tar.gz'
+ );
+
+ // Mock fs.existsSync to return true for extracted path
+ (fs.existsSync as jest.Mock).mockReturnValue(true);
+
+ (fs.readdirSync as jest.Mock).mockReturnValue([
+ 'graalvm-jdk-17.0.5'
+ ]);
+
+ jest
+ .spyOn(distribution as any, 'getToolcacheVersionName')
+ .mockImplementation(version => version);
+ });
+
+ it('should download, extract and cache the tool successfully', async () => {
+ const result = await (distribution as any).downloadTool(javaRelease);
+
+ // Verify the download was initiated
+ expect(tc.downloadTool).toHaveBeenCalledWith(javaRelease.url);
+
+ // The implementation uses the original path for extraction
+ expect(util.extractJdkFile).toHaveBeenCalledWith(
+ '/tmp/archive.tar.gz', // Original path
+ 'tar.gz'
+ );
+
+ // Verify path existence check
+ expect(fs.existsSync).toHaveBeenCalledWith('/tmp/extracted');
+
+ // Verify directory reading
+ expect(fs.readdirSync).toHaveBeenCalledWith('/tmp/extracted');
+
+ // Verify caching with correct parameters
+ expect(tc.cacheDir).toHaveBeenCalledWith(
+ path.join('/tmp/extracted', 'graalvm-jdk-17.0.5'),
+ 'Java_GraalVM_jdk',
+ '17.0.5',
+ 'x64'
+ );
+
+ // Verify the result
+ expect(result).toEqual({
+ version: '17.0.5',
+ path: '/cached/java/path'
+ });
+
+ // Verify logging
+ expect(core.info).toHaveBeenCalledWith(
+ 'Downloading Java 17.0.5 (GraalVM) from https://example.com/graalvm.tar.gz ...'
+ );
+ expect(core.info).toHaveBeenCalledWith('Extracting Java archive...');
+ });
+
+ it('should throw error when extracted path does not exist', async () => {
+ (fs.existsSync as jest.Mock).mockReturnValue(false);
+
+ await expect(
+ (distribution as any).downloadTool(javaRelease)
+ ).rejects.toThrow(
+ 'Extraction failed: path /tmp/extracted does not exist'
+ );
+
+ expect(core.error).toHaveBeenCalledWith(
+ expect.stringContaining('Failed to download and extract GraalVM:')
+ );
+ });
+
+ it('should throw error when extracted directory is empty', async () => {
+ (fs.existsSync as jest.Mock).mockReturnValue(true);
+ (fs.readdirSync as jest.Mock).mockReturnValue([]);
+
+ await expect(
+ (distribution as any).downloadTool(javaRelease)
+ ).rejects.toThrow(
+ 'Extraction failed: no files found in extracted directory'
+ );
+
+ expect(core.error).toHaveBeenCalledWith(
+ expect.stringContaining('Failed to download and extract GraalVM:')
+ );
+ });
+
+ it('should handle download errors', async () => {
+ const downloadError = new Error('Network error during download');
+ (tc.downloadTool as any).mockRejectedValue(downloadError);
+
+ await expect(
+ (distribution as any).downloadTool(javaRelease)
+ ).rejects.toThrow('Network error during download');
+
+ expect(core.error).toHaveBeenCalledWith(
+ 'Failed to download and extract GraalVM: Error: Network error during download'
+ );
+ });
+
+ it('should handle extraction errors', async () => {
+ const extractError = new Error('Failed to extract archive');
+ (util.extractJdkFile as any).mockRejectedValue(extractError);
+
+ await expect(
+ (distribution as any).downloadTool(javaRelease)
+ ).rejects.toThrow('Failed to extract archive');
+
+ expect(core.error).toHaveBeenCalledWith(
+ 'Failed to download and extract GraalVM: Error: Failed to extract archive'
+ );
+ });
+
+ it('should handle different archive extensions', async () => {
+ // Test with a .zip file
+ (util.getDownloadArchiveExtension as jest.Mock).mockReturnValue(
+ 'zip'
+ );
+ (tc.downloadTool as any).mockResolvedValue('/tmp/archive.zip');
+
+ const zipRelease = {
+ version: '17.0.5',
+ url: 'https://example.com/graalvm.zip'
+ };
+
+ const result = await (distribution as any).downloadTool(zipRelease);
+
+ expect(util.extractJdkFile).toHaveBeenCalledWith(
+ '/tmp/archive.zip',
+ 'zip'
+ );
+
+ expect(result).toEqual({
+ version: '17.0.5',
+ path: '/cached/java/path'
+ });
+ });
+
+ it('should use a dedicated toolcache folder for GraalVM Community', async () => {
+ const result = await (communityDistribution as any).downloadTool(
+ javaRelease
+ );
+
+ expect(tc.cacheDir).toHaveBeenCalledWith(
+ path.join('/tmp/extracted', 'graalvm-jdk-17.0.5'),
+ 'Java_GraalVM_Community_jdk',
+ '17.0.5',
+ 'x64'
+ );
+ expect(result).toEqual({
+ version: '17.0.5',
+ path: '/cached/java/path'
+ });
+ });
+
+ it('caches Oracle GraalVM floating artifacts under their installed version', async () => {
+ (util.getJavaVersionFromReleaseFile as jest.Mock).mockReturnValue(
+ '21.0.9+7'
+ );
+ const floatingRelease = {
+ version: '21',
+ url: 'https://example.com/graalvm/latest/graalvm-jdk-21.tar.gz',
+ floating: true
+ };
+
+ const result = await (distribution as any).downloadTool(floatingRelease);
+
+ expect(tc.cacheDir).toHaveBeenCalledWith(
+ path.join('/tmp/extracted', 'graalvm-jdk-17.0.5'),
+ 'Java_GraalVM_jdk',
+ '21.0.9+7',
+ 'x64'
+ );
+ expect(result).toEqual({
+ version: '21.0.9+7',
+ path: '/cached/java/path'
+ });
+ });
+ });
+
+ describe('findPackageForDownload', () => {
+ beforeEach(() => {
+ jest.spyOn(distribution, 'getPlatform').mockReturnValue('linux');
+ });
+
+ describe('input validation', () => {
+ it('should throw error for null version range', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload(null)
+ ).rejects.toThrow('Version range is required and must be a string');
+ });
+
+ it('should throw error for undefined version range', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload(undefined)
+ ).rejects.toThrow('Version range is required and must be a string');
+ });
+
+ it('should throw error for empty string version range', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload('')
+ ).rejects.toThrow('Version range is required and must be a string');
+ });
+
+ it('should throw error for non-string version range', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload(123)
+ ).rejects.toThrow('Version range is required and must be a string');
+ });
+
+ it('should throw error for invalid version format', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload('abc')
+ ).rejects.toThrow('Invalid version format: abc');
+ });
+ });
+
+ describe('stable builds', () => {
+ it('should construct correct URL for specific version', async () => {
+ const mockResponse = {
+ message: {statusCode: 200}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ const result = await (distribution as any).findPackageForDownload(
+ '17.0.5'
+ );
+
+ expect(result).toEqual({
+ url: 'https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.5_linux-x64_bin.tar.gz',
+ version: '17.0.5',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.5_linux-x64_bin.tar.gz.sha256'
+ },
+ floating: false
+ });
+ expect(mockHttpClient.head).toHaveBeenCalledWith(result.url);
+ expect(mockHttpClient.get).toHaveBeenCalledWith(`${result.url}.sha256`);
+ });
+
+ it('should construct correct URL for major version (latest)', async () => {
+ const mockResponse = {
+ message: {statusCode: 200}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ const result = await (distribution as any).findPackageForDownload('21');
+
+ expect(result).toEqual({
+ url: 'https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz',
+ version: '21',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz.sha256'
+ },
+ // A major-only range resolves to the floating `/latest/` URL, so the
+ // release must not be reused by a later job.
+ floating: true
+ });
+ });
+
+ it.each([
+ ['21', 'etag:"graalvm-latest"'],
+ ['17.0.5', undefined]
+ ])(
+ 'fingerprints only the floating artifact for version %s',
+ async (input, expected) => {
+ mockHttpClient.head.mockResolvedValue({
+ message: {statusCode: 200, headers: {etag: '"graalvm-latest"'}}
+ } as any);
+
+ const result = await (distribution as any).findPackageForDownload(
+ input
+ );
+
+ // Without a fingerprint the constant `/latest/` URL would key a cache
+ // entry that never invalidates when Oracle republishes the artifact.
+ expect(result.fingerprint).toBe(expected);
}
- })
- );
+ );
- const result = await distribution['findPackageForDownload'](input);
+ it('always resolves Oracle GraalVM major-only requests remotely', () => {
+ expect((distribution as any).requiresRemoteResolution()).toBe(true);
+ expect((communityDistribution as any).requiresRemoteResolution()).toBe(
+ false
+ );
+ });
- jest.restoreAllMocks();
+ it('should throw error for unsupported architecture', async () => {
+ distribution = new GraalVMDistribution({
+ ...defaultOptions,
+ architecture: 'x86'
+ });
+ (distribution as any).http = mockHttpClient;
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow(
+ 'Unsupported architecture: x86. Supported architectures are: x64, aarch64'
+ );
+ });
+
+ describe('latest alias', () => {
+ it('resolves the newest major version from the Adoptium API', async () => {
+ const latestDistribution = new GraalVMDistribution({
+ ...defaultOptions,
+ version: 'latest'
+ });
+ (latestDistribution as any).http = mockHttpClient;
+ jest
+ .spyOn(latestDistribution, 'getPlatform')
+ .mockReturnValue('linux');
+ mockHttpClient.getJson.mockResolvedValue({
+ statusCode: 200,
+ result: {most_recent_feature_release: 25},
+ headers: {}
+ });
+ mockHttpClient.head.mockResolvedValue({
+ message: {statusCode: 200}
+ });
+
+ const result = await (
+ latestDistribution as any
+ ).findPackageForDownload('x');
+
+ expect(result).toEqual({
+ url: 'https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz',
+ version: '25',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz.sha256'
+ },
+ floating: true
+ });
+ });
+
+ it('throws an actionable error when the latest major is not yet available', async () => {
+ const latestDistribution = new GraalVMDistribution({
+ ...defaultOptions,
+ version: 'latest'
+ });
+ (latestDistribution as any).http = mockHttpClient;
+ jest
+ .spyOn(latestDistribution, 'getPlatform')
+ .mockReturnValue('linux');
+ mockHttpClient.getJson.mockResolvedValue({
+ statusCode: 200,
+ result: {most_recent_feature_release: 25},
+ headers: {}
+ });
+ mockHttpClient.head.mockResolvedValue({
+ message: {statusCode: 404}
+ });
+
+ await expect(
+ (latestDistribution as any).findPackageForDownload('x')
+ ).rejects.toThrow(
+ /is not yet available for the GraalVM distribution/
+ );
+ });
+ });
+
+ it('should throw error for JDK versions less than 17', async () => {
+ await expect(
+ (distribution as any).findPackageForDownload('11')
+ ).rejects.toThrow(
+ 'GraalVM is only supported for JDK 17 and later. Requested version: 11'
+ );
+ });
+
+ it('should throw error for non-jdk package types', async () => {
+ distribution = new GraalVMDistribution({
+ ...defaultOptions,
+ packageType: 'jre'
+ });
+ (distribution as any).http = mockHttpClient;
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow('GraalVM provides only the `jdk` package type');
+ });
+
+ it('should throw error when file not found (404)', async () => {
+ const mockResponse = {
+ message: {statusCode: 404}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ // Verify the error is thrown with the expected message
+ await expect(
+ (distribution as any).findPackageForDownload('17.0.99')
+ ).rejects.toThrow("No matching version found for SemVer '17.0.99'");
+ // Verify distribution info is included
+ await expect(
+ (distribution as any).findPackageForDownload('17.0.99')
+ ).rejects.toThrow('GraalVM');
+
+ // Verify the hint about checking the base URL is included
+ await expect(
+ (distribution as any).findPackageForDownload('17.0.99')
+ ).rejects.toThrow('https://www.graalvm.org/downloads/');
+ });
+
+ it('should throw error for unauthorized access (401)', async () => {
+ const mockResponse = {
+ message: {statusCode: 401}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow(
+ 'Access denied when downloading GraalVM. Status code: 401. Please check your credentials or permissions.'
+ );
+ });
+
+ it('should throw error for forbidden access (403)', async () => {
+ const mockResponse = {
+ message: {statusCode: 403}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow(
+ 'Access denied when downloading GraalVM. Status code: 403. Please check your credentials or permissions.'
+ );
+ });
+
+ it('should throw error for other HTTP errors with status message', async () => {
+ const mockResponse = {
+ message: {
+ statusCode: 500,
+ statusMessage: 'Internal Server Error'
+ }
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow(
+ 'HTTP request for GraalVM failed with status code: 500 (Internal Server Error)'
+ );
+ });
+
+ it('should throw error for other HTTP errors without status message', async () => {
+ const mockResponse = {
+ message: {statusCode: 500}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ await expect(
+ (distribution as any).findPackageForDownload('17')
+ ).rejects.toThrow(
+ 'HTTP request for GraalVM failed with status code: 500 (Unknown error)'
+ );
+ });
+ });
- expect(result.version).toBe(expectedVersion);
- const osType = distribution.getPlatform();
- const archiveType = getDownloadArchiveExtension();
- const url = expectedUrl
- .replace('{{OS_TYPE}}', osType)
- .replace('{{ARCHIVE_TYPE}}', archiveType);
- expect(result.url).toBe(url);
+ describe('EA builds', () => {
+ beforeEach(() => {
+ distribution = new GraalVMDistribution(defaultOptions);
+ (distribution as any).http = mockHttpClient;
+ (distribution as any).stable = false;
+ });
+
+ it('should delegate to findEABuildDownloadUrl for unstable versions', async () => {
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-x64_bin.tar.gz'
+ },
+ {
+ arch: 'aarch64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-aarch64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockEAVersions,
+ statusCode: 200,
+ headers: {}
+ });
+
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+
+ const result = await (distribution as any).findPackageForDownload('23');
+
+ expect(result).toEqual({
+ url: 'https://example.com/download/graalvm-jdk-23_linux-x64_bin.tar.gz',
+ version: '23-ea-20240716',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://example.com/download/graalvm-jdk-23_linux-x64_bin.tar.gz.sha256'
+ }
+ });
+
+ expect(mockHttpClient.getJson).toHaveBeenCalledWith(
+ 'https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/contents/versions/23-ea.json?ref=main',
+ {Accept: 'application/json'}
+ );
+ expect(mockHttpClient.get).toHaveBeenCalledWith(`${result.url}.sha256`);
+ });
+
+ it('should throw error when no latest EA version found', async () => {
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: false,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockEAVersions,
+ statusCode: 200,
+ headers: {}
+ });
+
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow("No matching version found for SemVer '23-ea'");
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ 'Note: No EA build is marked as latest for this version.'
+ );
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow('23-ea-20240716');
+
+ // Verify error logging - removed as we now use the helper method which doesn't call core.error
+ });
+
+ it('should throw error when no matching file for architecture in EA build', async () => {
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'arm64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-arm64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockEAVersions,
+ statusCode: 200,
+ headers: {}
+ });
+
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ `Unable to find file for architecture 'x64' and platform '${currentPlatform}'`
+ );
+
+ // Verify error logging
+ expect(core.error).toHaveBeenCalledWith(
+ expect.stringContaining('Available files for architecture x64:')
+ );
+ });
+
+ it('should throw error when no matching platform in EA build', async () => {
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: 'different-platform',
+ filename: 'graalvm-jdk-23_different-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockEAVersions,
+ statusCode: 200,
+ headers: {}
+ });
+
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ `Unable to find file for architecture 'x64' and platform '${currentPlatform}'`
+ );
+ });
+
+ it('should throw error when filename does not start with graalvm-jdk-', async () => {
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'wrong-prefix-23_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockEAVersions,
+ statusCode: 200,
+ headers: {}
+ });
+
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ "Invalid filename format: wrong-prefix-23_linux-x64_bin.tar.gz. Expected to start with 'graalvm-jdk-'"
+ );
+ });
+
+ it('should throw error when EA version JSON is not found', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: null,
+ statusCode: 404,
+ headers: {}
+ });
+
+ await expect(
+ (distribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ "No GraalVM EA build found for version '23-ea'. Please check if the version is correct."
+ );
+ });
+ });
});
- it.each([
- [
- '24-ea',
- /^https:\/\/github\.com\/graalvm\/oracle-graalvm-ea-builds\/releases\/download\/jdk-24\.0\.0-ea\./
- ]
- ])('version is %s -> %s', async (version, expectedUrlPrefix) => {
- /* Needed only for this particular test because /latest/ urls tend to change */
- spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
- spyHttpClient.mockReturnValue(
- Promise.resolve({
- message: {
- statusCode: 200
+ describe('findEABuildDownloadUrl', () => {
+ const currentPlatform =
+ process.platform === 'win32' ? 'windows' : process.platform;
+
+ const mockEAVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-x64_bin.tar.gz'
+ },
+ {
+ arch: 'aarch64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-aarch64_bin.tar.gz'
+ }
+ ]
+ },
+ {
+ version: '23-ea-20240709',
+ latest: false,
+ download_base_url: 'https://example.com/old/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+
+ let fetchEASpy: any;
+
+ beforeEach(() => {
+ fetchEASpy = jest.spyOn(distribution as any, 'fetchEAJson');
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('x64');
+ });
+
+ it('should find latest version and return correct URL', async () => {
+ fetchEASpy.mockResolvedValue(mockEAVersions);
+
+ const result = await (distribution as any).findEABuildDownloadUrl(
+ '23-ea'
+ );
+
+ expect(fetchEASpy).toHaveBeenCalledWith('23-ea');
+ expect(result).toEqual({
+ url: 'https://example.com/download/graalvm-jdk-23_linux-x64_bin.tar.gz',
+ version: '23-ea-20240716',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://example.com/download/graalvm-jdk-23_linux-x64_bin.tar.gz.sha256'
}
- })
- );
+ });
+ expect(mockHttpClient.get).toHaveBeenCalledWith(`${result.url}.sha256`);
- const eaDistro = new GraalVMDistribution({
- version,
- architecture: '', // to get default value
- packageType: 'jdk',
- checkLatest: false
+ // Verify debug logging
+ expect(core.debug).toHaveBeenCalledWith('Searching for EA build: 23-ea');
+ expect(core.debug).toHaveBeenCalledWith('Found 2 EA versions');
+ expect(core.debug).toHaveBeenCalledWith(
+ 'Latest version found: 23-ea-20240716'
+ );
+ expect(core.debug).toHaveBeenCalledWith(
+ 'Download URL: https://example.com/download/graalvm-jdk-23_linux-x64_bin.tar.gz'
+ );
});
- const versionWithoutEA = version.split('-')[0];
- const result = await eaDistro['findPackageForDownload'](versionWithoutEA);
+ it('should throw error when no latest version found', async () => {
+ const noLatestVersions = mockEAVersions.map(v => ({...v, latest: false}));
+ fetchEASpy.mockResolvedValue(noLatestVersions);
- jest.restoreAllMocks();
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow("No matching version found for SemVer '23-ea'");
+
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow(
+ 'Note: No EA build is marked as latest for this version.'
+ );
+
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow('23-ea-20240716');
+
+ // Verify error logging - removed as we now use the helper method which doesn't call core.error
+ });
+
+ it('should throw error when no matching file for architecture', async () => {
+ const wrongArchVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'arm',
+ platform: currentPlatform,
+ filename: 'graalvm-jdk-23_linux-arm_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+ fetchEASpy.mockResolvedValue(wrongArchVersions);
+
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow(
+ `Unable to find file for architecture 'x64' and platform '${currentPlatform}'`
+ );
+
+ expect(core.error).toHaveBeenCalledWith(
+ expect.stringContaining('Available files for architecture x64:')
+ );
+ });
+
+ it('should throw error when filename does not start with graalvm-jdk-', async () => {
+ const badFilenameVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: currentPlatform,
+ filename: 'wrong-name.tar.gz'
+ }
+ ]
+ }
+ ];
+ fetchEASpy.mockResolvedValue(badFilenameVersions);
+
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow(
+ "Invalid filename format: wrong-name.tar.gz. Expected to start with 'graalvm-jdk-'"
+ );
+ });
+
+ it('should work with aarch64 architecture', async () => {
+ jest
+ .spyOn(distribution as any, 'distributionArchitecture')
+ .mockReturnValue('aarch64');
+
+ fetchEASpy.mockResolvedValue(mockEAVersions);
+
+ const result = await (distribution as any).findEABuildDownloadUrl(
+ '23-ea'
+ );
+
+ expect(result).toEqual({
+ url: 'https://example.com/download/graalvm-jdk-23_linux-aarch64_bin.tar.gz',
+ version: '23-ea-20240716',
+ checksum: {
+ algorithm: 'sha256',
+ value: 'a'.repeat(64),
+ source:
+ 'https://example.com/download/graalvm-jdk-23_linux-aarch64_bin.tar.gz.sha256'
+ }
+ });
+ });
- expect(result.url).toEqual(expect.stringMatching(expectedUrlPrefix));
+ it('should throw error when platform does not match', async () => {
+ const wrongPlatformVersions = [
+ {
+ version: '23-ea-20240716',
+ latest: true,
+ download_base_url: 'https://example.com/download/',
+ files: [
+ {
+ arch: 'x64',
+ platform: 'different-platform',
+ filename: 'graalvm-jdk-23_different-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ];
+ fetchEASpy.mockResolvedValue(wrongPlatformVersions);
+
+ await expect(
+ (distribution as any).findEABuildDownloadUrl('23-ea')
+ ).rejects.toThrow(
+ `Unable to find file for architecture 'x64' and platform '${currentPlatform}'`
+ );
+ });
+ });
+
+ describe('fetchEAJson', () => {
+ it('should fetch and return EA version data', async () => {
+ const mockData = [{version: '23-ea', files: []}];
+ mockHttpClient.getJson.mockResolvedValue({
+ result: mockData,
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (distribution as any).fetchEAJson('23-ea');
+
+ expect(mockHttpClient.getJson).toHaveBeenCalledWith(
+ 'https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/contents/versions/23-ea.json?ref=main',
+ {Accept: 'application/json'}
+ );
+ expect(result).toEqual(mockData);
+ expect(core.debug).toHaveBeenCalled();
+ });
+
+ it('should throw error when no data returned', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: null,
+ statusCode: 200,
+ headers: {}
+ });
+
+ await expect((distribution as any).fetchEAJson('23-ea')).rejects.toThrow(
+ "No GraalVM EA build found for version '23-ea'. Please check if the version is correct."
+ );
+ });
+
+ it('should handle 404 errors with specific message', async () => {
+ const error404 = new Error('Not Found: 404');
+ mockHttpClient.getJson.mockRejectedValue(error404);
+
+ await expect((distribution as any).fetchEAJson('23-ea')).rejects.toThrow(
+ "GraalVM EA version '23-ea' not found. Please verify the version exists in the EA builds repository."
+ );
+ });
+
+ it('should handle generic HTTP errors with context', async () => {
+ const networkError = new Error('Network timeout');
+ mockHttpClient.getJson.mockRejectedValue(networkError);
+
+ await expect((distribution as any).fetchEAJson('23-ea')).rejects.toThrow(
+ "Failed to fetch GraalVM EA version information for '23-ea': Network timeout"
+ );
+ });
+
+ it('should handle non-Error exceptions', async () => {
+ mockHttpClient.getJson.mockRejectedValue('String error');
+
+ await expect((distribution as any).fetchEAJson('23-ea')).rejects.toThrow(
+ "Failed to fetch GraalVM EA version information for '23-ea'"
+ );
+ });
});
- it.each([
- ['amd64', 'x64'],
- ['arm64', 'aarch64']
- ])(
- 'defaults to os.arch(): %s mapped to distro arch: %s',
- async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
- jest.spyOn(os, 'platform').mockReturnValue('linux');
-
- const version = '21';
- const distro = new GraalVMDistribution({
- version,
- architecture: '', // to get default value
- packageType: 'jdk',
- checkLatest: false
- });
-
- const osType = distribution.getPlatform();
- if (osType === 'windows' && distroArch == 'aarch64') {
- return; // skip, aarch64 is not available for Windows
+ describe('Integration tests', () => {
+ it('should handle different architectures correctly', async () => {
+ const architectures = ['x64', 'aarch64'];
+
+ for (const arch of architectures) {
+ distribution = new GraalVMDistribution({
+ ...defaultOptions,
+ architecture: arch
+ });
+ (distribution as any).http = mockHttpClient;
+
+ const mockResponse = {
+ message: {statusCode: 200}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ const result = await (distribution as any).findPackageForDownload('17');
+ expect(result.url).toContain(arch);
}
- const archiveType = getDownloadArchiveExtension();
- const result = await distro['findPackageForDownload'](version);
- const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
+ });
- expect(result.url).toBe(expectedUrl);
- }
- );
+ it('should handle different platforms correctly', async () => {
+ const platforms = [
+ {process: 'darwin', expected: 'macos'},
+ {process: 'win32', expected: 'windows'},
+ {process: 'linux', expected: 'linux'}
+ ];
- it('should throw an error', async () => {
- await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
- /GraalVM is only supported for JDK 17 and later/
- );
- await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
- /GraalVM is only supported for JDK 17 and later/
- );
- await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
- /Could not find GraalVM for SemVer */
- );
+ const originalPlatform = process.platform;
+
+ for (const {process: proc, expected} of platforms) {
+ Object.defineProperty(process, 'platform', {
+ value: proc,
+ configurable: true
+ });
+
+ distribution = new GraalVMDistribution(defaultOptions);
+ (distribution as any).http = mockHttpClient;
- const unavailableEADistro = new GraalVMDistribution({
- version: '17-ea',
- architecture: '', // to get default value
- packageType: 'jdk',
- checkLatest: false
+ const mockResponse = {
+ message: {statusCode: 200}
+ } as any;
+ mockHttpClient.head.mockResolvedValue(mockResponse);
+
+ const result = await (distribution as any).findPackageForDownload('17');
+ expect(result.url).toContain(expected);
+ }
+
+ Object.defineProperty(process, 'platform', {
+ value: originalPlatform,
+ configurable: true
+ });
});
- await expect(
- unavailableEADistro['findPackageForDownload']('17')
- ).rejects.toThrow(
- /No GraalVM EA build found\. Are you sure java-version: '17-ea' is correct\?/
+
+ describe('GraalVMCommunityDistribution', () => {
+ beforeEach(() => {
+ jest
+ .spyOn(communityDistribution, 'getPlatform')
+ .mockReturnValue('linux');
+ });
+
+ it('should resolve an exact GraalVM Community version from GitHub releases', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: [
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (
+ communityDistribution as any
+ ).findPackageForDownload('21.0.2');
+
+ expect(result).toEqual({
+ url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ version: '21.0.2'
+ });
+ // The asset had no `digest` field, so no checksum should be attached,
+ // and the checksum sibling-URL fetch path (used by Oracle GraalVM)
+ // must not be consulted for GraalVM Community.
+ expect(result.checksum).toBeUndefined();
+ expect(mockHttpClient.get).not.toHaveBeenCalled();
+ });
+
+ it('strips the `sha256:` prefix from a GitHub release asset digest', async () => {
+ const digest = 'd'.repeat(64);
+ mockHttpClient.getJson.mockResolvedValue({
+ result: [
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ digest: `sha256:${digest}`
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (
+ communityDistribution as any
+ ).findPackageForDownload('21.0.2');
+
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: digest,
+ source:
+ 'https://api.github.com/repos/graalvm/graalvm-ce-builds/releases?per_page=100'
+ });
+ // The digest came from the release listing itself, so no additional
+ // HTTP request should be made to resolve the checksum.
+ expect(mockHttpClient.get).not.toHaveBeenCalled();
+ });
+
+ it('safely skips a missing or malformed release asset digest', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: [
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ digest: 'md5:not-a-sha256-digest'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (
+ communityDistribution as any
+ ).findPackageForDownload('21.0.2');
+
+ expect(result.checksum).toBeUndefined();
+ expect(mockHttpClient.get).not.toHaveBeenCalled();
+ expect(core.debug).toHaveBeenCalledWith(
+ expect.stringContaining(
+ 'No authoritative sha256 digest is available for graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
+ )
+ );
+ });
+
+ it('should resolve the latest GraalVM Community release for a major version', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: [
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz'
+ }
+ ]
+ },
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (
+ communityDistribution as any
+ ).findPackageForDownload('21');
+
+ expect(result).toEqual({
+ url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ version: '21.0.2'
+ });
+ });
+
+ it('resolves latest to the newest GA across all Community majors without calling Adoptium', async () => {
+ const latestCommunity = new GraalVMCommunityDistribution({
+ ...defaultOptions,
+ version: 'latest'
+ });
+ (latestCommunity as any).http = mockHttpClient;
+ jest.spyOn(latestCommunity, 'getPlatform').mockReturnValue('linux');
+
+ mockHttpClient.getJson.mockResolvedValue({
+ result: [
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
+ }
+ ]
+ },
+ {
+ draft: false,
+ prerelease: false,
+ assets: [
+ {
+ name: 'graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz',
+ browser_download_url:
+ 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-24.0.1/graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await (latestCommunity as any).findPackageForDownload(
+ 'x'
+ );
+
+ expect(result).toEqual({
+ url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-24.0.1/graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz',
+ version: '24.0.1'
+ });
+ // The Community release list is authoritative, so the Adoptium
+ // most_recent_feature_release endpoint must not be consulted.
+ expect(mockHttpClient.getJson).toHaveBeenCalledTimes(1);
+ expect(mockHttpClient.getJson).toHaveBeenCalledWith(
+ expect.stringContaining('graalvm-ce-builds/releases'),
+ expect.anything()
+ );
+ });
+
+ it('should reject GraalVM Community early access requests', async () => {
+ (communityDistribution as any).stable = false;
+
+ await expect(
+ (communityDistribution as any).findPackageForDownload('23')
+ ).rejects.toThrow(
+ 'GraalVM Community does not provide early access builds'
+ );
+ });
+
+ it('should surface an error when the releases listing is not an array', async () => {
+ mockHttpClient.getJson.mockResolvedValue({
+ result: {message: 'API rate limit exceeded'},
+ statusCode: 403,
+ headers: {}
+ });
+
+ await expect(
+ (communityDistribution as any).findPackageForDownload('21')
+ ).rejects.toThrow(
+ /Unexpected response while listing GraalVM Community releases.*HTTP status code: 403/s
+ );
+ });
+ });
+ });
+});
+
+describe('distribution factory', () => {
+ const defaultOptions: JavaInstallerOptions = {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ };
+
+ it('should map graalvm-community to the community installer', async () => {
+ const community = await getJavaDistribution(
+ 'graalvm-community',
+ defaultOptions
);
+
+ expect(community).toBeInstanceOf(GraalVMCommunityDistribution);
});
});
diff --git a/__tests__/distributors/jetbrains-installer.test.ts b/__tests__/distributors/jetbrains-installer.test.ts
new file mode 100644
index 000000000..9c3b5abf6
--- /dev/null
+++ b/__tests__/distributors/jetbrains-installer.test.ts
@@ -0,0 +1,758 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import https from 'https';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+import {HttpClient, HttpClientResponse} from '@actions/http-client';
+import type {IncomingMessage} from 'http';
+import {Readable} from 'stream';
+
+import manifestData from '../data/jetbrains.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {JetBrainsDistribution} =
+ await import('../../src/distributions/jetbrains/installer.js');
+const {RetryingHttpClient} = await import('../../src/retrying-http-client.js');
+const {MAX_PAGINATION_PAGES} = await import('../../src/util.js');
+
+const JETBRAINS_RELEASES_URL =
+ 'https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?per_page=100';
+
+function release(tagName: string, prerelease: boolean) {
+ return {
+ tag_name: tagName,
+ name: tagName,
+ prerelease
+ };
+}
+
+function nextPageHeader(page: number) {
+ return {
+ link: `<${JETBRAINS_RELEASES_URL}&page=${page}>; rel="next"`
+ };
+}
+
+function response(
+ statusCode: number,
+ body = '',
+ headers: IncomingMessage['headers'] = {}
+): HttpClientResponse {
+ const message = Readable.from([Buffer.from(body)]) as IncomingMessage;
+ message.statusCode = statusCode;
+ message.headers = headers;
+ return new HttpClientResponse(message);
+}
+
+describe('getAvailableVersions', () => {
+ jest.setTimeout(10_000);
+
+ let spyHttpClient: any;
+ let spyHttpClientHead: any;
+ let spyCoreError: any;
+ const originalGitHubToken = process.env.GITHUB_TOKEN;
+
+ beforeEach(() => {
+ delete process.env.GITHUB_TOKEN;
+ (core.getInput as jest.Mock).mockReturnValue('');
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {},
+ result: []
+ });
+ spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClientHead.mockResolvedValue({
+ message: {statusCode: 200}
+ } as any);
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+ });
+
+ afterEach(() => {
+ if (originalGitHubToken === undefined) {
+ delete process.env.GITHUB_TOKEN;
+ } else {
+ process.env.GITHUB_TOKEN = originalGitHubToken;
+ }
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ jest.restoreAllMocks();
+ });
+
+ it('load available versions', async () => {
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyHttpClient
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: manifestData as any
+ })
+ .mockReturnValue({
+ statusCode: 200,
+ headers: {},
+ result: []
+ });
+
+ const distribution = new JetBrainsDistribution({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ const availableVersions = await distribution['getAvailableVersions']();
+ expect(availableVersions).not.toBeNull();
+
+ expect(availableVersions.length).toBe(manifestData.length + 2);
+ }, 10_000);
+
+ it('continues a stable request after an all-prerelease page', async () => {
+ jest.spyOn(HttpClient.prototype, 'head').mockResolvedValue({
+ message: {statusCode: 200}
+ } as any);
+ spyHttpClient
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: nextPageHeader(2),
+ result: [release('jbr-release-26.0.0b1.1', true)]
+ })
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const availableVersions = await distribution['getAvailableVersions']();
+
+ expect(availableVersions.map(version => version.tag_name)).toContain(
+ 'jbr-release-21.0.11b1163.116'
+ );
+ expect(availableVersions.map(version => version.tag_name)).not.toContain(
+ 'jbr-release-26.0.0b1.1'
+ );
+ expect(spyHttpClient).toHaveBeenCalledTimes(2);
+ });
+
+ it('continues an EA request after an all-stable page', async () => {
+ jest.spyOn(HttpClient.prototype, 'head').mockResolvedValue({
+ message: {statusCode: 200}
+ } as any);
+ spyHttpClient
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: nextPageHeader(2),
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ })
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [release('jbr-release-26.0.0b1.1', true)]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '26-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const availableVersions = await distribution['getAvailableVersions']();
+
+ expect(availableVersions.map(version => version.tag_name)).toEqual([
+ 'jbr-release-26.0.0b1.1'
+ ]);
+ expect(spyHttpClient).toHaveBeenCalledTimes(2);
+ });
+
+ it('uses the token input for every paginated GitHub Releases request', async () => {
+ (core.getInput as jest.Mock).mockReturnValue('input-token');
+ spyHttpClient
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: nextPageHeader(2),
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ })
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [release('jbr-release-21.0.10b1087.6', false)]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenNthCalledWith(1, JETBRAINS_RELEASES_URL, {
+ Accept: 'application/vnd.github+json',
+ Authorization: 'Bearer input-token'
+ });
+ expect(spyHttpClient).toHaveBeenNthCalledWith(
+ 2,
+ `${JETBRAINS_RELEASES_URL}&page=2`,
+ {
+ Accept: 'application/vnd.github+json',
+ Authorization: 'Bearer input-token'
+ }
+ );
+ });
+
+ it('prefers the token input over the environment fallback', async () => {
+ (core.getInput as jest.Mock).mockReturnValue('input-token');
+ process.env.GITHUB_TOKEN = 'environment-token';
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledWith(JETBRAINS_RELEASES_URL, {
+ Accept: 'application/vnd.github+json',
+ Authorization: 'Bearer input-token'
+ });
+ });
+
+ it('falls back to GITHUB_TOKEN when the token input is empty', async () => {
+ process.env.GITHUB_TOKEN = 'environment-token';
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledWith(JETBRAINS_RELEASES_URL, {
+ Accept: 'application/vnd.github+json',
+ Authorization: 'Bearer environment-token'
+ });
+ });
+
+ it('omits authorization when no GitHub token is available', async () => {
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledWith(JETBRAINS_RELEASES_URL, {
+ Accept: 'application/vnd.github+json'
+ });
+ });
+
+ it('stops pagination when a raw GitHub page is empty', async () => {
+ spyHttpClient
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: nextPageHeader(2),
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ })
+ .mockResolvedValueOnce({
+ statusCode: 200,
+ headers: nextPageHeader(3),
+ result: []
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '26-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledTimes(2);
+ });
+
+ it('stops at the pagination safeguard', async () => {
+ spyHttpClient.mockResolvedValue({
+ statusCode: 200,
+ headers: nextPageHeader(2),
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '26-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const availableVersions = await distribution['getAvailableVersions']();
+
+ expect(availableVersions).toEqual([]);
+ expect(spyHttpClient).toHaveBeenCalledTimes(MAX_PAGINATION_PAGES);
+ expect(core.warning).toHaveBeenCalledWith(
+ `Reached pagination safeguard limit (${MAX_PAGINATION_PAGES} pages) while listing JetBrains Runtime releases.`
+ );
+ });
+
+ it('ignores pagination links with an unexpected origin', async () => {
+ spyHttpClient.mockResolvedValueOnce({
+ statusCode: 200,
+ headers: {
+ link: '; rel="next"'
+ },
+ result: [release('jbr-release-21.0.11b1163.116', false)]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '26-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledTimes(1);
+ expect(core.warning).toHaveBeenCalledWith(
+ 'Ignoring pagination link with unexpected origin: https://example.com/releases?page=2'
+ );
+ });
+
+ it('retries a GitHub rate limit using Retry-After', async () => {
+ spyHttpClient.mockRestore();
+ spyHttpClientHead.mockRestore();
+ const sleep = jest.fn(async () => undefined);
+ const requestRaw = jest
+ .spyOn(HttpClient.prototype, 'requestRaw')
+ .mockResolvedValueOnce(response(429, '', {'retry-after': '2'}))
+ .mockResolvedValueOnce(response(200, '[]'))
+ .mockResolvedValueOnce(response(200))
+ .mockResolvedValueOnce(response(200));
+ const distribution = new JetBrainsDistribution({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['http'] = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0
+ });
+
+ const availableVersions = await distribution['getAvailableVersions']();
+
+ expect(availableVersions).toHaveLength(2);
+ expect(requestRaw).toHaveBeenCalledTimes(4);
+ expect(requestRaw.mock.calls[0][0].options.path).toBe(
+ requestRaw.mock.calls[1][0].options.path
+ );
+ expect(requestRaw.mock.calls[0][0].options.path).toContain(
+ '/repos/JetBrains/JetBrainsRuntime/releases'
+ );
+ expect(sleep).toHaveBeenCalledWith(2000);
+ expect(core.info).toHaveBeenCalledWith(
+ 'Request attempt 1 of 4 failed (HTTP 429); retrying in 2000 ms'
+ );
+ });
+});
+
+describe('findPackageForDownload', () => {
+ let spyHttpClientGet: any;
+
+ const JETBRAINS_CHECKSUM = 'c'.repeat(128);
+
+ beforeEach(() => {
+ // Every resolved release fetches `${url}.checksum` (sha512, GNU
+ // ` ` format); stub it so tests never reach the real
+ // network, except the dedicated 'version %s can be downloaded' test
+ // below which intentionally exercises real HTTPS HEAD requests.
+ spyHttpClientGet = jest
+ .spyOn(HttpClient.prototype, 'get')
+ .mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => `${JETBRAINS_CHECKSUM} jbrsdk.tar.gz\n`
+ } as any);
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it.each([
+ ['17', '17.0.11+1207.24'],
+ ['11.0', '11.0.16+2043.64'],
+ ['11.0.11', '11.0.11+1542.1'],
+ ['21.0.2', '21.0.2+375.1'],
+ ['21', '21.0.3+465.3'],
+ ['x', '21.0.3+465.3']
+ ])('version is resolved correctly %s -> %s', async (input, expected) => {
+ const distribution = new JetBrainsDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+ const resolvedVersion = await distribution['findPackageForDownload'](input);
+ expect(resolvedVersion.version).toBe(expected);
+ });
+
+ it.each(['17', '11.0', '11.0.11', '21.0.2', '21'])(
+ 'version %s can be downloaded',
+ async input => {
+ const distribution = new JetBrainsDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+ const resolvedVersion =
+ await distribution['findPackageForDownload'](input);
+ const url = resolvedVersion.url;
+ const options = {method: 'HEAD'};
+
+ await new Promise((resolve, reject) => {
+ const request = https.request(url, options, res => {
+ let assertionError: unknown;
+
+ try {
+ // JetBrains uses 403 for non-existent packages
+ expect(res.statusCode).not.toBe(403);
+ } catch (error) {
+ assertionError = error;
+ }
+
+ res.resume();
+ res.once('error', reject);
+ res.once('end', () =>
+ assertionError ? reject(assertionError as Error) : resolve()
+ );
+ });
+
+ request.on('error', reject);
+ request.end();
+ });
+ }
+ );
+
+ describe('hotfix releases', () => {
+ beforeEach(() => {
+ jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: [
+ release('jbr-release-25.0.4b508.27', false),
+ release('jbr-release-25.0.4.1b635.9', false),
+ release('jbr-release-25.0.4.1b635.79', false),
+ release('jbr-release-25.0.3.2b1000.1', false)
+ ]
+ });
+ jest.spyOn(HttpClient.prototype, 'head').mockResolvedValue(response(200));
+ });
+
+ it.each(['linux', 'osx', 'windows'])(
+ 'selects the patched JBR archive and checksum on %s',
+ async platform => {
+ const distribution = new JetBrainsDistribution({
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: true
+ });
+ distribution['getPlatformOption'] = () => platform;
+ const url = `https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-25.0.4.1-${platform}-x64-b635.79.tar.gz`;
+
+ const result = await distribution['findPackageForDownload']('25');
+
+ expect(result).toEqual({
+ version: '25.0.4+1.635.79',
+ url,
+ checksum: {
+ algorithm: 'sha512',
+ value: JETBRAINS_CHECKSUM,
+ source: `${url}.checksum`
+ }
+ });
+ expect(HttpClient.prototype.head).toHaveBeenCalledWith(url);
+ expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
+ expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.checksum`);
+ }
+ );
+
+ it.each([
+ ['latest', '25.0.4+1.635.79'],
+ ['25.0.4', '25.0.4+1.635.79'],
+ ['25.0.4.0', '25.0.4+508.27'],
+ ['25.0.4.1', '25.0.4+1.635.79'],
+ ['25.0.4.1+635.79', '25.0.4+1.635.79'],
+ ['25.0.4+1.635.9', '25.0.4+1.635.9'],
+ ['25.0.4+508.27', '25.0.4+508.27']
+ ])('resolves %s to %s', async (input, expected) => {
+ const distribution = new JetBrainsDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: true
+ });
+
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).resolves.toMatchObject({version: expected});
+ });
+
+ it('resolves early-access hotfix releases separately', async () => {
+ jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: [
+ release('jbr-release-25.0.4.1b635.79', true),
+ release('jbr-release-25.0.4.2b636.1', false)
+ ]
+ });
+ const distribution = new JetBrainsDistribution({
+ version: '25.0.4.1-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: true
+ });
+
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).resolves.toMatchObject({version: '25.0.4+1.635.79'});
+ });
+
+ it.each(['25.0.4.2', '25.0.4.1+635.80'])(
+ 'does not substitute another patch or build for %s',
+ async input => {
+ const distribution = new JetBrainsDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: true
+ });
+
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(/No matching version found/);
+ }
+ );
+ });
+
+ it('version is not found', async () => {
+ const distribution = new JetBrainsDistribution({
+ version: '8.0.452',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+ await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow(
+ /No matching version found for SemVer */
+ );
+ });
+
+ it('version list is empty', async () => {
+ const distribution = new JetBrainsDistribution({
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => [];
+ await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
+ /No matching version found for SemVer */
+ );
+ });
+
+ it('fetches the authoritative sha512 checksum only for the resolved version', async () => {
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+
+ const result = await distribution['findPackageForDownload']('21');
+
+ expect(result.checksum).toEqual({
+ algorithm: 'sha512',
+ value: JETBRAINS_CHECKSUM,
+ source: `${result.url}.checksum`
+ });
+ // Only the single resolved/winning version's checksum is requested,
+ // not one per candidate considered during version resolution.
+ expect(spyHttpClientGet).toHaveBeenCalledWith(`${result.url}.checksum`);
+ expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
+ });
+
+ it('parses only the first whitespace-delimited token from the GNU checksum payload', async () => {
+ spyHttpClientGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => `${JETBRAINS_CHECKSUM} jbrsdk-21.tar.gz\n`
+ } as any);
+
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+
+ const result = await distribution['findPackageForDownload']('21');
+
+ expect(result.checksum?.value).toBe(JETBRAINS_CHECKSUM);
+ });
+
+ it('falls back to a sha256 checksum for older JBR builds that only publish one', async () => {
+ // Older JBR 11 builds (e.g. jbrsdk_nomod-11_0_16-*-b2043.64.tar.gz) publish
+ // a SHA-256 digest at the generic `.checksum` sibling instead of SHA-512.
+ const sha256Checksum = 'a'.repeat(64);
+ spyHttpClientGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () =>
+ `${sha256Checksum} jbrsdk_nomod-11_0_16-osx-x64-b2043.64.tar.gz\n`
+ } as any);
+
+ const distribution = new JetBrainsDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+
+ const result = await distribution['findPackageForDownload']('21');
+
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: sha256Checksum,
+ source: `${result.url}.checksum`
+ });
+ });
+
+ describe('compareVersions', () => {
+ it.each([
+ ['25.0.4+1.635.79', '25.0.4+508.27', 1],
+ ['25.0.5+1.1', '25.0.4+1.635.79', 1],
+ ['25.0.4+10.1.1', '25.0.4+2.999.99', 1],
+ ['25.0.4+1.635.79', '25.0.4+1.635.9', 1],
+ ['25.0.4+1.636.1', '25.0.4+1.635.79', 1],
+ ['25.0.4+0.635.79', '25.0.4+635.79', 0],
+ ['11.0.11+1522', '11.0.11+1522.1', -1],
+ ['25.0.4', '25.0.4+508.27', -1]
+ ])('compares %s with %s', (first, second, expected) => {
+ const distribution = new JetBrainsDistribution({
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(Math.sign(distribution['compareVersions'](first, second))).toBe(
+ expected
+ );
+ expect(
+ Math.sign(distribution['compareVersions'](second, first)) || 0
+ ).toBe(-expected || 0);
+ });
+ });
+
+ describe('hotfix releases in the tool cache', () => {
+ let cacheRoot: string;
+ const previousToolcache = process.env['RUNNER_TOOL_CACHE'];
+
+ beforeEach(async () => {
+ cacheRoot = await fs.promises.mkdtemp(
+ path.join(os.tmpdir(), 'jetbrains-')
+ );
+ process.env['RUNNER_TOOL_CACHE'] = cacheRoot;
+ for (const version of ['25.0.4-508.27', '25.0.4-1.635.79']) {
+ const javaPath = path.join(
+ cacheRoot,
+ 'Java_JetBrains_jdk',
+ version,
+ 'x64'
+ );
+ await fs.promises.mkdir(javaPath, {recursive: true});
+ await fs.promises.writeFile(`${javaPath}.complete`, '');
+ }
+ });
+
+ afterEach(async () => {
+ if (previousToolcache === undefined) {
+ delete process.env['RUNNER_TOOL_CACHE'];
+ } else {
+ process.env['RUNNER_TOOL_CACHE'] = previousToolcache;
+ }
+ await fs.promises.rm(cacheRoot, {recursive: true, force: true});
+ });
+
+ it.each(['25', '25.0.4.1', '25.0.4.1+635.79'])(
+ 'reuses the patched JBR for %s',
+ input => {
+ const distribution = new JetBrainsDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(distribution['findInToolcache']()).toEqual({
+ version: '25.0.4+1.635.79',
+ path: path.join(
+ cacheRoot,
+ 'Java_JetBrains_jdk',
+ '25.0.4-1.635.79',
+ 'x64'
+ )
+ });
+ }
+ );
+ });
+});
diff --git a/__tests__/distributors/kona-installer.test.ts b/__tests__/distributors/kona-installer.test.ts
new file mode 100644
index 000000000..ba5a83266
--- /dev/null
+++ b/__tests__/distributors/kona-installer.test.ts
@@ -0,0 +1,265 @@
+import {KonaDistribution} from '../../src/distributions/kona/installer.js';
+
+import manifestData from '../data/kona.json' with {type: 'json'};
+
+function mockDistr(
+ version: string,
+ os: string,
+ arch: string,
+ packageType: string
+): KonaDistribution {
+ const distribution = new KonaDistribution({
+ version: version,
+ architecture: arch,
+ packageType: packageType,
+ checkLatest: false
+ });
+
+ distribution['getOs'] = () => os;
+ distribution['fetchReleaseInfo'] = async () => manifestData;
+
+ return distribution;
+}
+
+describe('Check getAvailableReleases', () => {
+ it.each([
+ ['8', 'linux', 'aarch64', 'linux-aarch64'],
+ ['8.0.20', 'macos', 'x86_64', 'macosx-x86_64'],
+ ['11', 'linux', 'x86_64', 'linux-x86_64'],
+ ['11.0.25', 'macos', 'aarch64', 'macosx-aarch64'],
+ ['17.0.13', 'windows', 'x86_64', 'windows-x86_64'],
+ ['21.0.5', 'linux', 'x86_64', 'linux-x86_64'],
+ ['25', 'linux', 'aarch64', 'linux-aarch64'],
+ ['25.0.3', 'macos', 'x86_64', 'macosx-x86_64']
+ ])(
+ 'should get releases with the specified version "%s", OS "%s" and arch "%s"',
+ async (
+ version: string,
+ os: string,
+ arch: string,
+ expectedPattern: string
+ ) => {
+ const distribution = mockDistr(version, os, arch, 'jdk');
+
+ const releases = await distribution['getAvailableReleases']();
+ expect(releases).not.toBeNull();
+ expect(releases.length).toBe(5);
+ releases.forEach(release =>
+ expect(release.downloadUrl).toContain(expectedPattern)
+ );
+ }
+ );
+});
+
+describe('Check findPackageForDownload', () => {
+ it.each([
+ [
+ '8',
+ 'linux',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/TencentKona8.0.20.b1_jdk_linux-aarch64_8u432.tar.gz'
+ ],
+ [
+ '8.0.20',
+ 'linux',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/TencentKona8.0.20.b1_jdk_linux-x86_64_8u432.tar.gz'
+ ],
+ [
+ '8.0.20',
+ 'macos',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/TencentKona8.0.20.b1_jdk_macosx-aarch64_8u432_notarized.tar.gz'
+ ],
+ [
+ '8.0.20',
+ 'macos',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/TencentKona8.0.20.b1_jdk_macosx-x86_64_8u432_notarized.tar.gz'
+ ],
+ [
+ '8.0.20',
+ 'windows',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-8/releases/download/8.0.20-GA/TencentKona8.0.20.b1_jdk_windows-x86_64_8u432_signed.zip'
+ ],
+
+ [
+ '11',
+ 'linux',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/TencentKona-11.0.25.b1-jdk_linux-aarch64.tar.gz'
+ ],
+ [
+ '11.0.25',
+ 'linux',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/TencentKona-11.0.25.b1-jdk_linux-x86_64.tar.gz'
+ ],
+ [
+ '11.0.25',
+ 'macos',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/TencentKona-11.0.25.b1_jdk_macosx-aarch64_notarized.tar.gz'
+ ],
+ [
+ '11.0.25',
+ 'macos',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/TencentKona-11.0.25.b1_jdk_macosx-x86_64_notarized.tar.gz'
+ ],
+ [
+ '11.0.25',
+ 'windows',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-11/releases/download/kona11.0.25/TencentKona-11.0.25.b1_jdk_windows-x86_64_signed.zip'
+ ],
+
+ [
+ '17',
+ 'linux',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/TencentKona-17.0.13.b1-jdk_linux-aarch64.tar.gz'
+ ],
+ [
+ '17.0.13',
+ 'linux',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/TencentKona-17.0.13.b1-jdk_linux-x86_64.tar.gz'
+ ],
+ [
+ '17.0.13',
+ 'macos',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/TencentKona-17.0.13.b1_jdk_macosx-aarch64_notarized.tar.gz'
+ ],
+ [
+ '17.0.13',
+ 'macos',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/TencentKona-17.0.13.b1_jdk_macosx-x86_64_notarized.tar.gz'
+ ],
+ [
+ '17.0.13',
+ 'windows',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-17/releases/download/TencentKona-17.0.13/TencentKona-17.0.13.b1_jdk_windows-x86_64_signed.zip'
+ ],
+
+ [
+ '21',
+ 'linux',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1-jdk_linux-aarch64.tar.gz'
+ ],
+ [
+ '21.0.5',
+ 'linux',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1-jdk_linux-x86_64.tar.gz'
+ ],
+ [
+ '21.0.5',
+ 'macos',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1_jdk_macosx-aarch64_notarized.tar.gz'
+ ],
+ [
+ '21.0.5',
+ 'macos',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1_jdk_macosx-x86_64_notarized.tar.gz'
+ ],
+ [
+ '21.0.5',
+ 'windows',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1_jdk_windows-x86_64_signed.zip'
+ ],
+
+ [
+ '25',
+ 'linux',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1-jdk_linux-aarch64.tar.gz'
+ ],
+ [
+ '25.0.3',
+ 'linux',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1-jdk_linux-x86_64.tar.gz'
+ ],
+ [
+ '25.0.3',
+ 'macos',
+ 'aarch64',
+ 'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_macosx-aarch64_notarized.tar.gz'
+ ],
+ [
+ '25.0.3',
+ 'macos',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_macosx-x86_64_notarized.tar.gz'
+ ],
+ [
+ '25.0.3',
+ 'windows',
+ 'x86_64',
+ 'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_windows-x86_64_signed.zip'
+ ]
+ ])(
+ 'should return the download URL with the specified version "%s", OS "%s" and arch "%s"',
+ async (version: string, os: string, arch: string, expectedUrl: string) => {
+ const distribution = mockDistr(version, os, arch, 'jdk');
+
+ const availableRelease =
+ await distribution['findPackageForDownload'](version);
+ expect(availableRelease).not.toBeNull();
+ expect(availableRelease.url).toBe(expectedUrl);
+ if (availableRelease.checksum) {
+ expect(availableRelease.checksum).toEqual({
+ algorithm: 'sha256',
+ value: expect.stringMatching(/^[a-f0-9]{64}$/),
+ source: 'https://tencent.github.io/konajdk/releases/kona-v1.json'
+ });
+ } else {
+ expect(version).toBe('8.0.20');
+ }
+ }
+ );
+});
+
+describe('No release is found', () => {
+ it.each([
+ ['8', 'linux', 'x86'],
+ ['8.0.0', 'linux', 'x86_64'],
+ ['11', 'linux', 'ppc64'],
+ ['17', 'solaris', 'x86_64'],
+ ['17', 'windows', 'aarch64'],
+ ['22', 'macos', 'x86_64']
+ ])(
+ `should throw an error due to no release with the specified version "%s", os "%s" and arch "%s"`,
+ async (version: string, os: string, arch: string) => {
+ const distribution = mockDistr(version, os, arch, 'jdk');
+
+ await expect(
+ distribution['findPackageForDownload'](version)
+ ).rejects.toThrow(
+ `No Kona release for the specified version "${version}" on OS "${os}" and arch "${arch}".`
+ );
+ }
+ );
+});
+
+describe('The package type must be jdk', () => {
+ it('should throw an error due to the specified package type is not jdk', async () => {
+ const version = '8.0.20';
+ const os = 'linux';
+ const arch = 'x86_64';
+ const distribution = mockDistr(version, os, arch, 'jre');
+
+ await expect(
+ distribution['findPackageForDownload'](version)
+ ).rejects.toThrow('Kona provides jdk only');
+ });
+});
diff --git a/__tests__/distributors/liberica-installer.test.ts b/__tests__/distributors/liberica-installer.test.ts
index 33a51017d..105a555c0 100644
--- a/__tests__/distributors/liberica-installer.test.ts
+++ b/__tests__/distributors/liberica-installer.test.ts
@@ -1,15 +1,58 @@
-import {LibericaDistributions} from '../../src/distributions/liberica/installer';
import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import fs from 'fs';
+import type {
ArchitectureOptions,
LibericaVersion
-} from '../../src/distributions/liberica/models';
+} from '../../src/distributions/liberica/models.js';
import {HttpClient} from '@actions/http-client';
import os from 'os';
+import path from 'path';
-import manifestData from '../data/liberica.json';
+import manifestData from '../data/liberica.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {LibericaDistributions} =
+ await import('../../src/distributions/liberica/installer.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +61,10 @@ describe('getAvailableVersions', () => {
headers: {},
result: manifestData as LibericaVersion[]
});
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -105,9 +152,11 @@ describe('getAvailableVersions', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
- const distribution = new LibericaDistributions({
+ const distributions = new LibericaDistributions({
version: '17',
architecture: '', // to get default value
packageType: 'jdk',
@@ -117,11 +166,11 @@ describe('getAvailableVersions', () => {
const additionalParams =
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
'updateVersion%2CbuildVersion';
- distribution['getPlatformOption'] = () => 'macos';
+ distributions['getPlatformOption'] = () => 'macos';
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=macos&bundle-type=jdk&bitness=${distroArch.bitness}&arch=${distroArch.arch}&build-type=all${additionalParams}`;
- await distribution['getAvailableVersions']();
+ await distributions['getAvailableVersions']();
expect(spyHttpClient.mock.calls).toHaveLength(1);
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
@@ -176,7 +225,7 @@ describe('getArchitectureOptions', () => {
});
describe('findPackageForDownload', () => {
- let distribution: LibericaDistributions;
+ let distribution: InstanceType;
beforeEach(() => {
distribution = new LibericaDistributions({
@@ -205,14 +254,331 @@ describe('findPackageForDownload', () => {
expect(result.version).toBe(expected);
});
+ describe.each([
+ [17, 20],
+ [25, 4]
+ ])('patch releases for Java %s.0.%s', (featureVersion, updateVersion) => {
+ const mainVersion = `${featureVersion}.0.${updateVersion}`;
+
+ beforeEach(() => {
+ distribution['getAvailableVersions'] = async () =>
+ ['+1', '+10', '.1+1', '.1+2', '.1+10', '.2+1', '.10+1'].map(suffix => ({
+ featureVersion,
+ interimVersion: 0,
+ updateVersion,
+ buildVersion: Number(suffix.split('+')[1]),
+ version: `${mainVersion}${suffix}`,
+ downloadUrl: `https://download.bell-sw.com/java/${mainVersion}${suffix}/bellsoft-jdk${mainVersion}${suffix}-macos-aarch64.tar.gz`
+ }));
+ });
+
+ it.each([
+ [`${mainVersion}+1.1`, `${mainVersion}+1.1`, '.1+1'],
+ [`${mainVersion}+1.2`, `${mainVersion}+1.2`, '.1+2'],
+ [`${mainVersion}+1.10`, `${mainVersion}+1.10`, '.1+10'],
+ [`${mainVersion}+1`, `${mainVersion}+1`, '+1'],
+ [mainVersion, `${mainVersion}+10.1`, '.10+1'],
+ [`${featureVersion}`, `${mainVersion}+10.1`, '.10+1']
+ ])('version is %s -> %s', async (input, expected, suffix) => {
+ const result = await distribution['findPackageForDownload'](input);
+ expect(result).toEqual({
+ version: expected,
+ url: `https://download.bell-sw.com/java/${mainVersion}${suffix}/bellsoft-jdk${mainVersion}${suffix}-macos-aarch64.tar.gz`
+ });
+ });
+
+ it('sorts builds within the same patch numerically', async () => {
+ const versions = await distribution['getAvailableVersions']();
+ distribution['getAvailableVersions'] = async () =>
+ versions.filter(item => item.version.startsWith(`${mainVersion}.1+`));
+
+ const result = await distribution['findPackageForDownload'](mainVersion);
+ expect(result.version).toBe(`${mainVersion}+1.10`);
+ });
+
+ it('selects the newest build for a four-component patch-only request', async () => {
+ const patchDistribution = new LibericaDistributions({
+ version: `${mainVersion}.1`,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ patchDistribution['getAvailableVersions'] =
+ distribution['getAvailableVersions'];
+
+ await expect(
+ patchDistribution['findPackageForDownload'](
+ patchDistribution['version']
+ )
+ ).resolves.toMatchObject({version: `${mainVersion}+1.10`});
+ });
+
+ it('does not substitute a different compound build', async () => {
+ await expect(
+ distribution['findPackageForDownload'](`${mainVersion}+1.3`)
+ ).rejects.toThrow(/No matching version found for SemVer/);
+ });
+ });
+
+ it('selects the latest multi-component patch release for Java 25', async () => {
+ const releases: LibericaVersion[] = [
+ '25.0.5+11',
+ '25.0.5.0.2+5',
+ '25.0.5.0.3+5'
+ ].map(version => {
+ const [versionWithoutBuild, buildVersion] = version.split('+');
+ const [featureVersion, interimVersion, updateVersion] =
+ versionWithoutBuild.split('.').map(Number);
+ return {
+ version,
+ featureVersion,
+ interimVersion,
+ updateVersion,
+ buildVersion: Number(buildVersion),
+ downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
+ };
+ });
+ distribution['getAvailableVersions'] = async () => releases;
+
+ await expect(distribution['findPackageForDownload']('25')).resolves.toEqual(
+ {
+ version: '25.0.5+0.3.5',
+ url: 'https://download.bell-sw.com/java/25.0.5.0.3+5/jdk.tar.gz'
+ }
+ );
+ });
+
+ it('compares patch components before build numbers when patch lengths differ', async () => {
+ const releases: LibericaVersion[] = ['25.0.5.1+10', '25.0.5.1.1+1'].map(
+ version => {
+ const [versionWithoutBuild, buildVersion] = version.split('+');
+ const [featureVersion, interimVersion, updateVersion] =
+ versionWithoutBuild.split('.').map(Number);
+ return {
+ version,
+ featureVersion,
+ interimVersion,
+ updateVersion,
+ buildVersion: Number(buildVersion),
+ downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
+ };
+ }
+ );
+ distribution['getAvailableVersions'] = async () => releases;
+
+ await expect(
+ distribution['findPackageForDownload']('25.0.5')
+ ).resolves.toEqual({
+ version: '25.0.5+1.1.1',
+ url: 'https://download.bell-sw.com/java/25.0.5.1.1+1/jdk.tar.gz'
+ });
+ });
+
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('17')).rejects.toThrow(
- /Could not find satisfied version for semver */
+ /No matching version found for SemVer/
+ );
+ });
+});
+
+describe('patch request resolution from the constructor', () => {
+ const releases: LibericaVersion[] = ['17.0.20+10', '17.0.20.1+1'].map(
+ version => ({
+ featureVersion: 17,
+ interimVersion: 0,
+ updateVersion: 20,
+ buildVersion: Number(version.split('+')[1]),
+ version,
+ downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
+ })
+ );
+ let cacheRoot: string;
+ let previousToolcache: string | undefined;
+
+ beforeEach(async () => {
+ previousToolcache = process.env['RUNNER_TOOL_CACHE'];
+ cacheRoot = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'liberica-'));
+ process.env['RUNNER_TOOL_CACHE'] = cacheRoot;
+ for (const version of ['17.0.20-10', '17.0.20-1.1']) {
+ const javaPath = path.join(
+ cacheRoot,
+ 'Java_Liberica_jdk',
+ version,
+ 'x64'
+ );
+ await fs.promises.mkdir(javaPath, {recursive: true});
+ await fs.promises.writeFile(`${javaPath}.complete`, '');
+ }
+ });
+
+ afterEach(async () => {
+ if (previousToolcache === undefined) {
+ delete process.env['RUNNER_TOOL_CACHE'];
+ } else {
+ process.env['RUNNER_TOOL_CACHE'] = previousToolcache;
+ }
+ await fs.promises.rm(cacheRoot, {recursive: true, force: true});
+ });
+
+ it.each([
+ ['17', '17.0.20+1.1', '17.0.20.1+1'],
+ ['17.0.20', '17.0.20+1.1', '17.0.20.1+1'],
+ ['17.0.20+10', '17.0.20+10', '17.0.20+10'],
+ ['17.0.20+1.1', '17.0.20+1.1', '17.0.20.1+1'],
+ ['17.0.20.1', '17.0.20+1.1', '17.0.20.1+1'],
+ ['17.0.20.1+1', '17.0.20+1.1', '17.0.20.1+1'],
+ ['17.0.20.0', '17.0.20+10', '17.0.20+10']
+ ])(
+ 'resolves %s consistently remotely and in cache',
+ async (input, expected, apiVersion) => {
+ const distribution = new LibericaDistributions({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => releases;
+
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).resolves.toEqual({
+ version: expected,
+ url: `https://download.bell-sw.com/java/${apiVersion}/jdk.tar.gz`
+ });
+ expect(distribution['findInToolcache']()).toEqual({
+ version: expected,
+ path: path.join(
+ cacheRoot,
+ 'Java_Liberica_jdk',
+ expected.replace('+', '-'),
+ 'x64'
+ )
+ });
+ }
+ );
+
+ it.each(['17.0.20.2', '17.0.20+1.2'])(
+ 'does not substitute a different patch or exact build for %s',
+ async version => {
+ const distribution = new LibericaDistributions({
+ version,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => releases;
+
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(/No matching version found/);
+ expect(distribution['findInToolcache']()).toBeNull();
+ }
+ );
+
+ it('keeps patch-only and exact-build resolution cache identities distinct', () => {
+ const distribution = new LibericaDistributions({
+ version: '17.0.20.1',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ expect(distribution['version']).toBe('17.0.20.1');
+ });
+
+ it('normalizes multi-component patch-only requests for exact matching', async () => {
+ const releases: LibericaVersion[] = ['25.0.5.0.2+5', '25.0.5.0.3+5'].map(
+ version => {
+ const [versionWithoutBuild, buildVersion] = version.split('+');
+ const [featureVersion, interimVersion, updateVersion] =
+ versionWithoutBuild.split('.').map(Number);
+ return {
+ version,
+ featureVersion,
+ interimVersion,
+ updateVersion,
+ buildVersion: Number(buildVersion),
+ downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
+ };
+ }
+ );
+ const distribution = new LibericaDistributions({
+ version: '25.0.5.0.3',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => releases;
+
+ expect(distribution['version']).toBe('25.0.5.0.3');
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).resolves.toEqual({
+ version: '25.0.5+0.3.5',
+ url: 'https://download.bell-sw.com/java/25.0.5.0.3+5/jdk.tar.gz'
+ });
+ });
+
+ it('orders main versions, patches, and builds consistently in cache', async () => {
+ for (const version of ['17.0.20-1.2', '17.0.20-1.10', '17.0.21-1']) {
+ const javaPath = path.join(
+ cacheRoot,
+ 'Java_Liberica_jdk',
+ version,
+ 'x64'
+ );
+ await fs.promises.mkdir(javaPath, {recursive: true});
+ await fs.promises.writeFile(`${javaPath}.complete`, '');
+ }
+
+ for (const [version, expected] of [
+ ['17', '17.0.21+1'],
+ ['17.0.20', '17.0.20+1.10'],
+ ['17.0.20.1', '17.0.20+1.10']
+ ]) {
+ const distribution = new LibericaDistributions({
+ version,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ expect(distribution['findInToolcache']()?.version).toBe(expected);
+ }
+ });
+
+ it('preserves early-access handling for patch-only requests', async () => {
+ const javaPath = path.join(
+ cacheRoot,
+ 'Java_Liberica_jdk',
+ '17.0.20-ea.1.2',
+ 'x64'
);
+ await fs.promises.mkdir(javaPath, {recursive: true});
+ await fs.promises.writeFile(`${javaPath}.complete`, '');
+ const distribution = new LibericaDistributions({
+ version: '17.0.20.1-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ expect(distribution['stable']).toBe(false);
+ expect(distribution['findInToolcache']()).toEqual({
+ version: '17.0.20+1.2',
+ path: javaPath
+ });
});
});
describe('getPlatformOption', () => {
+ beforeEach(() => {
+ // The linux row below is glibc, so pin the Alpine probe rather than
+ // letting it depend on the machine running the suite.
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
const distributions = new LibericaDistributions({
architecture: 'x64',
version: '11',
@@ -277,6 +643,76 @@ describe('convertVersionToSemver', () => {
buildVersion: 13
},
'11.0.0+13'
+ ],
+ [
+ {
+ version: '17.0.20.1+1',
+ featureVersion: 17,
+ interimVersion: 0,
+ updateVersion: 20,
+ buildVersion: 1
+ },
+ '17.0.20+1.1'
+ ],
+ [
+ {
+ version: '25.0.4.1+1',
+ featureVersion: 25,
+ interimVersion: 0,
+ updateVersion: 4,
+ buildVersion: 1
+ },
+ '25.0.4+1.1'
+ ],
+ [
+ {
+ version: '25.0.5.0.3+5',
+ featureVersion: 25,
+ interimVersion: 0,
+ updateVersion: 5,
+ buildVersion: 5
+ },
+ '25.0.5+0.3.5'
+ ],
+ [
+ {
+ version: '17.0.20.1+2',
+ featureVersion: 17,
+ interimVersion: 0,
+ updateVersion: 20,
+ buildVersion: 2
+ },
+ '17.0.20+1.2'
+ ],
+ [
+ {
+ version: '25.0.4+1.1',
+ featureVersion: 25,
+ interimVersion: 0,
+ updateVersion: 4,
+ buildVersion: 1
+ },
+ '25.0.4+1.1'
+ ],
+ [
+ {
+ version: '25+36',
+ featureVersion: 25,
+ interimVersion: 0,
+ updateVersion: 0,
+ buildVersion: 36
+ },
+ '25.0.0+36'
+ ],
+ [
+ {
+ version: '8u202',
+ featureVersion: 8,
+ interimVersion: 0,
+ updateVersion: 202,
+ buildVersion: 8
+ },
+ '8.0.202+8'
]
])('%s -> %s', (input, expected) => {
const actual = distributions['convertVersionToSemver']({
@@ -288,3 +724,35 @@ describe('convertVersionToSemver', () => {
expect(actual).toEqual(expected);
});
});
+
+describe('Liberica getPlatformOption libc selection', () => {
+ const distributions = new LibericaDistributions({
+ architecture: 'x64',
+ version: '11',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('selects the musl artifacts on Alpine', () => {
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ expect(distributions['getPlatformOption']('linux')).toBe('linux-musl');
+ });
+
+ it('selects the glibc artifacts on other Linux runners', () => {
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ expect(distributions['getPlatformOption']('linux')).toBe('linux');
+ });
+
+ it('does not probe for Alpine off Linux', () => {
+ const existsSync = jest.spyOn(fs, 'existsSync');
+
+ expect(distributions['getPlatformOption']('darwin')).toBe('macos');
+ expect(existsSync).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/distributors/liberica-linux-installer.test.ts b/__tests__/distributors/liberica-linux-installer.test.ts
index 8e6a665e0..8ecb5b452 100644
--- a/__tests__/distributors/liberica-linux-installer.test.ts
+++ b/__tests__/distributors/liberica-linux-installer.test.ts
@@ -1,15 +1,56 @@
-import {LibericaDistributions} from '../../src/distributions/liberica/installer';
import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {
ArchitectureOptions,
LibericaVersion
-} from '../../src/distributions/liberica/models';
+} from '../../src/distributions/liberica/models.js';
import {HttpClient} from '@actions/http-client';
import os from 'os';
-import manifestData from '../data/liberica-linux.json';
+import manifestData from '../data/liberica-linux.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {LibericaDistributions} =
+ await import('../../src/distributions/liberica/installer.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +59,10 @@ describe('getAvailableVersions', () => {
headers: {},
result: manifestData as LibericaVersion[]
});
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -105,7 +150,9 @@ describe('getAvailableVersions', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const distribution = new LibericaDistributions({
version: '17',
@@ -176,7 +223,7 @@ describe('getArchitectureOptions', () => {
});
describe('findPackageForDownload', () => {
- let distribution: LibericaDistributions;
+ let distribution: InstanceType;
beforeEach(() => {
distribution = new LibericaDistributions({
@@ -207,7 +254,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
- /Could not find satisfied version for semver */
+ /No matching version found for SemVer/
);
});
});
diff --git a/__tests__/distributors/liberica-nik-installer.test.ts b/__tests__/distributors/liberica-nik-installer.test.ts
new file mode 100644
index 000000000..8f1c9ae22
--- /dev/null
+++ b/__tests__/distributors/liberica-nik-installer.test.ts
@@ -0,0 +1,262 @@
+import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
+import fs from 'fs';
+import type {
+ ArchitectureOptions,
+ NikVersion
+} from '../../src/distributions/liberica-nik/models.js';
+import {HttpClient} from '@actions/http-client';
+
+import manifestData from '../data/liberica-nik.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const {LibericaNikDistributions} =
+ await import('../../src/distributions/liberica-nik/installer.js');
+
+const ADDITIONAL_PARAMS =
+ '&installation-type=archive&fields=downloadUrl%2Cversion%2Ccomponents%2Ccomponent%2Cembedded';
+
+describe('getAvailableVersions', () => {
+ let spyHttpClient: any;
+
+ beforeEach(() => {
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {},
+ result: manifestData as NikVersion[]
+ });
+ });
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ jest.restoreAllMocks();
+ });
+
+ it.each([
+ [
+ {version: '21', architecture: 'x64', packageType: 'jdk'},
+ 'bundle-type=standard&bitness=64&arch=x86&build-type=all'
+ ],
+ [
+ {version: '21-ea', architecture: 'x64', packageType: 'jdk'},
+ 'bundle-type=standard&bitness=64&arch=x86&build-type=ea'
+ ],
+ [
+ {version: '21', architecture: 'aarch64', packageType: 'jdk'},
+ 'bundle-type=standard&bitness=64&arch=arm&build-type=all'
+ ],
+ [
+ {version: '21', architecture: 'x64', packageType: 'jdk+fx'},
+ 'bundle-type=full&bitness=64&arch=x86&build-type=all'
+ ]
+ ])('build correct url for %s -> %s', async (input, urlParams) => {
+ const distribution = new LibericaNikDistributions({
+ ...input,
+ checkLatest: false
+ });
+ distribution['getPlatformOption'] = () => 'linux';
+ const buildUrl = `https://api.bell-sw.com/v1/nik/releases?os=linux&${urlParams}${ADDITIONAL_PARAMS}`;
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient.mock.calls).toHaveLength(1);
+ expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
+ });
+
+ it('load available versions', async () => {
+ const distribution = new LibericaNikDistributions({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ const availableVersions = await distribution['getAvailableVersions']();
+ expect(availableVersions).toEqual(manifestData);
+ });
+});
+
+describe('getArchitectureOptions', () => {
+ it.each([
+ ['x64', {bitness: '64', arch: 'x86'}],
+ ['aarch64', {bitness: '64', arch: 'arm'}]
+ ] as [string, ArchitectureOptions][])(
+ 'parse architecture %s -> %s',
+ (input, expected) => {
+ const distributions = new LibericaNikDistributions({
+ architecture: input,
+ checkLatest: false,
+ packageType: 'jdk',
+ version: '21'
+ });
+
+ expect(distributions['getArchitectureOptions']()).toEqual(expected);
+ }
+ );
+
+ it.each(['x86', 'armv7', 's390x'])('not support architecture %s', input => {
+ const distributions = new LibericaNikDistributions({
+ architecture: input,
+ checkLatest: false,
+ packageType: 'jdk',
+ version: '21'
+ });
+
+ expect(() => distributions['getArchitectureOptions']()).toThrow(
+ /Architecture '\w+' is not supported\. Supported architectures: .*/
+ );
+ });
+});
+
+describe('findPackageForDownload', () => {
+ let distribution: InstanceType;
+
+ beforeEach(() => {
+ distribution = new LibericaNikDistributions({
+ version: '',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData;
+ });
+
+ // The user's java-version resolves against the embedded JDK version, not
+ // NIK's own GraalVM version.
+ it.each([
+ ['21', '21.0.11+12'],
+ ['17', '17.0.19+12'],
+ ['25', '25.0.3+12'],
+ ['11', '11.0.22+12'],
+ ['21.0.2', '21.0.2+14'],
+ ['23', '23.0.2+9'],
+ ['20.x', '20.0.2+10'],
+ ['25.0.1', '25.0.1+16']
+ ])('version is %s -> %s', async (input, expected) => {
+ const result = await distribution['findPackageForDownload'](input);
+ expect(result.version).toBe(expected);
+ });
+
+ it('should throw an error', async () => {
+ await expect(distribution['findPackageForDownload']('7')).rejects.toThrow(
+ /No matching version found for SemVer/
+ );
+ });
+});
+
+describe('getPlatformOption', () => {
+ beforeEach(() => {
+ // The linux row below is glibc, so pin the Alpine probe rather than
+ // letting it depend on the machine running the suite.
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ const distributions = new LibericaNikDistributions({
+ architecture: 'x64',
+ version: '21',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ it.each([
+ ['linux', 'linux'],
+ ['darwin', 'macos'],
+ ['win32', 'windows'],
+ ['cygwin', 'windows']
+ ])('os version %s -> %s', (input, expected) => {
+ const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
+
+ expect(actual).toEqual(expected);
+ });
+
+ it.each(['sunos', 'aix', 'android', 'freebsd'])(
+ 'not support os version %s',
+ input => {
+ expect(() =>
+ distributions['getPlatformOption'](input as NodeJS.Platform)
+ ).toThrow(/Platform '\w+' is not supported\. Supported platforms: .+/);
+ }
+ );
+});
+
+describe('convertVersionToSemver', () => {
+ const distributions = new LibericaNikDistributions({
+ architecture: 'x64',
+ version: '21',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ it.each([
+ ['25.0.1+16', '25.0.1+16'],
+ ['21+37', '21.0.0+37'],
+ ['23+38', '23.0.0+38'],
+ ['11.0.15.1+2', '11.0.15+1.2'],
+ ['17.0.5', '17.0.5']
+ ])('%s -> %s', (input, expected) => {
+ const actual = distributions['convertVersionToSemver'](input);
+ expect(actual).toEqual(expected);
+ });
+});
+
+describe('Liberica NIK getPlatformOption libc selection', () => {
+ const distributions = new LibericaNikDistributions({
+ architecture: 'x64',
+ version: '21',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('selects the musl artifacts on Alpine', () => {
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ expect(distributions['getPlatformOption']('linux')).toBe('linux-musl');
+ });
+
+ it('selects the glibc artifacts on other Linux runners', () => {
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ expect(distributions['getPlatformOption']('linux')).toBe('linux');
+ });
+
+ it('does not probe for Alpine off Linux', () => {
+ const existsSync = jest.spyOn(fs, 'existsSync');
+
+ expect(distributions['getPlatformOption']('darwin')).toBe('macos');
+ expect(existsSync).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/distributors/liberica-windows-installer.test.ts b/__tests__/distributors/liberica-windows-installer.test.ts
index 1ccc57ede..a4fe5f591 100644
--- a/__tests__/distributors/liberica-windows-installer.test.ts
+++ b/__tests__/distributors/liberica-windows-installer.test.ts
@@ -1,15 +1,56 @@
-import {LibericaDistributions} from '../../src/distributions/liberica/installer';
import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {
ArchitectureOptions,
LibericaVersion
-} from '../../src/distributions/liberica/models';
+} from '../../src/distributions/liberica/models.js';
import {HttpClient} from '@actions/http-client';
import os from 'os';
-import manifestData from '../data/liberica-windows.json';
+import manifestData from '../data/liberica-windows.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {LibericaDistributions} =
+ await import('../../src/distributions/liberica/installer.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +59,9 @@ describe('getAvailableVersions', () => {
headers: {},
result: manifestData as LibericaVersion[]
});
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -105,7 +149,9 @@ describe('getAvailableVersions', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const distribution = new LibericaDistributions({
version: '17',
@@ -176,7 +222,7 @@ describe('getArchitectureOptions', () => {
});
describe('findPackageForDownload', () => {
- let distribution: LibericaDistributions;
+ let distribution: InstanceType;
beforeEach(() => {
distribution = new LibericaDistributions({
@@ -207,7 +253,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
- /Could not find satisfied version for semver */
+ /No matching version found for SemVer/
);
});
});
diff --git a/__tests__/distributors/local-installer.test.ts b/__tests__/distributors/local-installer.test.ts
index 8e9d5d437..6d0521fc9 100644
--- a/__tests__/distributors/local-installer.test.ts
+++ b/__tests__/distributors/local-installer.test.ts
@@ -1,36 +1,114 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
import fs from 'fs';
-import * as tc from '@actions/tool-cache';
-import * as core from '@actions/core';
-
import path from 'path';
import * as semver from 'semver';
-import * as util from '../../src/util';
-
-import {LocalDistribution} from '../../src/distributions/local/installer';
+import os from 'os';
+
+const realStatSync = fs.statSync;
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ find: jest.fn(),
+ findAllVersions: jest.fn(),
+ downloadTool: jest.fn(),
+ extractZip: jest.fn(),
+ extractTar: jest.fn(),
+ extract7z: jest.fn(),
+ extractXar: jest.fn(),
+ cacheDir: jest.fn(),
+ cacheFile: jest.fn(),
+ getManifestFromRepo: jest.fn(),
+ findFromManifest: jest.fn(),
+ evaluateVersions: jest.fn()
+}));
+
+jest.unstable_mockModule('../../src/jdk-cache.js', () => ({
+ getJdkVerificationIdentity: jest.fn(() => 'disabled'),
+ registerJdk: jest.fn(),
+ restoreJdk: jest.fn()
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getToolcachePath: jest.fn(),
+ isJobStatusSuccess: jest.fn(),
+ renameWinArchive: jest.fn(),
+ isVersionSatisfies: real_util_module.isVersionSatisfies,
+ getTempDir: real_util_module.getTempDir
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const tc = await import('@actions/tool-cache');
+const util = await import('../../src/util.js');
+const jdkCache = await import('../../src/jdk-cache.js');
+const {LocalDistribution} =
+ await import('../../src/distributions/local/installer.js');
describe('setupJava', () => {
const actualJavaVersion = '11.1.10';
const javaPath = path.join('Java_jdkfile_jdk', actualJavaVersion, 'x86');
- let mockJavaBase: LocalDistribution;
-
- let spyGetToolcachePath: jest.SpyInstance;
- let spyTcCacheDir: jest.SpyInstance;
- let spyTcFindAllVersions: jest.SpyInstance;
- let spyCoreDebug: jest.SpyInstance;
- let spyCoreInfo: jest.SpyInstance;
- let spyCoreExportVariable: jest.SpyInstance;
- let spyCoreAddPath: jest.SpyInstance;
- let spyCoreSetOutput: jest.SpyInstance;
- let spyFsStat: jest.SpyInstance;
- let spyFsReadDir: jest.SpyInstance;
- let spyUtilsExtractJdkFile: jest.SpyInstance;
- let spyPathResolve: jest.SpyInstance;
+ let mockJavaBase: InstanceType;
+
+ let spyGetToolcachePath: any;
+ let spyTcCacheDir: any;
+ let spyTcFindAllVersions: any;
+ let spyCoreDebug: any;
+ let spyCoreInfo: any;
+ let spyCoreExportVariable: any;
+ let spyCoreAddPath: any;
+ let spyCoreSetOutput: any;
+ let spyFsStat: any;
+ let spyFsReadDir: any;
+ let spyUtilsExtractJdkFile: any;
+ let spyPathResolve: any;
+ let spyCoreError: any;
const expectedJdkFile = 'JavaLocalJdkFile';
beforeEach(() => {
- spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
+ (jdkCache.getJdkVerificationIdentity as jest.Mock).mockReturnValue(
+ 'disabled'
+ );
+ spyGetToolcachePath = util.getToolcachePath as jest.Mock;
spyGetToolcachePath.mockImplementation(
(toolname: string, javaVersion: string, architecture: string) => {
const semverVersion = new semver.Range(javaVersion);
@@ -48,7 +126,7 @@ describe('setupJava', () => {
}
);
- spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
+ spyTcCacheDir = tc.cacheDir as jest.Mock;
spyTcCacheDir.mockImplementation(
(
archivePath: string,
@@ -58,23 +136,23 @@ describe('setupJava', () => {
) => path.join(toolcacheFolderName, version, architecture)
);
- spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
+ spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
// Spy on core methods
- spyCoreDebug = jest.spyOn(core, 'debug');
+ spyCoreDebug = core.debug as jest.Mock;
spyCoreDebug.mockImplementation(() => undefined);
- spyCoreInfo = jest.spyOn(core, 'info');
+ spyCoreInfo = core.info as jest.Mock;
spyCoreInfo.mockImplementation(() => undefined);
- spyCoreAddPath = jest.spyOn(core, 'addPath');
+ spyCoreAddPath = core.addPath as jest.Mock;
spyCoreAddPath.mockImplementation(() => undefined);
- spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
+ spyCoreExportVariable = core.exportVariable as jest.Mock;
spyCoreExportVariable.mockImplementation(() => undefined);
- spyCoreSetOutput = jest.spyOn(core, 'setOutput');
+ spyCoreSetOutput = core.setOutput as jest.Mock;
spyCoreSetOutput.mockImplementation(() => undefined);
// Spy on fs methods
@@ -87,12 +165,16 @@ describe('setupJava', () => {
});
// Spy on util methods
- spyUtilsExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
+ spyUtilsExtractJdkFile = util.extractJdkFile as jest.Mock;
spyUtilsExtractJdkFile.mockImplementation(() => 'some/random/path/');
// Spy on path methods
spyPathResolve = jest.spyOn(path, 'resolve');
spyPathResolve.mockImplementation((path: string) => path);
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -101,6 +183,20 @@ describe('setupJava', () => {
jest.restoreAllMocks();
});
+ it('throws for the latest alias since jdkfile has no version list', async () => {
+ const inputs = {
+ version: 'latest',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false
+ };
+
+ mockJavaBase = new LocalDistribution(inputs, expectedJdkFile);
+ await expect(mockJavaBase.setupJava()).rejects.toThrow(
+ "The 'latest' version alias is not supported for the 'jdkfile' distribution. Please specify a concrete version."
+ );
+ });
+
it('java is resolved from toolcache, jdkfile is untouched', async () => {
const inputs = {
version: actualJavaVersion,
@@ -125,6 +221,95 @@ describe('setupJava', () => {
);
});
+ it('java is unpacked from jdkfile when force-download is enabled', async () => {
+ const inputs = {
+ version: actualJavaVersion,
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ forceDownload: true
+ };
+
+ mockJavaBase = new LocalDistribution(inputs, expectedJdkFile);
+ await expect(mockJavaBase.setupJava()).resolves.toEqual({
+ version: actualJavaVersion,
+ path: javaPath
+ });
+
+ expect(spyGetToolcachePath).not.toHaveBeenCalled();
+ expect(spyUtilsExtractJdkFile).toHaveBeenCalledWith(expectedJdkFile);
+ expect(spyTcCacheDir).toHaveBeenCalled();
+ expect(spyCoreInfo).not.toHaveBeenCalledWith(
+ `Resolved Java ${actualJavaVersion} from tool-cache`
+ );
+ });
+
+ it.each([
+ [false, true, true],
+ [true, false, true]
+ ])(
+ 'handles jdkfile caching with force-download=%s',
+ async (forceDownload, restores, registers) => {
+ const temporaryDirectory = fs.mkdtempSync(
+ path.join(os.tmpdir(), 'setup-java-local-cache-')
+ );
+ const jdkFile = path.join(temporaryDirectory, 'java.tar.gz');
+ fs.writeFileSync(jdkFile, 'jdk archive');
+ spyGetToolcachePath.mockReturnValue('');
+ spyFsStat.mockImplementation((file: string) => realStatSync(file));
+ (jdkCache.restoreJdk as jest.Mock).mockResolvedValue(false);
+
+ try {
+ mockJavaBase = new LocalDistribution(
+ {
+ version: actualJavaVersion,
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ forceDownload,
+ cacheJdk: true
+ },
+ jdkFile
+ );
+
+ await mockJavaBase.setupJava();
+
+ expect(jdkCache.restoreJdk).toHaveBeenCalledTimes(restores ? 1 : 0);
+ expect(jdkCache.registerJdk).toHaveBeenCalledTimes(registers ? 1 : 0);
+ expect(
+ (jdkCache.restoreJdk as jest.Mock).mock.calls[0]?.[0] ??
+ (jdkCache.registerJdk as jest.Mock).mock.calls[0]?.[0]
+ ).toEqual(
+ expect.objectContaining({
+ distribution: 'jdkfile',
+ version: actualJavaVersion,
+ verification: 'disabled'
+ })
+ );
+ } finally {
+ fs.rmSync(temporaryDirectory, {recursive: true});
+ }
+ }
+ );
+
+ it('rejects signature verification for jdkfile archives', async () => {
+ mockJavaBase = new LocalDistribution(
+ {
+ version: actualJavaVersion,
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ },
+ expectedJdkFile
+ );
+
+ await expect(mockJavaBase.setupJava()).rejects.toThrow(
+ "Input 'verify-signature' is not supported for distribution 'jdkfile'."
+ );
+ expect(spyGetToolcachePath).not.toHaveBeenCalled();
+ });
+
it("java is resolved from toolcache, jdkfile doesn't exist", async () => {
const inputs = {
version: actualJavaVersion,
@@ -214,7 +399,7 @@ describe('setupJava', () => {
);
});
- it('java is resolved from toolcache including Contents/Home on MacOS', async () => {
+ it('java is resolved from toolcache including Contents/Home on macOS', async () => {
const inputs = {
version: actualJavaVersion,
architecture: 'x86',
@@ -257,7 +442,7 @@ describe('setupJava', () => {
});
});
- it('java is unpacked from jdkfile including Contents/Home on MacOS', async () => {
+ it('java is unpacked from jdkfile including Contents/Home on macOS', async () => {
const inputs = {
version: '11.0.289',
architecture: 'x86',
diff --git a/__tests__/distributors/microsoft-installer.test.ts b/__tests__/distributors/microsoft-installer.test.ts
index 00c4b6c6e..d0520577f 100644
--- a/__tests__/distributors/microsoft-installer.test.ts
+++ b/__tests__/distributors/microsoft-installer.test.ts
@@ -1,15 +1,118 @@
-import {MicrosoftDistributions} from '../../src/distributions/microsoft/installer';
-import os from 'os';
-import data from '../data/microsoft.json';
-import * as httpm from '@actions/http-client';
-import * as core from '@actions/core';
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import {HttpClient} from '@actions/http-client';
+import data from '../data/microsoft.json' with {type: 'json'};
+
+const mockOsArch = jest.fn(() => 'x64');
+const mockOsPlatform = jest.fn(() => 'linux');
+
+const real_os_module = await import('os');
+jest.unstable_mockModule('os', () => ({
+ ...real_os_module,
+ default: {
+ ...real_os_module.default,
+ arch: mockOsArch,
+ platform: mockOsPlatform,
+ homedir: real_os_module.default.homedir
+ },
+ arch: mockOsArch,
+ platform: mockOsPlatform
+}));
+
+const real_fs_module = await import('fs');
+const mockReaddirSync = jest.fn();
+jest.unstable_mockModule('fs', () => ({
+ ...real_fs_module,
+ default: {
+ ...real_fs_module.default,
+ readdirSync: mockReaddirSync
+ },
+ readdirSync: mockReaddirSync
+}));
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_tc_module = await import('@actions/tool-cache');
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ ...real_tc_module,
+ downloadTool: jest.fn(),
+ cacheDir: jest.fn(),
+ cacheFile: jest.fn()
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getToolcachePath: jest.fn(),
+ isJobStatusSuccess: jest.fn(),
+ renameWinArchive: jest.fn(),
+ isVersionSatisfies: real_util_module.isVersionSatisfies,
+ getTempDir: real_util_module.getTempDir
+}));
+
+jest.unstable_mockModule('../../src/gpg.js', () => ({
+ importKey: jest.fn(),
+ removeGpgHome: jest.fn(),
+ verifyPackageSignature: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const gpg = await import('../../src/gpg.js');
+const tc = await import('@actions/tool-cache');
+const os = (await import('os')).default;
+const fs = (await import('fs')).default;
+const {MicrosoftDistributions, MICROSOFT_PUBLIC_KEY} =
+ await import('../../src/distributions/microsoft/installer.js');
+const util = await import('../../src/util.js');
describe('findPackageForDownload', () => {
- let distribution: MicrosoftDistributions;
- let spyGetManifestFromRepo: jest.SpyInstance;
- let spyDebug: jest.SpyInstance;
+ let distribution: InstanceType;
+ let spyGetManifestFromRepo: any;
+ let spyHttpClientGet: any;
+ let spyDebug: any;
+ let spyCoreError: any;
+
+ const MICROSOFT_CHECKSUM = 'b'.repeat(64);
beforeEach(() => {
+ mockOsArch.mockReturnValue('x64');
+ mockOsPlatform.mockReturnValue(process.platform);
+
distribution = new MicrosoftDistributions({
version: '',
architecture: 'x64',
@@ -17,33 +120,56 @@ describe('findPackageForDownload', () => {
checkLatest: false
});
- spyGetManifestFromRepo = jest.spyOn(httpm.HttpClient.prototype, 'getJson');
+ spyGetManifestFromRepo = jest.spyOn(HttpClient.prototype, 'getJson');
spyGetManifestFromRepo.mockReturnValue({
result: data,
statusCode: 200,
headers: {}
});
- spyDebug = jest.spyOn(core, 'debug');
+ // Every resolved release fetches `${download_url}.sha256sum.txt`; stub
+ // it with a GNU-style ` ` payload so tests never reach
+ // the real network.
+ spyHttpClientGet = jest.spyOn(HttpClient.prototype, 'get');
+ spyHttpClientGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => `${MICROSOFT_CHECKSUM} microsoft-jdk.tar.gz\n`
+ });
+
+ spyDebug = core.debug as jest.Mock;
spyDebug.mockImplementation(() => {});
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
it.each([
+ [
+ '25.x',
+ '25.0.0',
+ 'https://aka.ms/download-jdk/microsoft-jdk-25.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
+ ],
[
'21.x',
'21.0.0',
'https://aka.ms/download-jdk/microsoft-jdk-21.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
],
[
- '17.0.1',
- '17.0.1+12.1',
- 'https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
+ '17.x',
+ '17.0.18',
+ 'https://aka.ms/download-jdk/microsoft-jdk-17.0.18-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
],
[
- '17.x',
+ '17.0.7',
'17.0.7',
'https://aka.ms/download-jdk/microsoft-jdk-17.0.7-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
],
+ [
+ '17.0.1',
+ '17.0.1+12.1',
+ 'https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
+ ],
[
'16.0.x',
'16.0.2+7.1',
@@ -87,6 +213,173 @@ describe('findPackageForDownload', () => {
.replace('{{OS_TYPE}}', os)
.replace('{{ARCHIVE_TYPE}}', archive);
expect(result.url).toBe(url);
+ expect(result.signatureUrl).toBe(`${url}.sig`);
+ });
+
+ describe.each(['25.0.5.0.2', '25.0.5+0.2', '25.0.5'])(
+ 'version %s missing from the live manifest',
+ version => {
+ it.each([
+ ['darwin', 'x64', 'macos', 'tar.gz'],
+ ['linux', 'x64', 'linux', 'tar.gz'],
+ ['win32', 'x64', 'windows', 'zip'],
+ ['darwin', 'aarch64', 'macos', 'tar.gz'],
+ ['linux', 'aarch64', 'linux', 'tar.gz'],
+ ['win32', 'aarch64', 'windows', 'zip']
+ ])(
+ 'resolves the bundled release for %s/%s',
+ async (platform, architecture, osType, extension) => {
+ mockOsPlatform.mockReturnValue(platform);
+ const distro = new MicrosoftDistributions({
+ version,
+ architecture,
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const result = await distro['findPackageForDownload'](
+ distro['version']
+ );
+ const url = `https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-${osType}-${architecture}.${extension}`;
+
+ expect(result).toEqual({
+ version: '25.0.5+0.2',
+ url,
+ signatureUrl: `${url}.sig`,
+ checksum: {
+ algorithm: 'sha256',
+ value: MICROSOFT_CHECKSUM,
+ source: `${url}.sha256sum.txt`
+ }
+ });
+ expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.sha256sum.txt`);
+ }
+ );
+ }
+ );
+
+ it('prefers the live manifest when it contains the requested release', async () => {
+ mockOsPlatform.mockReturnValue('linux');
+ const url =
+ 'https://example.test/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz';
+ spyGetManifestFromRepo.mockResolvedValue({
+ result: [
+ {
+ version: '25.0.5+0.2',
+ stable: true,
+ release_url: 'https://aka.ms/download-jdk',
+ files: [
+ {
+ filename: 'microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz',
+ arch: 'x64',
+ platform: 'linux',
+ download_url: url
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await distribution['findPackageForDownload']('25.0.5+0.2');
+
+ expect(result.version).toBe('25.0.5+0.2');
+ expect(result.url).toBe(url);
+ expect(spyGetManifestFromRepo).toHaveBeenCalledWith(
+ 'https://aka.ms/download-jdk/microsoft-openjdk-versions.json',
+ {accept: 'application/json'}
+ );
+ });
+
+ it('falls back to the bundled build when the live manifest has another build', async () => {
+ mockOsPlatform.mockReturnValue('linux');
+ spyGetManifestFromRepo.mockResolvedValue({
+ result: [
+ {
+ version: '25.0.5+0.3',
+ stable: true,
+ release_url: 'https://aka.ms/download-jdk',
+ files: [
+ {
+ filename: 'microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz',
+ arch: 'x64',
+ platform: 'linux',
+ download_url:
+ 'https://example.test/microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+
+ const result = await distribution['findPackageForDownload']('25.0.5+0.2');
+
+ expect(result.version).toBe('25.0.5+0.2');
+ expect(result.url).toBe(
+ 'https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz'
+ );
+ });
+
+ it('matches dotted Java versions without falling back to the base release', async () => {
+ mockOsPlatform.mockReturnValue('linux');
+ spyGetManifestFromRepo.mockResolvedValue({
+ result: [
+ {
+ version: '17.0.8',
+ stable: true,
+ release_url: 'https://aka.ms/download-jdk',
+ files: [
+ {
+ filename: 'microsoft-jdk-17.0.8-linux-x64.tar.gz',
+ arch: 'x64',
+ platform: 'linux',
+ download_url: 'https://example.test/microsoft-jdk-17.0.8.tar.gz'
+ }
+ ]
+ },
+ {
+ version: '17.0.8.1',
+ stable: true,
+ release_url: 'https://aka.ms/download-jdk',
+ files: [
+ {
+ filename: 'microsoft-jdk-17.0.8.1-linux-x64.tar.gz',
+ arch: 'x64',
+ platform: 'linux',
+ download_url: 'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+ distribution = new MicrosoftDistributions({
+ version: '17.0.8.1',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const result = await distribution['findPackageForDownload'](
+ distribution['version']
+ );
+
+ expect(result.version).toBe('17.0.8+1');
+ expect(result.url).toBe(
+ 'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
+ );
+ });
+
+ it('preserves the error when the live manifest cannot be loaded', async () => {
+ spyGetManifestFromRepo.mockRejectedValue(new Error('Network error'));
+
+ await expect(
+ distribution['findPackageForDownload']('25.0.5+0.2')
+ ).rejects.toThrow('Could not load manifest for Microsoft Build of OpenJDK');
});
it.each([
@@ -95,8 +388,8 @@ describe('findPackageForDownload', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
- jest.spyOn(os, 'platform').mockReturnValue('darwin');
+ mockOsArch.mockReturnValue(osArch);
+ mockOsPlatform.mockReturnValue('darwin');
const version = '17';
const distro = new MicrosoftDistributions({
@@ -107,7 +400,7 @@ describe('findPackageForDownload', () => {
});
const result = await distro['findPackageForDownload'](version);
- const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-${distroArch}.tar.gz`;
+ const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.18-macos-${distroArch}.tar.gz`;
expect(result.url).toBe(expectedUrl);
}
@@ -119,8 +412,8 @@ describe('findPackageForDownload', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
- jest.spyOn(os, 'platform').mockReturnValue('linux');
+ mockOsArch.mockReturnValue(osArch);
+ mockOsPlatform.mockReturnValue('linux');
const version = '17';
const distro = new MicrosoftDistributions({
@@ -131,7 +424,7 @@ describe('findPackageForDownload', () => {
});
const result = await distro['findPackageForDownload'](version);
- const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-${distroArch}.tar.gz`;
+ const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.18-linux-${distroArch}.tar.gz`;
expect(result.url).toBe(expectedUrl);
}
@@ -143,8 +436,8 @@ describe('findPackageForDownload', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
- jest.spyOn(os, 'platform').mockReturnValue('win32');
+ mockOsArch.mockReturnValue(osArch);
+ mockOsPlatform.mockReturnValue('win32');
const version = '17';
const distro = new MicrosoftDistributions({
@@ -155,7 +448,7 @@ describe('findPackageForDownload', () => {
});
const result = await distro['findPackageForDownload'](version);
- const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-${distroArch}.zip`;
+ const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.18-windows-${distroArch}.zip`;
expect(result.url).toBe(expectedUrl);
}
@@ -163,7 +456,239 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
+ /No matching version found for SemVer */
);
});
+
+ it('uses manifest-provided signature URL when available', async () => {
+ spyGetManifestFromRepo.mockReturnValue({
+ result: [
+ {
+ version: '17.0.10',
+ stable: true,
+ release_url: 'https://example.test',
+ files: [
+ {
+ filename: 'microsoft-jdk-17.0.10-linux-x64.tar.gz',
+ arch: 'x64',
+ platform: 'linux',
+ download_url: 'https://example.test/jdk.tar.gz',
+ signature_url: 'https://example.test/jdk.tar.gz.custom.sig'
+ }
+ ]
+ }
+ ],
+ statusCode: 200,
+ headers: {}
+ });
+ mockOsPlatform.mockReturnValue('linux');
+
+ const result = await distribution['findPackageForDownload']('17.0.10');
+
+ expect(result.signatureUrl).toBe(
+ 'https://example.test/jdk.tar.gz.custom.sig'
+ );
+ });
+
+ it('fetches the authoritative sha256 checksum from the GNU-style sibling file', async () => {
+ mockOsPlatform.mockReturnValue(process.platform);
+
+ const result = await distribution['findPackageForDownload']('17.0.7');
+
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: MICROSOFT_CHECKSUM,
+ source: `${result.url}.sha256sum.txt`
+ });
+ expect(spyHttpClientGet).toHaveBeenCalledWith(
+ `${result.url}.sha256sum.txt`
+ );
+ expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
+ });
+
+ it('parses only the first whitespace-delimited token from the GNU checksum payload', async () => {
+ spyHttpClientGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () =>
+ `${MICROSOFT_CHECKSUM} microsoft-jdk-17.0.7-linux-x64.tar.gz\n`
+ });
+
+ const result = await distribution['findPackageForDownload']('17.0.7');
+
+ expect(result.checksum?.value).toBe(MICROSOFT_CHECKSUM);
+ });
+});
+
+describe('downloadTool', () => {
+ let spyDownloadTool: any;
+ let spyExtractJdkFile: any;
+ let spyCacheDir: any;
+ let spyVerifySignature: any;
+ let distribution: InstanceType;
+
+ beforeEach(() => {
+ mockOsPlatform.mockReturnValue(process.platform);
+
+ distribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ spyDownloadTool = tc.downloadTool as jest.Mock;
+ spyDownloadTool.mockImplementation(async () => {
+ return '/tmp/jdk.tar.gz';
+ });
+
+ spyExtractJdkFile = util.extractJdkFile as jest.Mock;
+ spyExtractJdkFile.mockImplementation(async () => {
+ return '/tmp/unpacked';
+ });
+
+ mockReaddirSync.mockReturnValue(['jdk'] as any);
+ spyCacheDir = tc.cacheDir as jest.Mock;
+ spyCacheDir.mockImplementation(async () => {
+ return '/tmp/cached';
+ });
+
+ (util.renameWinArchive as jest.Mock).mockImplementation(
+ (archivePath: string) => `${archivePath}.zip`
+ );
+
+ spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
+ spyVerifySignature.mockImplementation(async () => {});
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('verifies signatures by default', async () => {
+ const signedDistribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await signedDistribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ });
+
+ expect(spyVerifySignature).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ MICROSOFT_PUBLIC_KEY
+ );
+ });
+
+ it('uses custom public key when verifySignaturePublicKey is provided', async () => {
+ const customKey =
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\ncustom\n-----END PGP PUBLIC KEY BLOCK-----';
+ const signedDistribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true,
+ verifySignaturePublicKey: customKey
+ });
+
+ await signedDistribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ });
+
+ expect(spyVerifySignature).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ customKey
+ );
+ });
+
+ it('warns with key rotation recovery guidance when default verification fails', async () => {
+ spyVerifySignature.mockRejectedValue(new Error('bad signature'));
+ const signedDistribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await signedDistribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ });
+
+ expect(core.warning).toHaveBeenCalledWith(
+ expect.stringMatching(
+ /bad signature.*https:\/\/github\.com\/actions\/setup-java#download-integrity-and-signatures/
+ )
+ );
+ expect(spyExtractJdkFile).toHaveBeenCalled();
+ });
+
+ it('fails with recovery guidance when verification is explicitly enabled', async () => {
+ spyVerifySignature.mockRejectedValue(new Error('bad signature'));
+ const signedDistribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ });
+
+ await expect(
+ signedDistribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ })
+ ).rejects.toThrow(
+ /bad signature.*https:\/\/github\.com\/actions\/setup-java#download-integrity-and-signatures/
+ );
+ expect(spyExtractJdkFile).not.toHaveBeenCalled();
+ });
+
+ it('warns when the signature is missing during default verification', async () => {
+ await distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz'
+ });
+
+ expect(core.warning).toHaveBeenCalledWith(
+ "Input 'verify-signature' is enabled, but no signature URL was found for Microsoft Build of OpenJDK version 17.0.14+7."
+ );
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ expect(spyExtractJdkFile).toHaveBeenCalled();
+ });
+
+ it('fails when signature is missing and verification is enabled', async () => {
+ const signedDistribution = new MicrosoftDistributions({
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ });
+
+ await expect(
+ signedDistribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz'
+ })
+ ).rejects.toThrow(
+ "Input 'verify-signature' is enabled, but no signature URL was found for Microsoft Build of OpenJDK version 17.0.14+7."
+ );
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ });
+
+ it('supports signature verification', () => {
+ expect(distribution['supportsSignatureVerification']()).toBe(true);
+ });
});
diff --git a/__tests__/distributors/openjdk-installer.test.ts b/__tests__/distributors/openjdk-installer.test.ts
new file mode 100644
index 000000000..c1cf0faa1
--- /dev/null
+++ b/__tests__/distributors/openjdk-installer.test.ts
@@ -0,0 +1,246 @@
+import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
+import {HttpClient} from '@actions/http-client';
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((value: string) => value),
+ toWin32Path: jest.fn((value: string) => value),
+ toPosixPath: jest.fn((value: string) => value)
+}));
+
+const {OpenJdkDistribution} =
+ await import('../../src/distributions/openjdk/installer.js');
+const {getJavaDistribution} =
+ await import('../../src/distributions/distribution-factory.js');
+
+const homePage = `
+ JDK 26
+ JDK
+ 27
+`;
+const currentPage = `
+ tar.gz
+ tar.gz
+`;
+const earlyAccessPage = `
+ tar.gz
+`;
+const archivePage = `
+ tar.gz
+ tar.gz
+ tar.gz
+ 9.0.4 (build 9.0.4+11) |
+ tar.gz
+`;
+const GA_CHECKSUM = 'c'.repeat(64);
+const EA_CHECKSUM = 'd'.repeat(64);
+const checksumPages: Record = {
+ 'https://download.java.net/java/GA/jdk26.0.2/hash/10/GPL/openjdk-26.0.2_linux-x64_bin.tar.gz.sha256':
+ GA_CHECKSUM,
+ 'https://download.java.net/java/early_access/jdk27/32/GPL/openjdk-27-ea+32_linux-x64_bin.tar.gz.sha256':
+ EA_CHECKSUM
+};
+
+function createDistribution(
+ version = '26',
+ architecture = 'x64',
+ packageType = 'jdk',
+ useFixturePlatform = true
+) {
+ const distribution = new OpenJdkDistribution({
+ version,
+ architecture,
+ packageType,
+ checkLatest: false
+ });
+ if (useFixturePlatform) {
+ distribution['getPlatform'] = jest.fn(() => 'linux');
+ }
+ return distribution;
+}
+
+describe('OpenJdkDistribution', () => {
+ let getSpy: jest.SpiedFunction;
+
+ beforeEach(() => {
+ getSpy = jest
+ .spyOn(HttpClient.prototype, 'get')
+ .mockImplementation(async url => {
+ const pages: Record = {
+ 'https://jdk.java.net/': homePage,
+ 'https://jdk.java.net/26/': currentPage,
+ 'https://jdk.java.net/27/': earlyAccessPage,
+ 'https://jdk.java.net/archive/': archivePage
+ };
+ if (url in pages) {
+ return {
+ message: {statusCode: 200},
+ readBody: async () => pages[url]
+ } as Awaited>;
+ }
+ // Any other GET is a `${archiveUrl}.sha256` checksum sibling request.
+ return {
+ message: {statusCode: 200},
+ readBody: async () => checksumPages[url] ?? 'e'.repeat(64)
+ } as Awaited>;
+ });
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('resolves the newest matching GA release', async () => {
+ const result = await createDistribution()['findPackageForDownload']('26');
+
+ expect(result).toEqual({
+ version: '26.0.2+10',
+ url: 'https://download.java.net/java/GA/jdk26.0.2/hash/10/GPL/openjdk-26.0.2_linux-x64_bin.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value: GA_CHECKSUM,
+ source:
+ 'https://download.java.net/java/GA/jdk26.0.2/hash/10/GPL/openjdk-26.0.2_linux-x64_bin.tar.gz.sha256'
+ }
+ });
+ expect(getSpy).toHaveBeenCalledWith(`${result.url}.sha256`);
+ });
+
+ it('resolves an archived GA release', async () => {
+ const result =
+ await createDistribution('26.0.1')['findPackageForDownload']('26.0.1');
+
+ expect(result.version).toBe('26.0.1+8');
+ expect(result.url).toContain('/openjdk-26.0.1_linux-x64_bin.tar.gz');
+ });
+
+ it('resolves an exact GA build', async () => {
+ const result =
+ await createDistribution('26.0.2+10')['findPackageForDownload'](
+ '26.0.2+10'
+ );
+
+ expect(result.version).toBe('26.0.2+10');
+ });
+
+ it('resolves an exact build from a legacy archive heading', async () => {
+ const result =
+ await createDistribution('9.0.4+11')['findPackageForDownload'](
+ '9.0.4+11'
+ );
+
+ expect(result.version).toBe('9.0.4+11');
+ expect(result.url).toContain('/binaries/openjdk-9.0.4_linux-x64_bin');
+ });
+
+ it('resolves a four-field Java version', async () => {
+ const result =
+ await createDistribution('18.0.1.1')['findPackageForDownload'](
+ '18.0.1+1'
+ );
+
+ expect(result.version).toBe('18.0.1+1');
+ expect(result.url).toContain('/openjdk-18.0.1.1_linux-x64_bin.tar.gz');
+ });
+
+ it('resolves an early-access release without requesting the archive', async () => {
+ const result =
+ await createDistribution('27-ea')['findPackageForDownload']('27');
+
+ expect(result).toEqual({
+ version: '27.0.0+32',
+ url: 'https://download.java.net/java/early_access/jdk27/32/GPL/openjdk-27-ea+32_linux-x64_bin.tar.gz',
+ checksum: {
+ algorithm: 'sha256',
+ value: EA_CHECKSUM,
+ source:
+ 'https://download.java.net/java/early_access/jdk27/32/GPL/openjdk-27-ea+32_linux-x64_bin.tar.gz.sha256'
+ }
+ });
+ expect(getSpy).not.toHaveBeenCalledWith('https://jdk.java.net/archive/');
+ expect(getSpy).toHaveBeenCalledWith(`${result.url}.sha256`);
+ });
+
+ it('reports available versions when no release matches', async () => {
+ await expect(
+ createDistribution()['findPackageForDownload']('24')
+ ).rejects.toThrow(
+ "No matching version found for SemVer '24'.\nDistribution: Oracle OpenJDK"
+ );
+ });
+
+ it.each([
+ ['jre', 'Oracle OpenJDK provides only the `jdk` package type'],
+ ['jdk+fx', 'Oracle OpenJDK provides only the `jdk` package type']
+ ])('rejects the %s package type', async (packageType, message) => {
+ await expect(
+ createDistribution('26', 'x64', packageType)['findPackageForDownload'](
+ '26'
+ )
+ ).rejects.toThrow(message);
+ });
+
+ it('rejects unsupported architectures', async () => {
+ await expect(
+ createDistribution('26', 'x86')['findPackageForDownload']('26')
+ ).rejects.toThrow('Unsupported architecture: x86');
+ });
+
+ it('maps supported platforms', () => {
+ const distribution = createDistribution('26', 'x64', 'jdk', false);
+
+ expect(distribution['getPlatform']('linux')).toBe('linux');
+ expect(distribution['getPlatform']('darwin')).toBe('macos');
+ expect(distribution['getPlatform']('win32')).toBe('windows');
+ expect(() => distribution['getPlatform']('freebsd')).toThrow(
+ "Platform 'freebsd' is not supported"
+ );
+ });
+
+ it('parses legacy platform names and archive formats', () => {
+ const distribution = createDistribution();
+ const macRelease = distribution['parseReleases'](
+ 'tar.gz',
+ 'macos',
+ 'x64'
+ );
+ const windowsRelease = distribution['parseReleases'](
+ 'tar.gz',
+ 'windows',
+ 'x64'
+ );
+
+ expect(macRelease[0].version).toBe('16.0.0+7');
+ expect(windowsRelease[0].version).toBe('10.0.2+13');
+ expect(windowsRelease[0].url.endsWith('.tar.gz')).toBe(true);
+ });
+
+ it('is registered in the distribution factory', async () => {
+ const distribution = await getJavaDistribution('oracle-openjdk', {
+ version: '26',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(distribution).toBeInstanceOf(OpenJdkDistribution);
+ });
+});
diff --git a/__tests__/distributors/oracle-installer.test.ts b/__tests__/distributors/oracle-installer.test.ts
index de391a542..36d4e9793 100644
--- a/__tests__/distributors/oracle-installer.test.ts
+++ b/__tests__/distributors/oracle-installer.test.ts
@@ -1,13 +1,56 @@
-import {OracleDistribution} from '../../src/distributions/oracle/installer';
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
import os from 'os';
-import * as core from '@actions/core';
-import {getDownloadArchiveExtension} from '../../src/util';
import {HttpClient} from '@actions/http-client';
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {OracleDistribution} =
+ await import('../../src/distributions/oracle/installer.js');
+const {getDownloadArchiveExtension} = await import('../../src/util.js');
+
describe('findPackageForDownload', () => {
- let distribution: OracleDistribution;
- let spyDebug: jest.SpyInstance;
- let spyHttpClient: jest.SpyInstance;
+ let distribution: InstanceType;
+ let spyDebug: any;
+ let spyHttpClient: any;
+ let spyHttpClientGet: any;
+ let spyCoreError: any;
+
+ const ORACLE_CHECKSUM = 'f'.repeat(64);
beforeEach(() => {
distribution = new OracleDistribution({
@@ -17,8 +60,20 @@ describe('findPackageForDownload', () => {
checkLatest: false
});
- spyDebug = jest.spyOn(core, 'debug');
+ spyDebug = core.debug as jest.Mock;
spyDebug.mockImplementation(() => {});
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+
+ // Every resolved release fetches its `${url}.sha256` sibling checksum;
+ // stub it so tests never reach the real network.
+ spyHttpClientGet = jest.spyOn(HttpClient.prototype, 'get');
+ spyHttpClientGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => ORACLE_CHECKSUM
+ });
});
it.each([
@@ -87,6 +142,71 @@ describe('findPackageForDownload', () => {
.replace('{{OS_TYPE}}', osType)
.replace('{{ARCHIVE_TYPE}}', archiveType);
expect(result.url).toBe(url);
+ // Only the `/latest/` path serves changing contents, so only it must be
+ // excluded from the resolution cache.
+ expect(result.floating).toBe(url.includes('/latest/'));
+ });
+
+ it.each([
+ ['21', 'etag:"oracle-latest"'],
+ ['21.0.1', undefined]
+ ])(
+ 'fingerprints only the floating artifact for version %s',
+ async (input, expected) => {
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClient.mockResolvedValue({
+ message: {statusCode: 200, headers: {etag: '"oracle-latest"'}}
+ });
+
+ const result = await distribution['findPackageForDownload'](input);
+
+ jest.restoreAllMocks();
+
+ // Without a fingerprint the constant `/latest/` URL would key a cache
+ // entry that never invalidates when Oracle republishes the artifact.
+ expect(result.fingerprint).toBe(expected);
+ }
+ );
+
+ it('fetches the authoritative sha256 checksum for the resolved archive', async () => {
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClient.mockResolvedValue({message: {statusCode: 200}});
+
+ const result = await distribution['findPackageForDownload']('21');
+
+ jest.restoreAllMocks();
+
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: ORACLE_CHECKSUM,
+ source: `${result.url}.sha256`
+ });
+ expect(spyHttpClientGet).toHaveBeenCalledWith(`${result.url}.sha256`);
+ expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
+ });
+
+ it('warns when a major-only request falls back to the archived GA release', async () => {
+ spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClient
+ .mockResolvedValueOnce({message: {statusCode: 404}})
+ .mockResolvedValueOnce({message: {statusCode: 200}});
+
+ await distribution['findPackageForDownload']('21');
+
+ expect(core.warning).toHaveBeenCalledWith(
+ 'Oracle JDK 21 is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.'
+ );
+ });
+
+ it('always resolves major-only requests remotely', () => {
+ expect(distribution['requiresRemoteResolution']()).toBe(true);
+ const exactDistribution = new OracleDistribution({
+ version: '21.0.8',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ expect(exactDistribution['requiresRemoteResolution']()).toBe(false);
});
it.each([
@@ -95,7 +215,9 @@ describe('findPackageForDownload', () => {
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
jest.spyOn(os, 'platform').mockReturnValue('linux');
const version = '18';
@@ -128,3 +250,63 @@ describe('findPackageForDownload', () => {
);
});
});
+describe('findPackageForDownload with latest', () => {
+ let spyHttpClientHead: any;
+ let spyHttpClientGetJson: any;
+
+ beforeEach(() => {
+ (core.debug as jest.Mock).mockImplementation(() => {});
+ (core.error as jest.Mock).mockImplementation(() => {});
+ spyHttpClientGetJson = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyHttpClientGetJson.mockResolvedValue({
+ statusCode: 200,
+ result: {most_recent_feature_release: 25},
+ headers: {}
+ });
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('resolves the newest major version from the Adoptium API', async () => {
+ spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClientHead.mockResolvedValue({message: {statusCode: 200}});
+ jest.spyOn(HttpClient.prototype, 'get').mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => 'f'.repeat(64)
+ } as any);
+
+ const distribution = new OracleDistribution({
+ version: 'latest',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ const result = await distribution['findPackageForDownload']('x');
+ const osType = distribution.getPlatform();
+ const archiveType = getDownloadArchiveExtension();
+
+ expect(result.version).toBe('25');
+ expect(result.url).toBe(
+ `https://download.oracle.com/java/25/latest/jdk-25_${osType}-x64_bin.${archiveType}`
+ );
+ });
+
+ it('throws an actionable error when the latest major is not yet available', async () => {
+ spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head');
+ spyHttpClientHead.mockResolvedValue({message: {statusCode: 404}});
+
+ const distribution = new OracleDistribution({
+ version: 'latest',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await expect(distribution['findPackageForDownload']('x')).rejects.toThrow(
+ /is not yet available for the Oracle JDK distribution/
+ );
+ });
+});
diff --git a/__tests__/distributors/redhat-installer-download.test.ts b/__tests__/distributors/redhat-installer-download.test.ts
new file mode 100644
index 000000000..53dc202a1
--- /dev/null
+++ b/__tests__/distributors/redhat-installer-download.test.ts
@@ -0,0 +1,109 @@
+import {beforeEach, describe, expect, it, jest} from '@jest/globals';
+import path from 'path';
+
+const mockReaddirSync = jest.fn();
+const realFs = await import('fs');
+jest.unstable_mockModule('fs', () => ({
+ ...realFs,
+ default: {...realFs.default, readdirSync: mockReaddirSync},
+ readdirSync: mockReaddirSync
+}));
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ debug: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn()
+}));
+
+const realUtil = await import('../../src/util.js');
+const mockCacheJdkDir = jest.fn();
+const mockExtractJdkFile = jest.fn();
+const mockRenameWinArchive = jest.fn();
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...realUtil,
+ cacheJdkDir: mockCacheJdkDir,
+ extractJdkFile: mockExtractJdkFile,
+ renameWinArchive: mockRenameWinArchive
+}));
+
+const {RedHatDistribution} =
+ await import('../../src/distributions/redhat/installer.js');
+
+const release = {
+ version: '21.0.8+9',
+ url: 'https://developers.redhat.com/openjdk-21.tar.xz',
+ checksum: {
+ algorithm: 'sha256' as const,
+ value: 'a'.repeat(64)
+ }
+};
+
+const createDistribution = () =>
+ new RedHatDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+beforeEach(() => {
+ jest.clearAllMocks();
+ mockReaddirSync.mockReturnValue(['jdk-21']);
+ mockExtractJdkFile.mockResolvedValue('/tmp/extracted');
+ mockCacheJdkDir.mockResolvedValue('/toolcache/Java_RedHat_jdk/21.0.8-9/x64');
+ mockRenameWinArchive.mockReturnValue('/tmp/download.zip');
+});
+
+describe('Red Hat package installation', () => {
+ it('extracts and caches Linux tar.xz archives', async () => {
+ const distribution = createDistribution();
+ distribution['downloadAndVerify'] = jest
+ .fn()
+ .mockResolvedValue('/tmp/download');
+ distribution['getArchiveType'] = () => 'tar.xz';
+
+ const result = await distribution['downloadTool'](release);
+
+ expect(mockExtractJdkFile).toHaveBeenCalledWith('/tmp/download', 'tar.xz');
+ expect(mockRenameWinArchive).not.toHaveBeenCalled();
+ expect(mockCacheJdkDir).toHaveBeenCalledWith(
+ path.join('/tmp/extracted', 'jdk-21'),
+ 'Java_RedHat_jdk',
+ '21.0.8-9',
+ 'x64'
+ );
+ expect(result).toEqual({
+ version: '21.0.8+9',
+ path: '/toolcache/Java_RedHat_jdk/21.0.8-9/x64'
+ });
+ });
+
+ it('renames downloaded Windows ZIP archives before extraction', async () => {
+ const distribution = createDistribution();
+ distribution['downloadAndVerify'] = jest
+ .fn()
+ .mockResolvedValue('/tmp/download');
+ distribution['getArchiveType'] = () => 'zip';
+
+ await distribution['downloadTool'](release);
+
+ expect(mockRenameWinArchive).toHaveBeenCalledWith('/tmp/download');
+ expect(mockExtractJdkFile).toHaveBeenCalledWith('/tmp/download.zip', 'zip');
+ });
+
+ it('fails when the extracted archive is empty', async () => {
+ mockReaddirSync.mockReturnValue([]);
+ const distribution = createDistribution();
+ distribution['downloadAndVerify'] = jest
+ .fn()
+ .mockResolvedValue('/tmp/download');
+ distribution['getArchiveType'] = () => 'tar.xz';
+
+ await expect(distribution['downloadTool'](release)).rejects.toThrow(
+ 'The Red Hat archive for Java 21.0.8+9 was empty.'
+ );
+ expect(mockCacheJdkDir).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/distributors/redhat-installer.test.ts b/__tests__/distributors/redhat-installer.test.ts
new file mode 100644
index 000000000..0890f513a
--- /dev/null
+++ b/__tests__/distributors/redhat-installer.test.ts
@@ -0,0 +1,181 @@
+import {afterEach, describe, expect, it, jest} from '@jest/globals';
+import {HttpClient} from '@actions/http-client';
+import packageDetails from '../data/redhat-package-details.json' with {type: 'json'};
+import packages from '../data/redhat-packages.json' with {type: 'json'};
+import {RedHatDistribution} from '../../src/distributions/redhat/installer.js';
+
+const createDistribution = (
+ version: string,
+ packageType = 'jdk'
+): RedHatDistribution => {
+ const distribution = new RedHatDistribution({
+ version,
+ architecture: 'x64',
+ packageType,
+ checkLatest: false
+ });
+ distribution['getOperatingSystem'] = () => 'linux';
+ distribution['getArchiveType'] = () => 'tar.xz';
+ return distribution;
+};
+
+const mockDisco = (
+ packageResponse: unknown = packages,
+ detailsResponse: unknown = packageDetails
+) =>
+ jest.spyOn(HttpClient.prototype, 'getJson').mockImplementation(async url => ({
+ result: url.includes('/packages?') ? packageResponse : detailsResponse,
+ statusCode: 200,
+ headers: {}
+ }));
+
+afterEach(() => {
+ jest.restoreAllMocks();
+});
+
+describe('Red Hat package resolution', () => {
+ it('resolves the newest matching release and authoritative checksum', async () => {
+ const getJson = mockDisco();
+ const distribution = createDistribution('21');
+
+ const release = await distribution['findPackageForDownload']('21');
+
+ expect(release).toEqual({
+ version: '21.0.8+9',
+ url: packageDetails.result[0].direct_download_uri,
+ checksum: {
+ algorithm: 'sha256',
+ value: packageDetails.result[0].checksum,
+ source:
+ 'https://api.foojay.io/disco/v3.0/ids/redhat-21.0.8-jdk-linux-x64'
+ }
+ });
+ expect(getJson).toHaveBeenNthCalledWith(
+ 1,
+ expect.stringContaining(
+ 'distro=redhat&release_status=ga&operating_system=linux&architecture=x64&package_type=jdk&archive_type=tar.xz&directly_downloadable=true'
+ )
+ );
+ expect(getJson).toHaveBeenNthCalledWith(
+ 2,
+ 'https://api.foojay.io/disco/v3.0/ids/redhat-21.0.8-jdk-linux-x64'
+ );
+ });
+
+ it('normalizes feature-only Disco versions before matching', async () => {
+ mockDisco(undefined, {
+ result: [
+ {
+ ...packageDetails.result[0],
+ direct_download_uri: 'https://developers.redhat.com/openjdk-9.tar.xz'
+ }
+ ],
+ message: ''
+ });
+ const distribution = createDistribution('9');
+
+ const release = await distribution['findPackageForDownload']('9');
+
+ expect(release.version).toBe('9.0.0+181');
+ });
+
+ it('selects the requested package type', async () => {
+ const getJson = mockDisco();
+ const distribution = createDistribution('21', 'jre');
+
+ await distribution['findPackageForDownload']('21');
+
+ expect(getJson).toHaveBeenNthCalledWith(
+ 1,
+ expect.stringContaining('package_type=jre')
+ );
+ expect(getJson).toHaveBeenNthCalledWith(
+ 2,
+ 'https://api.foojay.io/disco/v3.0/ids/redhat-21.0.8-jre-linux-x64'
+ );
+ });
+
+ it('maps Windows to ZIP packages', async () => {
+ const getJson = mockDisco();
+ const distribution = createDistribution('17');
+ distribution['getOperatingSystem'] = () => 'windows';
+ distribution['getArchiveType'] = () => 'zip';
+
+ await distribution['findPackageForDownload']('17');
+
+ expect(getJson).toHaveBeenNthCalledWith(
+ 1,
+ expect.stringContaining(
+ 'operating_system=windows&architecture=x64&package_type=jdk&archive_type=zip'
+ )
+ );
+ expect(getJson).toHaveBeenNthCalledWith(
+ 2,
+ 'https://api.foojay.io/disco/v3.0/ids/redhat-17.0.16-jdk-windows-x64'
+ );
+ });
+
+ it('rejects Alpine before requesting glibc package metadata', async () => {
+ const getJson = mockDisco();
+ const distribution = new RedHatDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ expect(() => distribution['getOperatingSystem'](true)).toThrow(
+ "Distribution 'redhat' does not support Alpine Linux because Red Hat portable archives require glibc."
+ );
+ expect(getJson).not.toHaveBeenCalled();
+ });
+
+ it('rejects early-access versions before requesting metadata', async () => {
+ const getJson = mockDisco();
+ const distribution = createDistribution('21-ea');
+
+ await expect(distribution['findPackageForDownload']('21')).rejects.toThrow(
+ 'Early access versions are not supported'
+ );
+ expect(getJson).not.toHaveBeenCalled();
+ });
+
+ it('reports available versions when no release matches', async () => {
+ mockDisco();
+ const distribution = createDistribution('25');
+
+ await expect(distribution['findPackageForDownload']('25')).rejects.toThrow(
+ "No matching version found for SemVer '25'.\nDistribution: RedHat"
+ );
+ });
+
+ it('fails when the package detail has no direct Red Hat URL', async () => {
+ mockDisco(packages, {result: [], message: ''});
+ const distribution = createDistribution('21');
+
+ await expect(distribution['findPackageForDownload']('21')).rejects.toThrow(
+ 'returned no direct Red Hat download URL'
+ );
+ });
+
+ it('fails when the package detail has no SHA-256 checksum', async () => {
+ mockDisco(packages, {
+ result: [{...packageDetails.result[0], checksum: ''}],
+ message: ''
+ });
+ const distribution = createDistribution('21');
+
+ await expect(distribution['findPackageForDownload']('21')).rejects.toThrow(
+ 'returned no SHA-256 checksum'
+ );
+ });
+
+ it('fails with a targeted error when package metadata is missing', async () => {
+ mockDisco(null);
+ const distribution = createDistribution('21');
+
+ await expect(distribution['findPackageForDownload']('21')).rejects.toThrow(
+ 'Could not fetch Red Hat package metadata from Foojay Disco'
+ );
+ });
+});
diff --git a/__tests__/distributors/sapmachine-installer.test.ts b/__tests__/distributors/sapmachine-installer.test.ts
index 4eec570a8..6eee0b945 100644
--- a/__tests__/distributors/sapmachine-installer.test.ts
+++ b/__tests__/distributors/sapmachine-installer.test.ts
@@ -1,12 +1,62 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
import {HttpClient} from '@actions/http-client';
-import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
-import * as utils from '../../src/util';
-import manifestData from '../data/sapmachine.json';
+import manifestData from '../data/sapmachine.json' with {type: 'json'};
+import releaseClassManifestData from '../data/sapmachine-release-classes.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {SapMachineDistribution} =
+ await import('../../src/distributions/sapmachine/installer.js');
+const utils = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyHttpGet: any;
+ let spyUtilGetDownloadArchiveExtension: any;
+ let spyCoreError: any;
+ const archiveChecksum = 'f'.repeat(64);
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -15,12 +65,19 @@ describe('getAvailableVersions', () => {
headers: {},
result: manifestData
});
+ spyHttpGet = jest.spyOn(HttpClient.prototype, 'get');
+ spyHttpGet.mockResolvedValue({
+ message: {statusCode: 200},
+ readBody: async () => `${archiveChecksum} archive`
+ });
- spyUtilGetDownloadArchiveExtension = jest.spyOn(
- utils,
- 'getDownloadArchiveExtension'
- );
+ spyUtilGetDownloadArchiveExtension =
+ utils.getDownloadArchiveExtension as jest.Mock;
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -30,7 +87,7 @@ describe('getAvailableVersions', () => {
});
const mockPlatform = (
- distribution: SapMachineDistribution,
+ distribution: InstanceType,
platform: string
) => {
distribution['getPlatformOption'] = () => platform;
@@ -61,9 +118,8 @@ describe('getAvailableVersions', () => {
mockPlatform(distribution, 'linux');
- const availableVersion = await distribution['findPackageForDownload'](
- version
- );
+ const availableVersion =
+ await distribution['findPackageForDownload'](version);
expect(availableVersion).not.toBeNull();
expect(availableVersion.url).toBe(
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
@@ -77,9 +133,9 @@ describe('getAvailableVersions', () => {
['11', 'aarch64', 'linux', 54],
['17', 'riscv', 'linux', 0],
['16.0.1', 'x64', 'linux', 71],
- ['23-ea', 'x64', 'linux', 798],
+ ['23-ea', 'x64', 'linux', 727],
['23-ea', 'aarch64', 'windows', 0],
- ['23-ea', 'x64', 'windows', 750]
+ ['23-ea', 'x64', 'windows', 679]
])(
'should get right number of available versions from JSON',
async (
@@ -101,6 +157,45 @@ describe('getAvailableVersions', () => {
expect(availableVersions.length).toBe(len);
}
);
+
+ it.each([
+ [
+ '25',
+ [
+ 'https://example.test/sapmachine-25.0.2-ga.tar.gz',
+ 'https://example.test/sapmachine-25.0.1-ga.tar.gz'
+ ]
+ ],
+ [
+ '25-ea',
+ [
+ 'https://example.test/sapmachine-25-ea.11.tar.gz',
+ 'https://example.test/sapmachine-25-ea.10.tar.gz'
+ ]
+ ]
+ ])(
+ 'should classify boolean and string EA metadata for %s requests',
+ async (version: string, expectedLinks: string[]) => {
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {},
+ result: releaseClassManifestData
+ });
+ const distribution = new SapMachineDistribution({
+ version,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ const availableVersions = await distribution['getAvailableVersions']();
+
+ expect(availableVersions.map(item => item.downloadLink)).toStrictEqual(
+ expectedLinks
+ );
+ }
+ );
});
describe('findPackageForDownload', () => {
@@ -230,14 +325,56 @@ describe('getAvailableVersions', () => {
});
mockPlatform(distribution, platform);
- const availableVersion = await distribution['findPackageForDownload'](
- normalizedVersion
- );
+ const availableVersion =
+ await distribution['findPackageForDownload'](normalizedVersion);
expect(availableVersion).not.toBeNull();
expect(availableVersion.url).toBe(expectedLink);
+ expect(availableVersion.checksum).toEqual({
+ algorithm: 'sha256',
+ value: archiveChecksum,
+ source: expectedLink.replace(/\.(?:tar\.gz|zip)$/, '.sha256.txt')
+ });
}
);
+ it('uses the checksum published beside the selected EA archive', async () => {
+ const distribution = new SapMachineDistribution({
+ version: '21-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ const release = await distribution['findPackageForDownload']('21');
+
+ expect(spyHttpGet).toHaveBeenCalledWith(
+ release.url.replace(/\.(?:tar\.gz|zip)$/, '.sha256.txt')
+ );
+ expect(release.checksum?.value).toBe(archiveChecksum);
+ });
+
+ it('does not select a newer stable release for an EA request', async () => {
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {},
+ result: releaseClassManifestData
+ });
+ const distribution = new SapMachineDistribution({
+ version: '25-ea',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ mockPlatform(distribution, 'linux');
+
+ const release = await distribution['findPackageForDownload']('25');
+
+ expect(release.url).toBe(
+ 'https://example.test/sapmachine-25-ea.11.tar.gz'
+ );
+ });
+
it.each([
['8', 'linux', 'x64'],
['8', 'macos', 'aarch64'],
@@ -250,7 +387,7 @@ describe('getAvailableVersions', () => {
['21.0.3+8-ea', 'linux', 'x64', '21.0.3+8'],
['17', 'linux-muse', 'aarch64']
])(
- 'should throw when required version of JDK can not be found in the JSON',
+ 'should throw when required version of JDK cannot be found in the JSON',
async (
version: string,
platform: string,
@@ -268,7 +405,7 @@ describe('getAvailableVersions', () => {
await expect(
distribution['findPackageForDownload'](normalizedVersion)
).rejects.toThrow(
- `Couldn't find any satisfied version for the specified java-version: "${normalizedVersion}" and architecture: "${arch}".`
+ `No matching version found for SemVer '${normalizedVersion}'`
);
}
);
diff --git a/__tests__/distributors/semeru-installer.test.ts b/__tests__/distributors/semeru-installer.test.ts
index 690478f79..b1785e853 100644
--- a/__tests__/distributors/semeru-installer.test.ts
+++ b/__tests__/distributors/semeru-installer.test.ts
@@ -1,12 +1,53 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
import {HttpClient} from '@actions/http-client';
-import {JavaInstallerOptions} from '../../src/distributions/base-models';
-import {SemeruDistribution} from '../../src/distributions/semeru/installer';
+import manifestData from '../data/semeru.json' with {type: 'json'};
-import manifestData from '../data/semeru.json';
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {SemeruDistribution} =
+ await import('../../src/distributions/semeru/installer.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
+ let spyCoreWarning: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -15,6 +56,11 @@ describe('getAvailableVersions', () => {
headers: {},
result: []
});
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+ spyCoreWarning = core.warning as jest.Mock;
+ spyCoreWarning.mockImplementation(() => {});
});
afterEach(() => {
@@ -77,22 +123,19 @@ describe('getAvailableVersions', () => {
);
it('load available versions', async () => {
+ const nextPageUrl =
+ 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D?page=1&page_size=20';
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient
.mockReturnValueOnce({
statusCode: 200,
- headers: {},
+ headers: {link: `<${nextPageUrl}>; rel="next"`},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
- })
- .mockReturnValueOnce({
- statusCode: 200,
- headers: {},
- result: []
});
const distribution = new SemeruDistribution({
@@ -104,6 +147,31 @@ describe('getAvailableVersions', () => {
const availableVersions = await distribution['getAvailableVersions']();
expect(availableVersions).not.toBeNull();
expect(availableVersions.length).toBe(manifestData.length * 2);
+ expect(spyHttpClient).toHaveBeenNthCalledWith(2, nextPageUrl);
+ });
+
+ it('stops pagination after 1000 pages as a safeguard', async () => {
+ const nextPageUrl =
+ 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D?page=2&page_size=20';
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {link: `<${nextPageUrl}>; rel="next"`},
+ result: [{version_data: {semver: '17.0.1'}, binaries: []}] as any
+ });
+
+ const distribution = new SemeruDistribution({
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledTimes(1000);
+ expect(spyCoreWarning).toHaveBeenCalledWith(
+ expect.stringContaining('Reached pagination safeguard limit (1000 pages)')
+ );
});
it.each([
@@ -140,6 +208,14 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any;
const resolvedVersion = await distribution['findPackageForDownload'](input);
expect(resolvedVersion.version).toBe(expected);
+ const vendorPackage = (manifestData as any[]).find(
+ item => item.version_data.semver === expected
+ ).binaries[0].package;
+ expect(resolvedVersion.checksum).toEqual({
+ algorithm: 'sha256',
+ value: vendorPackage.checksum,
+ source: vendorPackage.checksum_link
+ });
});
it('version is found but binaries list is empty', async () => {
@@ -152,7 +228,7 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(
distribution['findPackageForDownload']('9.0.8')
- ).rejects.toThrow(/Could not find satisfied version for SemVer */);
+ ).rejects.toThrow(/No matching version found for SemVer */);
});
it('version is not found', async () => {
@@ -164,7 +240,7 @@ describe('findPackageForDownload', () => {
});
distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
+ /No matching version found for SemVer */
);
});
@@ -177,7 +253,7 @@ describe('findPackageForDownload', () => {
});
distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
+ /No matching version found for SemVer */
);
});
@@ -196,7 +272,7 @@ describe('findPackageForDownload', () => {
}
);
- it.each(['zos', 'z/OS', 'z/os', 'test0987654321=', '++=++', 'myArch'])(
+ it.each(['zos', 'myArch'])(
'incorrect Semeru `%s` architecture throws',
async (arch: string) => {
const distribution = new SemeruDistribution({
diff --git a/__tests__/distributors/temurin-installer.test.ts b/__tests__/distributors/temurin-installer.test.ts
index b8c9e7fde..2d424b33c 100644
--- a/__tests__/distributors/temurin-installer.test.ts
+++ b/__tests__/distributors/temurin-installer.test.ts
@@ -1,15 +1,94 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
+import type {TemurinImplementation as TemurinImplementationType} from '../../src/distributions/temurin/installer.js';
import {HttpClient} from '@actions/http-client';
+import fs from 'fs';
import os from 'os';
-import {
- TemurinDistribution,
- TemurinImplementation
-} from '../../src/distributions/temurin/installer';
-import {JavaInstallerOptions} from '../../src/distributions/base-models';
+import path from 'path';
+
+import manifestData from '../data/temurin.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
-import manifestData from '../data/temurin.json';
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ find: jest.fn(),
+ findAllVersions: jest.fn(),
+ downloadTool: jest.fn(),
+ extractZip: jest.fn(),
+ extractTar: jest.fn(),
+ extract7z: jest.fn(),
+ extractXar: jest.fn(),
+ cacheDir: jest.fn(),
+ cacheFile: jest.fn(),
+ getManifestFromRepo: jest.fn(),
+ findFromManifest: jest.fn(),
+ evaluateVersions: jest.fn()
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ extractJdkFile: jest.fn(),
+ getDownloadArchiveExtension: jest.fn(),
+ getToolcachePath: jest.fn(),
+ isJobStatusSuccess: jest.fn(),
+ renameWinArchive: jest.fn(),
+ isVersionSatisfies: real_util_module.isVersionSatisfies,
+ getTempDir: real_util_module.getTempDir
+}));
+
+jest.unstable_mockModule('../../src/gpg.js', () => ({
+ importKey: jest.fn(),
+ removeGpgHome: jest.fn(),
+ isGpgAvailable: jest.fn(),
+ verifyPackageSignature: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const gpg = await import('../../src/gpg.js');
+const tc = await import('@actions/tool-cache');
+const {TemurinDistribution, TemurinImplementation, ADOPTIUM_PUBLIC_KEY} =
+ await import('../../src/distributions/temurin/installer.js');
+const util = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
+ let spyCoreWarning: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +97,11 @@ describe('getAvailableVersions', () => {
headers: {},
result: []
});
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
+ spyCoreWarning = core.warning as jest.Mock;
+ spyCoreWarning.mockImplementation(() => {});
});
afterEach(() => {
@@ -37,6 +121,16 @@ describe('getAvailableVersions', () => {
TemurinImplementation.Hotspot,
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
],
+ [
+ {
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk+jmods',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot,
+ 'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
+ ],
[
{
version: '16',
@@ -71,7 +165,7 @@ describe('getAvailableVersions', () => {
'build correct url for %s',
async (
installerOptions: JavaInstallerOptions,
- impl: TemurinImplementation,
+ impl: TemurinImplementationType,
expectedParameters
) => {
const distribution = new TemurinDistribution(installerOptions, impl);
@@ -87,23 +181,41 @@ describe('getAvailableVersions', () => {
}
);
+ it('requests the JMOD image type', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk+jmods',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+ distribution['getPlatformOption'] = () => 'linux';
+
+ await distribution['getAvailableVersions']('jmods');
+
+ expect(spyHttpClient).toHaveBeenCalledWith(
+ expect.stringContaining(
+ 'os=linux&architecture=x64&image_type=jmods&release_type=ga'
+ )
+ );
+ });
+
it('load available versions', async () => {
+ const nextPageUrl =
+ 'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D?page=1&page_size=20';
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient
.mockReturnValueOnce({
statusCode: 200,
- headers: {},
+ headers: {link: `<${nextPageUrl}>; rel="next"`},
result: manifestData as any
})
.mockReturnValueOnce({
statusCode: 200,
headers: {},
result: manifestData as any
- })
- .mockReturnValueOnce({
- statusCode: 200,
- headers: {},
- result: []
});
const distribution = new TemurinDistribution(
@@ -118,14 +230,51 @@ describe('getAvailableVersions', () => {
const availableVersions = await distribution['getAvailableVersions']();
expect(availableVersions).not.toBeNull();
expect(availableVersions.length).toBe(manifestData.length * 2);
+ expect(spyHttpClient).toHaveBeenNthCalledWith(2, nextPageUrl);
+ });
+
+ it('stops pagination after 1000 pages as a safeguard', async () => {
+ const nextPageUrl =
+ 'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D?page=2&page_size=20';
+ spyHttpClient.mockReturnValue({
+ statusCode: 200,
+ headers: {link: `<${nextPageUrl}>; rel="next"`},
+ result: [{version_data: {semver: '17.0.1'}, binaries: []}] as any
+ });
+
+ const distribution = new TemurinDistribution(
+ {
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await distribution['getAvailableVersions']();
+
+ expect(spyHttpClient).toHaveBeenCalledTimes(1000);
+ expect(spyCoreWarning).toHaveBeenCalledWith(
+ expect.stringContaining('Reached pagination safeguard limit (1000 pages)')
+ );
});
it.each([
[TemurinImplementation.Hotspot, 'jdk', 'Java_Temurin-Hotspot_jdk'],
- [TemurinImplementation.Hotspot, 'jre', 'Java_Temurin-Hotspot_jre']
+ [TemurinImplementation.Hotspot, 'jre', 'Java_Temurin-Hotspot_jre'],
+ [
+ TemurinImplementation.Hotspot,
+ 'jdk+jmods',
+ 'Java_Temurin-Hotspot_jdk+jmods'
+ ]
])(
'find right toolchain folder',
- (impl: TemurinImplementation, packageType: string, expected: string) => {
+ (
+ impl: TemurinImplementationType,
+ packageType: string,
+ expected: string
+ ) => {
const distribution = new TemurinDistribution(
{
version: '8',
@@ -143,11 +292,15 @@ describe('getAvailableVersions', () => {
it.each([
['amd64', 'x64'],
- ['arm64', 'aarch64']
+ ['arm', 'arm'],
+ ['arm64', 'aarch64'],
+ ['riscv64', 'riscv64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
async (osArch: string, distroArch: string) => {
- jest.spyOn(os, 'arch').mockReturnValue(distroArch);
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const installerOptions: JavaInstallerOptions = {
version: '17',
@@ -196,6 +349,124 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any;
const resolvedVersion = await distribution['findPackageForDownload'](input);
expect(resolvedVersion.version).toBe(expected);
+ expect(resolvedVersion.signatureUrl).toBeDefined();
+ const vendorPackage = (manifestData as any[]).find(
+ item => item.version_data.semver === expected
+ ).binaries[0].package;
+ expect(resolvedVersion.checksum).toEqual({
+ algorithm: 'sha256',
+ value: vendorPackage.checksum,
+ source: vendorPackage.checksum_link
+ });
+ });
+
+ it('version "latest" is normalized to the newest available version', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: 'latest',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+ distribution['getAvailableVersions'] = async () => manifestData as any;
+ // normalizeVersion turns `latest` into the wildcard carried on `this.version`
+ const resolvedVersion = await distribution['findPackageForDownload'](
+ distribution['version']
+ );
+ expect(resolvedVersion.version).toBe('16.0.2+7');
+ });
+
+ describe('OpenJDK patch (respin) versions', () => {
+ const makeRelease = (
+ semverVersion: string,
+ openjdkVersion: string,
+ versionData: Record
+ ) => ({
+ binaries: [
+ {
+ package: {
+ link: `https://example.com/${openjdkVersion}.tar.gz`,
+ checksum: `checksum-${openjdkVersion}`,
+ checksum_link: `https://example.com/${openjdkVersion}.sha256.txt`
+ }
+ }
+ ],
+ version_data: {
+ semver: semverVersion,
+ openjdk_version: openjdkVersion,
+ minor: 0,
+ ...versionData
+ }
+ });
+
+ const respinManifest = [
+ makeRelease('26.0.2+101', '26.0.2.1+1', {
+ major: 26,
+ security: 2,
+ patch: 1,
+ build: 1
+ }),
+ makeRelease('26.0.2+10', '26.0.2+10', {
+ major: 26,
+ security: 2,
+ build: 10
+ }),
+ makeRelease('25.0.4+101.0.LTS', '25.0.4.1+1-LTS', {
+ major: 25,
+ security: 4,
+ patch: 1,
+ build: 1
+ }),
+ makeRelease('25.0.4+7.0.LTS', '25.0.4+7-LTS', {
+ major: 25,
+ security: 4,
+ build: 7
+ })
+ ];
+
+ it.each([
+ ['26.0.2.1+1', '26.0.2+101'],
+ ['26.0.2+10', '26.0.2+10'],
+ ['26', '26.0.2+101'],
+ ['26.0.2', '26.0.2+101'],
+ ['25.0.4.1+1', '25.0.4+101.0.LTS'],
+ ['25.0.4+7', '25.0.4+7.0.LTS'],
+ ['25.0.4', '25.0.4+101.0.LTS']
+ ])('%s resolves to %s', async (input, expected) => {
+ const distribution = new TemurinDistribution(
+ {
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+ distribution['getAvailableVersions'] = async () => respinManifest as any;
+ const resolvedVersion = await distribution['findPackageForDownload'](
+ distribution['version']
+ );
+ expect(resolvedVersion.version).toBe(expected);
+ expect(resolvedVersion).not.toHaveProperty('openjdkVersion');
+ });
+
+ it('does not match a non-existent respin', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: '26.0.2.2+1',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+ distribution['getAvailableVersions'] = async () => respinManifest as any;
+ await expect(
+ distribution['findPackageForDownload'](distribution['version'])
+ ).rejects.toThrow(/No matching version found for SemVer '26.0.2\+2.1'/);
+ });
});
it('version is found but binaries list is empty', async () => {
@@ -211,7 +482,7 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(
distribution['findPackageForDownload']('9.0.8')
- ).rejects.toThrow(/Could not find satisfied version for SemVer */);
+ ).rejects.toThrow(/No matching version found for SemVer */);
});
it('version is not found', async () => {
@@ -226,7 +497,7 @@ describe('findPackageForDownload', () => {
);
distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
+ /No matching version found for SemVer */
);
});
@@ -242,7 +513,319 @@ describe('findPackageForDownload', () => {
);
distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
- /Could not find satisfied version for SemVer */
+ /No matching version found for SemVer */
+ );
+ });
+});
+
+describe('downloadTool', () => {
+ let spyDownloadTool: any;
+ let spyVerifySignature: any;
+ let spyExtractJdkFile: any;
+ let spyCacheDir: any;
+ let spyReadDirSync: any;
+ let spyRenameWinArchive: any;
+ let spyCopySync: any;
+
+ beforeEach(() => {
+ spyDownloadTool = tc.downloadTool as jest.Mock;
+ spyDownloadTool.mockResolvedValue('/tmp/jdk.tar.gz');
+ (gpg.isGpgAvailable as jest.Mock).mockResolvedValue(true);
+ spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
+ spyVerifySignature.mockResolvedValue(undefined);
+ spyExtractJdkFile = util.extractJdkFile as jest.Mock;
+ spyExtractJdkFile.mockResolvedValue('/tmp/extracted');
+ spyCacheDir = tc.cacheDir as jest.Mock;
+ spyCacheDir.mockResolvedValue('/tmp/toolcache');
+ spyReadDirSync = jest.spyOn(fs, 'readdirSync');
+ spyReadDirSync.mockReturnValue(['jdk-17'] as any);
+ spyRenameWinArchive = util.renameWinArchive as jest.Mock;
+ spyRenameWinArchive.mockReturnValue('/tmp/jdk.tar.gz.zip');
+ spyCopySync = jest.spyOn(fs, 'cpSync');
+ spyCopySync.mockImplementation(() => undefined);
+ });
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ jest.clearAllMocks();
+ jest.restoreAllMocks();
+ });
+
+ it('verifies signatures by default', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: 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).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ ADOPTIUM_PUBLIC_KEY
+ );
+ });
+
+ 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('skips implicit signature verification when gpg is unavailable', async () => {
+ (gpg.isGpgAvailable as jest.Mock).mockResolvedValue(false);
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ })
+ ).resolves.toEqual({version: '17.0.14+7', path: '/tmp/toolcache'});
+
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ expect(core.warning).toHaveBeenCalledWith(
+ "Input 'verify-signature' is enabled, but gpg is not available."
+ );
+ });
+
+ it('fails when signature verification is explicitly enabled without gpg', async () => {
+ (gpg.isGpgAvailable as jest.Mock).mockResolvedValue(false);
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ })
+ ).rejects.toThrow(
+ "Input 'verify-signature' is enabled, but gpg is not available."
+ );
+
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ });
+
+ it('warns when implicit signature verification fails', async () => {
+ spyVerifySignature.mockRejectedValue(new Error('bad signature'));
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ })
+ ).resolves.toEqual({version: '17.0.14+7', path: '/tmp/toolcache'});
+
+ expect(core.warning).toHaveBeenCalledWith(
+ expect.stringContaining(
+ 'https://github.com/actions/setup-java#download-integrity-and-signatures'
+ )
+ );
+ });
+
+ it('fails when explicitly requested signature verification fails', async () => {
+ spyVerifySignature.mockRejectedValue(new Error('bad signature'));
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz',
+ signatureUrl: 'https://example.com/jdk.tar.gz.sig'
+ })
+ ).rejects.toThrow(
+ /Failed to verify signature for Temurin version 17\.0\.14\+7.*bad signature.*https:\/\/github\.com\/actions\/setup-java#download-integrity-and-signatures/
+ );
+ });
+
+ it('warns when a signature is missing and verification is implicit', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz'
+ })
+ ).resolves.toEqual({version: '17.0.14+7', path: '/tmp/toolcache'});
+
+ expect(core.warning).toHaveBeenCalledWith(
+ "Input 'verify-signature' is enabled, but no signature URL was found for Temurin version 17.0.14+7."
+ );
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ });
+
+ it('downloads and adds matching JMODs to the JDK', async () => {
+ spyDownloadTool
+ .mockResolvedValueOnce('/tmp/jdk.tar.gz')
+ .mockResolvedValueOnce('/tmp/jmods.tar.gz');
+ spyExtractJdkFile
+ .mockResolvedValueOnce('/tmp/extracted')
+ .mockResolvedValueOnce('/tmp/extracted-jmods');
+ spyReadDirSync
+ .mockReturnValueOnce(['jdk-25'] as any)
+ .mockReturnValueOnce(['jdk-25-jmods'] as any);
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ const distribution = new TemurinDistribution(
+ {
+ version: '25',
+ architecture: 'x64',
+ packageType: 'jdk+jmods',
+ checkLatest: false,
+ verifySignature: false
+ },
+ TemurinImplementation.Hotspot
+ );
+ distribution['resolvePackage'] = jest.fn().mockResolvedValue({
+ version: '25.0.3+9',
+ url: 'https://example.com/jmods.tar.gz'
+ });
+
+ await distribution['downloadTool']({
+ version: '25.0.3+9',
+ url: 'https://example.com/jdk.tar.gz'
+ });
+
+ expect(distribution['resolvePackage']).toHaveBeenCalledWith(
+ '25.0.3+9',
+ 'jmods'
+ );
+ expect(spyDownloadTool).toHaveBeenNthCalledWith(
+ 2,
+ 'https://example.com/jmods.tar.gz'
+ );
+ expect(spyCopySync).toHaveBeenCalledWith(
+ path.join('/tmp/extracted-jmods', 'jdk-25-jmods'),
+ process.platform === 'darwin'
+ ? path.join('/tmp/extracted', 'jdk-25', 'Contents', 'Home', 'jmods')
+ : path.join('/tmp/extracted', 'jdk-25', 'jmods'),
+ {recursive: true}
+ );
+ expect(spyCacheDir).toHaveBeenCalledWith(
+ path.join('/tmp/extracted', 'jdk-25'),
+ 'Java_Temurin-Hotspot_jdk+jmods',
+ '25.0.3-9',
+ 'x64'
+ );
+ });
+
+ it('fails when signature is missing and verification is enabled', async () => {
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true
+ },
+ TemurinImplementation.Hotspot
+ );
+
+ await expect(
+ distribution['downloadTool']({
+ version: '17.0.14+7',
+ url: 'https://example.com/jdk.tar.gz'
+ })
+ ).rejects.toThrow(
+ "Input 'verify-signature' is enabled, but no signature URL was found"
+ );
+ expect(spyVerifySignature).not.toHaveBeenCalled();
+ });
+
+ it('uses custom public key when verifySignaturePublicKey is provided', async () => {
+ const customKey =
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\ncustom\n-----END PGP PUBLIC KEY BLOCK-----';
+ const distribution = new TemurinDistribution(
+ {
+ version: '17',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false,
+ verifySignature: true,
+ verifySignaturePublicKey: customKey
+ },
+ 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).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ customKey
);
});
});
diff --git a/__tests__/distributors/zulu-installer.test.ts b/__tests__/distributors/zulu-installer.test.ts
index f8b8a72cb..7b7b1856d 100644
--- a/__tests__/distributors/zulu-installer.test.ts
+++ b/__tests__/distributors/zulu-installer.test.ts
@@ -1,29 +1,77 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import fs from 'fs';
+import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
import {HttpClient} from '@actions/http-client';
-import * as semver from 'semver';
-import {ZuluDistribution} from '../../src/distributions/zulu/installer';
-import {IZuluVersions} from '../../src/distributions/zulu/models';
-import * as utils from '../../src/util';
import os from 'os';
-import manifestData from '../data/zulu-releases-default.json';
+import manifestData from '../data/zulu-releases-default.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {ZuluDistribution} =
+ await import('../../src/distributions/zulu/installer.js');
+const utils = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockReturnValue({
statusCode: 200,
headers: {},
- result: manifestData as IZuluVersions[]
+ result: [] as IZuluVersions[]
});
- spyUtilGetDownloadArchiveExtension = jest.spyOn(
- utils,
- 'getDownloadArchiveExtension'
+ (utils.getDownloadArchiveExtension as jest.Mock).mockReturnValue(
+ 'tar.gz'
);
- spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -40,7 +88,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -49,7 +97,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -58,7 +106,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -67,7 +115,7 @@ describe('getAvailableVersions', () => {
packageType: 'jre',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=macos&archive_type=tar.gz&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -76,7 +124,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk+fx',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -85,7 +133,16 @@ describe('getAvailableVersions', () => {
packageType: 'jre+fx',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=macos&archive_type=tar.gz&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
+ ],
+ [
+ {
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk+crac',
+ checkLatest: false
+ },
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -94,7 +151,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -103,12 +160,12 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
+ '?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
]
])('build correct url for %s -> %s', async (input, parsedUrl) => {
const distribution = new ZuluDistribution(input);
distribution['getPlatformOption'] = () => 'macos';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
await distribution['getAvailableVersions']();
@@ -116,17 +173,15 @@ describe('getAvailableVersions', () => {
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
});
- type DistroArch = {
- bitness: string;
- arch: string;
- };
it.each([
- ['amd64', {bitness: '64', arch: 'x86'}],
- ['arm64', {bitness: '64', arch: 'arm'}]
+ ['amd64', 'x64'],
+ ['arm64', 'aarch64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
- async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ async (osArch: string, distroArch: string) => {
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const distribution = new ZuluDistribution({
version: '17',
@@ -135,7 +190,7 @@ describe('getAvailableVersions', () => {
checkLatest: false
});
distribution['getPlatformOption'] = () => 'macos';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
await distribution['getAvailableVersions']();
@@ -145,6 +200,18 @@ describe('getAvailableVersions', () => {
);
it('load available versions', async () => {
+ spyHttpClient
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: manifestData as IZuluVersions[]
+ })
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [] as IZuluVersions[]
+ });
+
const distribution = new ZuluDistribution({
version: '11',
architecture: 'x86',
@@ -158,10 +225,11 @@ describe('getAvailableVersions', () => {
describe('getArchitectureOptions', () => {
it.each([
- [{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
- [{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
- [{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
- [{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
+ [{architecture: 'x64'}, 'x64'],
+ [{architecture: 'x86'}, 'i686'],
+ [{architecture: 'aarch64'}, 'aarch64'],
+ [{architecture: 'arm64'}, 'aarch64'],
+ [{architecture: 'arm'}, 'arm']
])('%s -> %s', (input, expected) => {
const distribution = new ZuluDistribution({
version: '11',
@@ -169,11 +237,31 @@ describe('getArchitectureOptions', () => {
packageType: 'jdk',
checkLatest: false
});
- expect(distribution['getArchitectureOptions']()).toEqual(expected);
+ expect(distribution['getArchitectureOptions']()).toBe(expected);
});
});
describe('findPackageForDownload', () => {
+ let spyPackageDetails: any;
+
+ const ZULU_CHECKSUM = 'a'.repeat(64);
+
+ beforeEach(() => {
+ // The resolved winning package fetches sha256_hash from the Azul
+ // package-details endpoint; stub it so tests never reach the real
+ // network.
+ spyPackageDetails = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {sha256_hash: ZULU_CHECKSUM}
+ });
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
it.each([
['8', '8.0.282+8'],
['11.x', '11.0.10+9'],
@@ -212,6 +300,101 @@ describe('findPackageForDownload', () => {
expect(result.url).toBe(
'https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz'
);
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: ZULU_CHECKSUM,
+ source: 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-10933'
+ });
+ // Only the winning package's UUID triggers a details request.
+ expect(spyPackageDetails).toHaveBeenCalledWith(
+ 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-10933'
+ );
+ expect(spyPackageDetails).toHaveBeenCalledTimes(1);
+ });
+
+ it('skips checksum verification when sha256_hash is missing or malformed', async () => {
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {sha256_hash: 'not-a-valid-digest'}
+ });
+
+ const distribution = new ZuluDistribution({
+ version: '',
+ architecture: 'x86',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData;
+ const result = await distribution['findPackageForDownload']('11.0.5');
+
+ expect(result.checksum).toBeUndefined();
+ expect(core.debug).toHaveBeenCalledWith(
+ expect.stringContaining('No authoritative sha256 checksum')
+ );
+ });
+
+ describe('hotfix builds with a 4-segment java_version', () => {
+ // Mirrors the Azul Metadata API: 25.0.4.1 hotfix is reported as
+ // java_version=[25,0,4,1], openjdk_build_number=1 (SDKMAN '25.0.4+1.1').
+ const hotfixManifest = [
+ {
+ package_uuid: 'uuid-25.0.4+7',
+ name: 'zulu25.36.15-ca-jdk25.0.4-linux_x64.tar.gz',
+ download_url:
+ 'https://cdn.azul.com/zulu/bin/zulu25.36.15-ca-jdk25.0.4-linux_x64.tar.gz',
+ java_version: [25, 0, 4],
+ openjdk_build_number: 7,
+ distro_version: [25, 36, 15, 0],
+ latest: false,
+ availability_type: 'ca'
+ },
+ {
+ package_uuid: 'uuid-25.0.4+1.1',
+ name: 'zulu25.36.205-ca-jdk25.0.4.1-linux_x64.tar.gz',
+ download_url:
+ 'https://cdn.azul.com/zulu/bin/zulu25.36.205-ca-jdk25.0.4.1-linux_x64.tar.gz',
+ java_version: [25, 0, 4, 1],
+ openjdk_build_number: 1,
+ distro_version: [25, 36, 205, 0],
+ latest: true,
+ availability_type: 'ca'
+ },
+ {
+ package_uuid: 'uuid-25.0.3+9',
+ name: 'zulu25.34.17-ca-jdk25.0.3-linux_x64.tar.gz',
+ download_url:
+ 'https://cdn.azul.com/zulu/bin/zulu25.34.17-ca-jdk25.0.3-linux_x64.tar.gz',
+ java_version: [25, 0, 3],
+ openjdk_build_number: 9,
+ distro_version: [25, 34, 17, 0],
+ latest: false,
+ availability_type: 'ca'
+ }
+ ] as IZuluVersions[];
+
+ it.each([
+ ['25.0.4+1.1', '25.0.4+1.1', 'uuid-25.0.4+1.1'],
+ ['25', '25.0.4+1.1', 'uuid-25.0.4+1.1'],
+ ['25.0.4', '25.0.4+1.1', 'uuid-25.0.4+1.1'],
+ ['25.0.4+7', '25.0.4+7', 'uuid-25.0.4+7'],
+ ['25.0.3', '25.0.3+9', 'uuid-25.0.3+9']
+ ])('version is %s -> %s', async (input, expected, uuid) => {
+ const distribution = new ZuluDistribution({
+ version: input,
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => hotfixManifest;
+ const result = await distribution['findPackageForDownload'](
+ distribution['version']
+ );
+ expect(result.version).toBe(expected);
+ expect(result.url).toBe(
+ hotfixManifest.find(item => item.package_uuid === uuid)!.download_url
+ );
+ });
});
it('should throw an error', async () => {
@@ -224,6 +407,53 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData;
await expect(
distribution['findPackageForDownload'](distribution['version'])
- ).rejects.toThrow(/Could not find satisfied version for semver */);
+ ).rejects.toThrow(/No matching version found for SemVer/);
+ });
+});
+
+describe('Zulu getPlatformOption libc selection', () => {
+ const originalPlatform = Object.getOwnPropertyDescriptor(
+ process,
+ 'platform'
+ ) as PropertyDescriptor;
+
+ const setPlatform = (platform: NodeJS.Platform) =>
+ Object.defineProperty(process, 'platform', {
+ ...originalPlatform,
+ value: platform
+ });
+
+ const distribution = new ZuluDistribution({
+ version: '21',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', originalPlatform);
+ jest.restoreAllMocks();
+ });
+
+ it('selects the musl artifacts on Alpine', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ expect(distribution['getPlatformOption']()).toBe('linux_musl');
+ });
+
+ it('selects the glibc artifacts on other Linux runners', () => {
+ setPlatform('linux');
+ jest.spyOn(fs, 'existsSync').mockReturnValue(false);
+
+ expect(distribution['getPlatformOption']()).toBe('linux_glibc');
+ });
+
+ it('does not probe for Alpine off Linux', () => {
+ setPlatform('win32');
+ const existsSync = jest.spyOn(fs, 'existsSync');
+
+ expect(distribution['getPlatformOption']()).toBe('windows');
+ expect(existsSync).not.toHaveBeenCalled();
});
});
diff --git a/__tests__/distributors/zulu-linux-installer.test.ts b/__tests__/distributors/zulu-linux-installer.test.ts
index 60f36ee59..2b818c7de 100644
--- a/__tests__/distributors/zulu-linux-installer.test.ts
+++ b/__tests__/distributors/zulu-linux-installer.test.ts
@@ -1,29 +1,78 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
import {HttpClient} from '@actions/http-client';
import * as semver from 'semver';
-import {ZuluDistribution} from '../../src/distributions/zulu/installer';
-import {IZuluVersions} from '../../src/distributions/zulu/models';
-import * as utils from '../../src/util';
import os from 'os';
-import manifestData from '../data/zulu-linux.json';
+import manifestData from '../data/zulu-linux.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {ZuluDistribution} =
+ await import('../../src/distributions/zulu/installer.js');
+const utils = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyUtilGetDownloadArchiveExtension: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockReturnValue({
statusCode: 200,
headers: {},
- result: manifestData as IZuluVersions[]
+ result: [] as IZuluVersions[]
});
- spyUtilGetDownloadArchiveExtension = jest.spyOn(
- utils,
- 'getDownloadArchiveExtension'
- );
+ spyUtilGetDownloadArchiveExtension =
+ utils.getDownloadArchiveExtension as jest.Mock;
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -40,7 +89,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -49,7 +98,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -58,7 +107,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -67,7 +116,7 @@ describe('getAvailableVersions', () => {
packageType: 'jre',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -76,7 +125,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk+fx',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -85,7 +134,16 @@ describe('getAvailableVersions', () => {
packageType: 'jre+fx',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
+ ],
+ [
+ {
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk+crac',
+ checkLatest: false
+ },
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -94,7 +152,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -103,12 +161,12 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
+ '?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
]
])('build correct url for %s -> %s', async (input, parsedUrl) => {
const distribution = new ZuluDistribution(input);
- distribution['getPlatformOption'] = () => 'linux';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
+ distribution['getPlatformOption'] = () => 'linux_glibc';
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
await distribution['getAvailableVersions']();
@@ -116,17 +174,15 @@ describe('getAvailableVersions', () => {
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
});
- type DistroArch = {
- bitness: string;
- arch: string;
- };
it.each([
- ['amd64', {bitness: '64', arch: 'x86'}],
- ['arm64', {bitness: '64', arch: 'arm'}]
+ ['amd64', 'x64'],
+ ['arm64', 'aarch64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
- async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ async (osArch: string, distroArch: string) => {
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const distribution = new ZuluDistribution({
version: '17',
@@ -134,8 +190,10 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
});
- distribution['getPlatformOption'] = () => 'linux';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
+ distribution['getPlatformOption'] = () => 'linux_glibc';
+ // Override extension for linux default arch case to match util behavior
+ spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=linux_glibc&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
await distribution['getAvailableVersions']();
@@ -145,6 +203,18 @@ describe('getAvailableVersions', () => {
);
it('load available versions', async () => {
+ spyHttpClient
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: manifestData as IZuluVersions[]
+ })
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [] as IZuluVersions[]
+ });
+
const distribution = new ZuluDistribution({
version: '11',
architecture: 'x86',
@@ -158,10 +228,11 @@ describe('getAvailableVersions', () => {
describe('getArchitectureOptions', () => {
it.each([
- [{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
- [{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
- [{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
- [{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
+ [{architecture: 'x64'}, 'x64'],
+ [{architecture: 'x86'}, 'i686'],
+ [{architecture: 'aarch64'}, 'aarch64'],
+ [{architecture: 'arm64'}, 'aarch64'],
+ [{architecture: 'arm'}, 'arm']
])('%s -> %s', (input, expected) => {
const distribution = new ZuluDistribution({
version: '11',
@@ -169,11 +240,31 @@ describe('getArchitectureOptions', () => {
packageType: 'jdk',
checkLatest: false
});
- expect(distribution['getArchitectureOptions']()).toEqual(expected);
+ expect(distribution['getArchitectureOptions']()).toBe(expected);
});
});
describe('findPackageForDownload', () => {
+ let spyPackageDetails: any;
+
+ const ZULU_CHECKSUM = 'a'.repeat(64);
+
+ beforeEach(() => {
+ // The resolved winning package fetches sha256_hash from the Azul
+ // package-details endpoint; stub it so tests never reach the real
+ // network.
+ spyPackageDetails = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {sha256_hash: ZULU_CHECKSUM}
+ });
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
it.each([
['8', '8.0.282+8'],
['11.x', '11.0.10+9'],
@@ -212,6 +303,38 @@ describe('findPackageForDownload', () => {
expect(result.url).toBe(
'https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz'
);
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: ZULU_CHECKSUM,
+ source: 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-12447'
+ });
+ // Only the winning package's UUID triggers a details request.
+ expect(spyPackageDetails).toHaveBeenCalledWith(
+ 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-12447'
+ );
+ expect(spyPackageDetails).toHaveBeenCalledTimes(1);
+ });
+
+ it('skips checksum verification when sha256_hash is missing or malformed', async () => {
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {}
+ });
+
+ const distribution = new ZuluDistribution({
+ version: '',
+ architecture: 'arm64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData;
+ const result = await distribution['findPackageForDownload']('21.0.2');
+
+ expect(result.checksum).toBeUndefined();
+ expect(core.debug).toHaveBeenCalledWith(
+ expect.stringContaining('No authoritative sha256 checksum')
+ );
});
it('should throw an error', async () => {
@@ -224,6 +347,6 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData;
await expect(
distribution['findPackageForDownload'](distribution['version'])
- ).rejects.toThrow(/Could not find satisfied version for semver */);
+ ).rejects.toThrow(/No matching version found for SemVer/);
});
});
diff --git a/__tests__/distributors/zulu-windows-installer.test.ts b/__tests__/distributors/zulu-windows-installer.test.ts
index dcac5aa0d..c90890d5a 100644
--- a/__tests__/distributors/zulu-windows-installer.test.ts
+++ b/__tests__/distributors/zulu-windows-installer.test.ts
@@ -1,29 +1,77 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
import {HttpClient} from '@actions/http-client';
import * as semver from 'semver';
-import {ZuluDistribution} from '../../src/distributions/zulu/installer';
-import {IZuluVersions} from '../../src/distributions/zulu/models';
-import * as utils from '../../src/util';
import os from 'os';
-import manifestData from '../data/zulu-windows.json';
+import manifestData from '../data/zulu-windows.json' with {type: 'json'};
+
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const real_util_module = await import('../../src/util.js');
+jest.unstable_mockModule('../../src/util.js', () => ({
+ ...real_util_module,
+ getDownloadArchiveExtension: jest.fn()
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const {ZuluDistribution} =
+ await import('../../src/distributions/zulu/installer.js');
+const utils = await import('../../src/util.js');
describe('getAvailableVersions', () => {
- let spyHttpClient: jest.SpyInstance;
- let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
+ let spyHttpClient: any;
+ let spyCoreError: any;
beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
spyHttpClient.mockReturnValue({
statusCode: 200,
headers: {},
- result: manifestData as IZuluVersions[]
+ result: [] as IZuluVersions[]
});
- spyUtilGetDownloadArchiveExtension = jest.spyOn(
- utils,
- 'getDownloadArchiveExtension'
+ (utils.getDownloadArchiveExtension as jest.Mock).mockReturnValue(
+ 'zip'
);
- spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
+
+ // Mock core.error to suppress error logs
+ spyCoreError = core.error as jest.Mock;
+ spyCoreError.mockImplementation(() => {});
});
afterEach(() => {
@@ -40,7 +88,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -49,7 +97,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -58,7 +106,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -67,7 +115,7 @@ describe('getAvailableVersions', () => {
packageType: 'jre',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
+ '?os=windows&archive_type=zip&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -76,7 +124,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk+fx',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -85,7 +133,16 @@ describe('getAvailableVersions', () => {
packageType: 'jre+fx',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
+ '?os=windows&archive_type=zip&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
+ ],
+ [
+ {
+ version: '8',
+ architecture: 'x64',
+ packageType: 'jdk+crac',
+ checkLatest: false
+ },
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -94,7 +151,7 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
],
[
{
@@ -103,12 +160,12 @@ describe('getAvailableVersions', () => {
packageType: 'jdk',
checkLatest: false
},
- '?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
+ '?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
]
])('build correct url for %s -> %s', async (input, parsedUrl) => {
const distribution = new ZuluDistribution(input);
distribution['getPlatformOption'] = () => 'windows';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
await distribution['getAvailableVersions']();
@@ -116,17 +173,15 @@ describe('getAvailableVersions', () => {
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
});
- type DistroArch = {
- bitness: string;
- arch: string;
- };
it.each([
- ['amd64', {bitness: '64', arch: 'x86'}],
- ['arm64', {bitness: '64', arch: 'arm'}]
+ ['amd64', 'x64'],
+ ['arm64', 'aarch64']
])(
'defaults to os.arch(): %s mapped to distro arch: %s',
- async (osArch: string, distroArch: DistroArch) => {
- jest.spyOn(os, 'arch').mockReturnValue(osArch);
+ async (osArch: string, distroArch: string) => {
+ jest
+ .spyOn(os, 'arch')
+ .mockReturnValue(osArch as ReturnType);
const distribution = new ZuluDistribution({
version: '17',
@@ -135,7 +190,7 @@ describe('getAvailableVersions', () => {
checkLatest: false
});
distribution['getPlatformOption'] = () => 'windows';
- const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
+ const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
await distribution['getAvailableVersions']();
@@ -145,6 +200,18 @@ describe('getAvailableVersions', () => {
);
it('load available versions', async () => {
+ spyHttpClient
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: manifestData as IZuluVersions[]
+ })
+ .mockReturnValueOnce({
+ statusCode: 200,
+ headers: {},
+ result: [] as IZuluVersions[]
+ });
+
const distribution = new ZuluDistribution({
version: '11',
architecture: 'x86',
@@ -158,10 +225,11 @@ describe('getAvailableVersions', () => {
describe('getArchitectureOptions', () => {
it.each([
- [{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
- [{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
- [{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
- [{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
+ [{architecture: 'x64'}, 'x64'],
+ [{architecture: 'x86'}, 'i686'],
+ [{architecture: 'aarch64'}, 'aarch64'],
+ [{architecture: 'arm64'}, 'aarch64'],
+ [{architecture: 'arm'}, 'arm']
])('%s -> %s', (input, expected) => {
const distribution = new ZuluDistribution({
version: '11',
@@ -169,11 +237,31 @@ describe('getArchitectureOptions', () => {
packageType: 'jdk',
checkLatest: false
});
- expect(distribution['getArchitectureOptions']()).toEqual(expected);
+ expect(distribution['getArchitectureOptions']()).toBe(expected);
});
});
describe('findPackageForDownload', () => {
+ let spyPackageDetails: any;
+
+ const ZULU_CHECKSUM = 'a'.repeat(64);
+
+ beforeEach(() => {
+ // The resolved winning package fetches sha256_hash from the Azul
+ // package-details endpoint; stub it so tests never reach the real
+ // network.
+ spyPackageDetails = jest.spyOn(HttpClient.prototype, 'getJson');
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {sha256_hash: ZULU_CHECKSUM}
+ });
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
it.each([
['8', '8.0.282+8'],
['11.x', '11.0.10+9'],
@@ -212,6 +300,38 @@ describe('findPackageForDownload', () => {
expect(result.url).toBe(
'https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip'
);
+ expect(result.checksum).toEqual({
+ algorithm: 'sha256',
+ value: ZULU_CHECKSUM,
+ source: 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-12446'
+ });
+ // Only the winning package's UUID triggers a details request.
+ expect(spyPackageDetails).toHaveBeenCalledWith(
+ 'https://api.azul.com/metadata/v1/zulu/packages/test-uuid-12446'
+ );
+ expect(spyPackageDetails).toHaveBeenCalledTimes(1);
+ });
+
+ it('skips checksum verification when sha256_hash is missing or malformed', async () => {
+ spyPackageDetails.mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {sha256_hash: '123'}
+ });
+
+ const distribution = new ZuluDistribution({
+ version: '',
+ architecture: 'arm64',
+ packageType: 'jdk',
+ checkLatest: false
+ });
+ distribution['getAvailableVersions'] = async () => manifestData;
+ const result = await distribution['findPackageForDownload']('17.0.10');
+
+ expect(result.checksum).toBeUndefined();
+ expect(core.debug).toHaveBeenCalledWith(
+ expect.stringContaining('No authoritative sha256 checksum')
+ );
});
it('should throw an error', async () => {
@@ -224,6 +344,6 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData;
await expect(
distribution['findPackageForDownload'](distribution['version'])
- ).rejects.toThrow(/Could not find satisfied version for semver */);
+ ).rejects.toThrow(/No matching version found for SemVer/);
});
});
diff --git a/__tests__/entrypoints.test.ts b/__tests__/entrypoints.test.ts
new file mode 100644
index 000000000..1fc07dd08
--- /dev/null
+++ b/__tests__/entrypoints.test.ts
@@ -0,0 +1,87 @@
+import {afterAll, beforeAll, describe, expect, it} from '@jest/globals';
+import {spawnSync} from 'child_process';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+import {fileURLToPath, pathToFileURL} from 'url';
+
+const dist = fileURLToPath(new URL('../dist/', import.meta.url));
+let tempDir: string;
+let linkedDist: string;
+
+beforeAll(() => {
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-java-entrypoints-'));
+ linkedDist = path.join(tempDir, 'linked # dist');
+ fs.symlinkSync(dist, linkedDist, 'junction');
+});
+
+afterAll(() => {
+ fs.rmSync(tempDir, {recursive: true, force: true});
+});
+
+function execute(args: string[], input?: string) {
+ return spawnSync(process.execPath, args, {
+ encoding: 'utf8',
+ input,
+ timeout: 10000,
+ env: {
+ PATH: process.env.PATH,
+ SystemRoot: process.env.SystemRoot
+ }
+ });
+}
+
+describe.each([
+ ['setup', 1, 'java-version or java-version-file input expected'],
+ ['cleanup', 0, '']
+] as const)('%s entrypoint', (name, exitCode, output) => {
+ it.each(['direct', 'symlink', 'preserved symlink'])(
+ 'executes through a %s path',
+ mode => {
+ const entry = path.join(
+ mode === 'direct' ? dist : linkedDist,
+ name,
+ 'index.js'
+ );
+ const args =
+ mode === 'preserved symlink'
+ ? ['--preserve-symlinks-main', entry]
+ : [entry];
+ const result = execute(args);
+
+ expect(result.error).toBeUndefined();
+ expect(result.status).toBe(exitCode);
+ expect(result.stderr).toBe('');
+ expect(result.stdout).not.toContain('skipping the execution');
+ if (output) {
+ expect(result.stdout).toContain(output);
+ } else {
+ expect(result.stdout).toBe('');
+ }
+ }
+ );
+
+ it.each(['eval', 'stdin', 'file'])(
+ 'does not execute when imported from %s',
+ mode => {
+ const moduleUrl = pathToFileURL(path.join(dist, name, 'index.js')).href;
+ const source = `const {run} = await import(${JSON.stringify(moduleUrl)}); console.log(typeof run);`;
+ const importer = path.join(tempDir, `${name}-importer.mjs`);
+ fs.writeFileSync(importer, source);
+ const args =
+ mode === 'file'
+ ? [importer]
+ : mode === 'eval'
+ ? ['--input-type=module', '-e', source]
+ : ['--input-type=module', '-'];
+ const result = execute(args, mode === 'stdin' ? source : undefined);
+
+ expect(result.error).toBeUndefined();
+ expect(result.status).toBe(0);
+ expect(result.stderr).toBe('');
+ expect(result.stdout).toContain('skipping the execution');
+ expect(result.stdout).toContain('function');
+ expect(result.stdout).not.toContain('::error::');
+ }
+ );
+});
diff --git a/__tests__/gpg.test.ts b/__tests__/gpg.test.ts
index 1c981b3f5..93c4593a6 100644
--- a/__tests__/gpg.test.ts
+++ b/__tests__/gpg.test.ts
@@ -1,20 +1,49 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterAll,
+ afterEach
+} from '@jest/globals';
+import {fileURLToPath} from 'url';
+import * as fs from 'fs';
+import * as os from 'os';
import * as path from 'path';
import * as io from '@actions/io';
-import * as exec from '@actions/exec';
-import * as gpg from '../src/gpg';
-jest.mock('@actions/exec', () => {
- return {
- exec: jest.fn()
- };
-});
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const mockTmpDir = jest.fn(os.tmpdir);
+
+jest.unstable_mockModule('os', () => ({
+ ...os,
+ default: {...os, tmpdir: mockTmpDir},
+ tmpdir: mockTmpDir
+}));
+
+jest.unstable_mockModule('@actions/exec', () => ({
+ exec: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ downloadTool: jest.fn()
+}));
+
+const exec = await import('@actions/exec');
+const tc = await import('@actions/tool-cache');
+const gpg = await import('../src/gpg.js');
const tempDir = path.join(__dirname, 'runner', 'temp');
process.env['RUNNER_TEMP'] = tempDir;
describe('gpg tests', () => {
beforeEach(async () => {
+ await io.rmRF(tempDir);
await io.mkdirP(tempDir);
+ jest.clearAllMocks();
+ mockTmpDir.mockImplementation(os.tmpdir);
+ (exec.exec as jest.Mock).mockResolvedValue(0);
});
afterAll(async () => {
@@ -25,31 +54,338 @@ describe('gpg tests', () => {
}
});
+ describe('toGpgPath', () => {
+ const originalPlatform = process.platform;
+
+ afterEach(() => {
+ Object.defineProperty(process, 'platform', {value: originalPlatform});
+ });
+
+ it('returns path unchanged on non-Windows platforms', () => {
+ Object.defineProperty(process, 'platform', {value: 'linux'});
+ expect(gpg.toGpgPath('/tmp/some/path')).toBe('/tmp/some/path');
+ expect(gpg.toGpgPath('D:\\a\\_temp\\file')).toBe('D:\\a\\_temp\\file');
+ });
+
+ it('converts Windows backslashes and drive letter to POSIX path on Windows', () => {
+ Object.defineProperty(process, 'platform', {value: 'win32'});
+ expect(gpg.toGpgPath('D:\\a\\_temp\\gpg-home')).toBe(
+ '/d/a/_temp/gpg-home'
+ );
+ expect(
+ gpg.toGpgPath('C:\\Users\\runner\\AppData\\Local\\Temp\\key.asc')
+ ).toBe('/c/Users/runner/AppData/Local/Temp/key.asc');
+ });
+
+ it('handles uppercase and lowercase drive letters on Windows', () => {
+ Object.defineProperty(process, 'platform', {value: 'win32'});
+ expect(gpg.toGpgPath('d:\\a\\_temp\\file')).toBe('/d/a/_temp/file');
+ });
+ });
+
describe('importKey', () => {
- it('attempts to import private key and returns null key id on failure', async () => {
+ it('imports private keys into a unique isolated GPG home', async () => {
const privateKey = 'KEY CONTENTS';
- const keyId = await gpg.importKey(privateKey);
+ let privateKeyFile = '';
+ (exec.exec as jest.Mock).mockImplementation(
+ async (_command: string, _args: string[]) => {
+ const [createdGpgHome] = fs.readdirSync(tempDir);
+ privateKeyFile = path.join(
+ tempDir,
+ createdGpgHome,
+ fs
+ .readdirSync(path.join(tempDir, createdGpgHome))
+ .find(file => file.startsWith('private-key-')) ?? ''
+ );
+ expect(fs.readFileSync(privateKeyFile, 'utf8')).toBe(privateKey);
+ if (process.platform !== 'win32') {
+ expect(fs.statSync(privateKeyFile).mode & 0o777).toBe(0o600);
+ }
+ return 0;
+ }
+ );
- expect(keyId).toBeNull();
+ const gpgHome = await gpg.importKey(privateKey);
+ expect(path.dirname(gpgHome)).toBe(tempDir);
+ expect(path.basename(gpgHome).startsWith(gpg.GPG_HOME_PREFIX)).toBe(true);
+ expect(fs.existsSync(gpgHome)).toBe(true);
+ expect(fs.existsSync(privateKeyFile)).toBe(false);
+ if (process.platform !== 'win32') {
+ expect(fs.statSync(gpgHome).mode & 0o777).toBe(0o700);
+ }
expect(exec.exec).toHaveBeenCalledWith(
'gpg',
- expect.anything(),
- expect.anything()
+ [
+ '--homedir',
+ gpg.toGpgPath(gpgHome),
+ '--batch',
+ '--import',
+ gpg.toGpgPath(privateKeyFile)
+ ],
+ {silent: true}
);
});
+
+ it('removes the private-key file and isolated home when import fails', async () => {
+ let gpgHome = '';
+ let privateKeyFile = '';
+ (exec.exec as jest.Mock).mockImplementation(
+ async (_command: string, _args: string[]) => {
+ const [createdGpgHome] = fs.readdirSync(tempDir);
+ gpgHome = path.join(tempDir, createdGpgHome);
+ privateKeyFile = path.join(
+ gpgHome,
+ fs
+ .readdirSync(gpgHome)
+ .find(file => file.startsWith('private-key-')) ?? ''
+ );
+ expect(fs.existsSync(privateKeyFile)).toBe(true);
+ throw new Error('invalid key');
+ }
+ );
+
+ await expect(gpg.importKey('INVALID KEY')).rejects.toThrow('invalid key');
+
+ expect(fs.existsSync(privateKeyFile)).toBe(false);
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ });
+
+ it('imports multi-key input without parsing or deleting fingerprints', async () => {
+ const privateKeys = 'KEY ONE\nKEY TWO';
+ (exec.exec as jest.Mock).mockImplementation(
+ async (_command: string, _args: string[]) => {
+ const [createdGpgHome] = fs.readdirSync(tempDir);
+ const keyFile = fs
+ .readdirSync(path.join(tempDir, createdGpgHome))
+ .find(file => file.startsWith('private-key-'));
+ expect(
+ fs.readFileSync(
+ path.join(tempDir, createdGpgHome, keyFile ?? ''),
+ 'utf8'
+ )
+ ).toBe(privateKeys);
+ return 0;
+ }
+ );
+
+ const gpgHome = await gpg.importKey(privateKeys);
+
+ expect(gpgHome).toContain(gpg.GPG_HOME_PREFIX);
+ expect(exec.exec).toHaveBeenCalledTimes(1);
+ expect((exec.exec as jest.Mock).mock.calls[0][1]).not.toContain(
+ '--delete-secret-and-public-key'
+ );
+ });
+
+ it('uses a separate GPG home for each invocation', async () => {
+ const firstGpgHome = await gpg.importKey('FIRST KEY');
+ const secondGpgHome = await gpg.importKey('SECOND KEY');
+
+ expect(firstGpgHome).not.toBe(secondGpgHome);
+ expect(fs.existsSync(firstGpgHome)).toBe(true);
+ expect(fs.existsSync(secondGpgHome)).toBe(true);
+ });
});
- describe('deleteKey', () => {
- it('deletes private key', async () => {
- const keyId = 'asdfhjkl';
- await gpg.deleteKey(keyId);
+ describe('removeGpgHome', () => {
+ it('removes only action-owned GPG homes and is idempotent', async () => {
+ const gpgHome = await gpg.importKey('KEY CONTENTS');
+ const unrelatedGpgHome = path.join(tempDir, 'user-gpg-home');
+ fs.mkdirSync(unrelatedGpgHome);
- expect(exec.exec).toHaveBeenCalledWith(
+ await gpg.removeGpgHome(gpgHome);
+ await gpg.removeGpgHome(gpgHome);
+
+ expect(exec.exec).toHaveBeenNthCalledWith(
+ 2,
+ 'gpgconf',
+ ['--homedir', gpg.toGpgPath(gpgHome), '--kill', 'gpg-agent'],
+ {silent: true, ignoreReturnCode: true}
+ );
+ expect(exec.exec).toHaveBeenCalledTimes(2);
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ expect(fs.existsSync(unrelatedGpgHome)).toBe(true);
+ });
+
+ it('removes the GPG home when gpgconf is unavailable', async () => {
+ const gpgHome = await gpg.importKey('KEY CONTENTS');
+ (exec.exec as jest.Mock).mockRejectedValueOnce(
+ new Error('gpgconf not found')
+ );
+
+ await gpg.removeGpgHome(gpgHome);
+
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ });
+
+ it('refuses to remove a GPG home it does not own', async () => {
+ const unrelatedGpgHome = path.join(tempDir, 'user-gpg-home');
+ fs.mkdirSync(unrelatedGpgHome, {recursive: true});
+
+ await expect(gpg.removeGpgHome(unrelatedGpgHome)).rejects.toThrow(
+ 'Refusing to remove unexpected GPG home'
+ );
+ expect(fs.existsSync(unrelatedGpgHome)).toBe(true);
+ });
+ });
+
+ describe('verifyPackageSignature', () => {
+ describe.each(['long', 'canonical macOS'])('%s TMPDIR', tempDirKind => {
+ afterEach(() => {
+ process.env['RUNNER_TEMP'] = tempDir;
+ });
+
+ it.each([
+ 'success',
+ 'import failure',
+ 'verification failure',
+ 'gpgconf unavailable'
+ ])(
+ 'uses a short macOS home or RUNNER_TEMP elsewhere and cleans up after %s',
+ async outcome => {
+ const longRunnerTemp = path.join(
+ tempDir,
+ 'long-runner-path-'.repeat(8)
+ );
+ const signaturePath = path.join(tempDir, 'jdk.tar.gz.sig');
+ const expectedParent =
+ process.platform === 'darwin' ? '/tmp' : longRunnerTemp;
+ let gpgHome = '';
+ process.env['RUNNER_TEMP'] = longRunnerTemp;
+ mockTmpDir.mockReturnValue(
+ tempDirKind === 'long'
+ ? longRunnerTemp
+ : `/private/var/folders/ab/${'c'.repeat(31)}/T`
+ );
+ fs.mkdirSync(longRunnerTemp, {recursive: true});
+ fs.writeFileSync(signaturePath, 'signature');
+ (tc.downloadTool as jest.Mock).mockResolvedValue(signaturePath);
+ (exec.exec as jest.Mock).mockImplementation(
+ async (command: string, args: string[]) => {
+ gpgHome = path.join(expectedParent, path.posix.basename(args[1]));
+ expect(args[1]).toBe(gpg.toGpgPath(gpgHome));
+ if (command === 'gpgconf') {
+ expect(fs.existsSync(gpgHome)).toBe(true);
+ if (outcome === 'gpgconf unavailable') {
+ throw new Error('gpgconf unavailable');
+ }
+ return 0;
+ }
+ if (process.platform === 'darwin') {
+ expect(
+ Buffer.byteLength(path.join(gpgHome, 'S.gpg-agent.browser'))
+ ).toBeLessThan(104);
+ }
+ expect(
+ fs.readFileSync(path.join(gpgHome, 'public-key-0.asc'), 'utf8')
+ ).toBe('public key');
+ if (process.platform !== 'win32') {
+ expect(fs.statSync(gpgHome).mode & 0o777).toBe(0o700);
+ }
+ if (
+ (outcome === 'import failure' && args.includes('--import')) ||
+ (outcome === 'verification failure' &&
+ args.includes('--verify'))
+ ) {
+ throw new Error(outcome);
+ }
+ return 0;
+ }
+ );
+
+ const verification = gpg.verifyPackageSignature(
+ path.join(tempDir, 'jdk.tar.gz'),
+ 'https://example.com/jdk.tar.gz.sig',
+ 'public key'
+ );
+ if (outcome === 'success' || outcome === 'gpgconf unavailable') {
+ await verification;
+ } else {
+ await expect(verification).rejects.toThrow(outcome);
+ }
+ expect(exec.exec).toHaveBeenCalledTimes(
+ outcome === 'import failure' ? 2 : 3
+ );
+ expect(exec.exec).toHaveBeenLastCalledWith(
+ 'gpgconf',
+ ['--homedir', gpg.toGpgPath(gpgHome), '--kill', 'gpg-agent'],
+ {silent: true, ignoreReturnCode: true}
+ );
+ expect(fs.existsSync(gpgHome)).toBe(false);
+ expect(fs.existsSync(signaturePath)).toBe(false);
+ expect(fs.readdirSync(longRunnerTemp)).toEqual([]);
+ }
+ );
+ });
+
+ it('imports bundled key and verifies package', async () => {
+ const publicKeyContent =
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\ntest\n-----END PGP PUBLIC KEY BLOCK-----';
+ (tc.downloadTool as jest.Mock).mockResolvedValue(
+ '/tmp/jdk.tar.gz.sig'
+ );
+ await gpg.verifyPackageSignature(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ publicKeyContent
+ );
+
+ expect(tc.downloadTool).toHaveBeenCalledWith(
+ 'https://example.com/jdk.tar.gz.sig'
+ );
+ expect(exec.exec).toHaveBeenNthCalledWith(
+ 1,
+ 'gpg',
+ [
+ '--homedir',
+ expect.any(String),
+ '--batch',
+ '--import',
+ expect.stringContaining('public-key-0.asc')
+ ],
+ expect.objectContaining({silent: true})
+ );
+ expect(exec.exec).toHaveBeenNthCalledWith(
+ 2,
+ 'gpg',
+ [
+ '--homedir',
+ expect.any(String),
+ '--batch',
+ '--verify',
+ '/tmp/jdk.tar.gz.sig',
+ '/tmp/jdk.tar.gz'
+ ],
+ expect.objectContaining({silent: true})
+ );
+ });
+
+ it('imports multiple bundled keys before verifying the package', async () => {
+ (tc.downloadTool as jest.Mock).mockResolvedValue(
+ '/tmp/jdk.tar.gz.sig'
+ );
+
+ await gpg.verifyPackageSignature(
+ '/tmp/jdk.tar.gz',
+ 'https://example.com/jdk.tar.gz.sig',
+ ['public-key-a', 'public-key-b']
+ );
+
+ expect(exec.exec).toHaveBeenNthCalledWith(
+ 1,
'gpg',
- expect.anything(),
- expect.anything()
+ [
+ '--homedir',
+ expect.any(String),
+ '--batch',
+ '--import',
+ expect.stringContaining('public-key-0.asc'),
+ expect.stringContaining('public-key-1.asc')
+ ],
+ expect.objectContaining({silent: true})
);
+ expect(exec.exec).toHaveBeenCalledTimes(3);
});
});
});
diff --git a/__tests__/is-main-module.test.ts b/__tests__/is-main-module.test.ts
new file mode 100644
index 000000000..42a5a2572
--- /dev/null
+++ b/__tests__/is-main-module.test.ts
@@ -0,0 +1,52 @@
+import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
+import fs from 'fs';
+import {isMainModule} from '../src/is-main-module.js';
+
+describe('main module detection', () => {
+ const originalArgv = process.argv;
+
+ beforeEach(() => {
+ process.argv = [process.execPath, 'entrypoint.js'];
+ });
+
+ afterEach(() => {
+ process.argv = originalArgv;
+ jest.restoreAllMocks();
+ });
+
+ it.each([undefined, '-'])(
+ 'skips filesystem access when argv[1] is %s',
+ entrypoint => {
+ process.argv =
+ entrypoint === undefined
+ ? [process.execPath]
+ : [process.execPath, entrypoint];
+ const realpath = jest.spyOn(fs, 'realpathSync');
+
+ expect(isMainModule(import.meta.url)).toBe(false);
+ expect(realpath).not.toHaveBeenCalled();
+ }
+ );
+
+ it.each(['ENOENT', 'ENOTDIR'])(
+ 'treats a non-file entrypoint returning %s as an import',
+ code => {
+ jest.spyOn(fs, 'realpathSync').mockImplementation(() => {
+ throw Object.assign(new Error('No file-based entrypoint'), {code});
+ });
+
+ expect(isMainModule(import.meta.url)).toBe(false);
+ }
+ );
+
+ it('propagates unexpected filesystem errors', () => {
+ const error = Object.assign(new Error('Permission denied'), {
+ code: 'EACCES'
+ });
+ jest.spyOn(fs, 'realpathSync').mockImplementation(() => {
+ throw error;
+ });
+
+ expect(() => isMainModule(import.meta.url)).toThrow(error);
+ });
+});
diff --git a/__tests__/java-package-contract.test.ts b/__tests__/java-package-contract.test.ts
new file mode 100644
index 000000000..457b0a491
--- /dev/null
+++ b/__tests__/java-package-contract.test.ts
@@ -0,0 +1,82 @@
+import fs from 'fs';
+import path from 'path';
+import {
+ JAVA_PACKAGE_CAPABILITIES,
+ JavaDistribution
+} from '../src/distributions/package-types.js';
+
+const repositoryRoot = process.cwd();
+const readRepositoryFile = (filePath: string) =>
+ fs.readFileSync(path.join(repositoryRoot, filePath), 'utf8');
+const allPackageTypes = [
+ ...new Set(Object.values(JAVA_PACKAGE_CAPABILITIES).flat())
+];
+
+describe('java-package published contract', () => {
+ it.each(['action.yml', 'README.md'])(
+ 'documents every supported package type in %s',
+ filePath => {
+ const content = readRepositoryFile(filePath);
+ const contractLine =
+ filePath === 'action.yml'
+ ? content.match(/ {2}java-package:\n(?: {4}.+\n)+/)?.[0]
+ : content
+ .split('\n')
+ .find(line => line.includes('| `java-package` |'));
+
+ expect(contractLine).toBeDefined();
+ for (const packageType of allPackageTypes) {
+ expect(contractLine).toContain(`\`${packageType}\``);
+ }
+ }
+ );
+
+ it.each(Object.entries(JAVA_PACKAGE_CAPABILITIES))(
+ 'keeps the advanced compatibility table aligned for %s',
+ (distributionName, packageTypes) => {
+ const advancedUsage = readRepositoryFile('docs/advanced-usage.md');
+ const compatibilityTable = advancedUsage.slice(
+ advancedUsage.indexOf('### Package compatibility')
+ );
+ const compatibilityRow = compatibilityTable
+ .split('\n')
+ .find(
+ line =>
+ line.startsWith('|') && line.includes(`\`${distributionName}\``)
+ );
+
+ expect(compatibilityRow).toBeDefined();
+ for (const packageType of packageTypes) {
+ expect(compatibilityRow).toContain(`\`${packageType}\``);
+ }
+ }
+ );
+
+ it('only exercises supported distribution/package combinations in E2E', () => {
+ const workflow = readRepositoryFile('.github/workflows/e2e-versions.yml');
+ const defaultMatrix = workflow.match(
+ /distribution:\s*\n\s*\[([^\]]+)\]\s*\n\s*java-package:\s*\['([^']+)'\]/
+ );
+ expect(defaultMatrix).not.toBeNull();
+
+ const defaultDistributions = [
+ ...defaultMatrix![1].matchAll(/'([^']+)'/g)
+ ].map(match => match[1]);
+ const defaultPackage = defaultMatrix![2];
+ for (const distributionName of defaultDistributions) {
+ expect(supportedPackagesFor(distributionName)).toContain(defaultPackage);
+ }
+
+ const includedPackages = workflow.matchAll(
+ /- distribution: '([^']+)'\s*\n\s*java-package: ([^\s]+)/g
+ );
+ for (const match of includedPackages) {
+ const [, distributionName, packageType] = match;
+ expect(supportedPackagesFor(distributionName)).toContain(packageType);
+ }
+ });
+});
+
+function supportedPackagesFor(distributionName: string): readonly string[] {
+ return JAVA_PACKAGE_CAPABILITIES[distributionName as JavaDistribution] ?? [];
+}
diff --git a/__tests__/java-platform-contract.test.ts b/__tests__/java-platform-contract.test.ts
new file mode 100644
index 000000000..6dd9784f8
--- /dev/null
+++ b/__tests__/java-platform-contract.test.ts
@@ -0,0 +1,196 @@
+import fs from 'fs';
+import path from 'path';
+import {
+ getJavaPlatformIdentity,
+ isAlpineLinux,
+ JAVA_PLATFORM_CAPABILITIES,
+ normalizeArchitecture,
+ validateJavaPlatform
+} from '../src/distributions/platform-types.js';
+import {JavaDistribution} from '../src/distributions/package-types.js';
+
+describe('Java platform capabilities', () => {
+ it('declares a capability for every distribution', () => {
+ expect(Object.keys(JAVA_PLATFORM_CAPABILITIES).sort()).toEqual(
+ Object.values(JavaDistribution).sort()
+ );
+ });
+
+ it.each([
+ ['x64', 'x64'],
+ ['amd64', 'x64'],
+ ['x86', 'x86'],
+ ['ia32', 'x86'],
+ ['arm', 'armv7'],
+ ['aarch64', 'aarch64'],
+ ['arm64', 'aarch64'],
+ ['ppc64le', 'ppc64le'],
+ ['RiScV64', 'riscv64'],
+ ['s390x', 's390x']
+ ])('normalizes architecture %s to %s', (input, expected) => {
+ expect(normalizeArchitecture(input)).toBe(expected);
+ });
+
+ it.each(['constructor', 'Constructor'])(
+ 'preserves custom architecture token %s for jdkfile',
+ architecture => {
+ expect(normalizeArchitecture(architecture)).toBe(architecture);
+ expect(validateJavaPlatform('jdkfile', 'linux', architecture, '17')).toBe(
+ architecture
+ );
+ }
+ );
+
+ it.each([
+ 'x64< {
+ const message = `Unsupported architecture value: ${JSON.stringify(architecture)}`;
+
+ expect(() => normalizeArchitecture(architecture)).toThrow(message);
+ expect(() =>
+ validateJavaPlatform('jdkfile', 'linux', architecture, '17')
+ ).toThrow(message);
+ });
+
+ it.each([
+ ['linux', false, 'linux-glibc'],
+ ['linux', true, 'linux-musl'],
+ ['darwin', false, 'macos'],
+ ['win32', false, 'windows'],
+ // Exercises the normalizePlatform alias path and the `?? platform`
+ // fallback for a platform that has no Java alias.
+ ['sunos', false, 'solaris'],
+ ['aix', false, 'aix']
+ ] as const)(
+ 'identifies %s with Alpine release %s as %s',
+ (platform, alpineReleaseExists, expected) => {
+ expect(getJavaPlatformIdentity(platform, alpineReleaseExists)).toBe(
+ expected
+ );
+ }
+ );
+
+ // The platform check has to short-circuit before the filesystem probe, so a
+ // stray /etc/alpine-release can never make a non-Linux runner look like musl.
+ it.each([
+ ['linux', true, true],
+ ['linux', false, false],
+ ['darwin', true, false],
+ ['win32', true, false]
+ ] as const)(
+ 'treats %s with Alpine release %s as Alpine: %s',
+ (platform, alpineReleaseExists, expected) => {
+ expect(isAlpineLinux(platform, alpineReleaseExists)).toBe(expected);
+ }
+ );
+
+ it('uses the normalized architecture for validation', () => {
+ expect(validateJavaPlatform('microsoft', 'linux', 'arm64', '25')).toBe(
+ 'aarch64'
+ );
+ });
+
+ it('allows Temurin on Linux riscv64', () => {
+ expect(validateJavaPlatform('temurin', 'linux', 'riscv64', '25')).toBe(
+ 'riscv64'
+ );
+ });
+
+ it('rejects OS-specific restrictions with a consistent diagnostic', () => {
+ expect(() =>
+ validateJavaPlatform('oracle', 'win32', 'arm64', '21')
+ ).toThrow(
+ "Distribution 'oracle' does not support operating system 'windows' with architecture 'aarch64' for Java version '21'. Supported combinations: linux (x64, aarch64); macos (x64, aarch64); windows (x64)."
+ );
+ });
+
+ it('rejects version-dependent architecture restrictions', () => {
+ expect(() =>
+ validateJavaPlatform('corretto', 'linux', 'x86', '17')
+ ).toThrow(/x86 \(<12\)/);
+ expect(() =>
+ validateJavaPlatform('corretto', 'linux', 'x86', '17.0.2.8.1')
+ ).toThrow(/x86 \(<12\)/);
+ expect(validateJavaPlatform('corretto', 'linux', 'x86', '11')).toBe('x86');
+ });
+
+ it.each(['corretto', 'kona'])(
+ 'rejects Windows aarch64 for %s',
+ distributionName => {
+ expect(() =>
+ validateJavaPlatform(distributionName, 'win32', 'arm64', '21')
+ ).toThrow(/does not support operating system 'windows'/);
+ }
+ );
+
+ it('allows local archives on any platform and architecture', () => {
+ expect(validateJavaPlatform('jdkfile', 'aix', 'mips64', '21')).toBe(
+ 'mips64'
+ );
+ });
+
+ it('keeps the documented architecture contract aligned', () => {
+ const repositoryRoot = process.cwd();
+ const readRepositoryFile = (filePath: string) =>
+ fs.readFileSync(path.join(repositoryRoot, filePath), 'utf8');
+
+ for (const filePath of ['action.yml', 'README.md']) {
+ const content = readRepositoryFile(filePath);
+ for (const architecture of [
+ 'x86',
+ 'x64',
+ 'armv7',
+ 'aarch64',
+ 'ppc64le',
+ 'ppc64',
+ 'riscv64',
+ 's390x'
+ ]) {
+ expect(content).toContain(architecture);
+ }
+ }
+ });
+
+ it.each(Object.entries(JAVA_PLATFORM_CAPABILITIES))(
+ 'keeps the advanced compatibility table aligned for %s',
+ (distributionName, capability) => {
+ const advancedUsage = fs.readFileSync(
+ path.join(process.cwd(), 'docs/advanced-usage.md'),
+ 'utf8'
+ );
+ const compatibilityTable = advancedUsage.slice(
+ advancedUsage.indexOf('## Platform and architecture compatibility')
+ );
+ const compatibilityRow = compatibilityTable
+ .split('\n')
+ .find(
+ line =>
+ line.startsWith('|') && line.includes(`\`${distributionName}\``)
+ );
+
+ expect(compatibilityRow).toBeDefined();
+ if (!('platforms' in capability)) {
+ expect(compatibilityRow).toContain('Any');
+ return;
+ }
+
+ const architectures = new Set(
+ Object.values(capability.platforms)
+ .flat()
+ .map(item => (typeof item === 'string' ? item : item.architecture))
+ );
+ for (const architecture of architectures) {
+ expect(compatibilityRow).toContain(`\`${architecture}\``);
+ }
+ }
+ );
+});
diff --git a/__tests__/jdk-cache.test.ts b/__tests__/jdk-cache.test.ts
new file mode 100644
index 000000000..c5c3c4fb9
--- /dev/null
+++ b/__tests__/jdk-cache.test.ts
@@ -0,0 +1,352 @@
+import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+
+jest.unstable_mockModule('@actions/cache', () => ({
+ restoreCache: jest.fn(),
+ saveCache: jest.fn(),
+ ReserveCacheError: class ReserveCacheError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = 'ReserveCacheError';
+ }
+ }
+}));
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/cache-feature.js', () => ({
+ isCacheFeatureAvailable: jest.fn()
+}));
+
+const cache = await import('@actions/cache');
+const core = await import('@actions/core');
+const cacheFeature = await import('../src/cache-feature.js');
+const {
+ buildJdkCacheKey,
+ getJdkVerificationIdentity,
+ registerJdk,
+ restoreJdk,
+ saveJdkCaches
+} = await import('../src/jdk-cache.js');
+
+const jdk = {
+ distribution: 'temurin',
+ packageType: 'jdk',
+ architecture: 'x64',
+ version: '21.0.8+9',
+ source: 'sha256:abc123',
+ verification: 'disabled',
+ path: '/toolcache/Java_temurin_jdk/21.0.8-9'
+};
+
+describe('JDK cache', () => {
+ const tempRoots: string[] = [];
+
+ const createInstallation = (marker = 'a'): string => {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-java-jdk-'));
+ tempRoots.push(root);
+ const jdkPath = path.join(root, 'Java_temurin_jdk', '21.0.8-9');
+ writeInstallation(jdkPath, marker);
+ return jdkPath;
+ };
+
+ const writeInstallation = (jdkPath: string, marker: string): void => {
+ const architecturePath = path.join(jdkPath, 'x64');
+ fs.rmSync(architecturePath, {recursive: true, force: true});
+ fs.rmSync(`${architecturePath}.complete`, {force: true});
+ fs.mkdirSync(path.join(architecturePath, 'bin'), {recursive: true});
+ fs.writeFileSync(path.join(architecturePath, 'bin', 'java'), marker);
+ fs.writeFileSync(`${architecturePath}.complete`, marker);
+ };
+
+ const lastState = (): string =>
+ ((core.saveState as jest.Mock).mock.calls.at(-1) as string[])[1];
+
+ beforeEach(() => {
+ jest.resetAllMocks();
+ (cacheFeature.isCacheFeatureAvailable as jest.Mock).mockReturnValue(true);
+ process.env['RUNNER_OS'] = 'Linux';
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ delete process.env['RUNNER_OS'];
+ while (tempRoots.length) {
+ fs.rmSync(tempRoots.pop()!, {recursive: true, force: true});
+ }
+ });
+
+ it('builds distinct keys for incompatible JDK identities', () => {
+ const key = buildJdkCacheKey(jdk);
+
+ expect(key).toMatch(/^setup-java-jdk-v1-Linux-x64-[a-f0-9]{64}$/);
+ expect(buildJdkCacheKey({...jdk, architecture: 'aarch64'})).not.toBe(key);
+ expect(buildJdkCacheKey({...jdk, distribution: 'zulu'})).not.toBe(key);
+ expect(buildJdkCacheKey({...jdk, packageType: 'jre'})).not.toBe(key);
+ expect(buildJdkCacheKey({...jdk, version: '21.0.7+6'})).not.toBe(key);
+ expect(buildJdkCacheKey({...jdk, source: 'sha256:def456'})).not.toBe(key);
+ });
+
+ it('preserves canonical runner OS values and separates operating systems', () => {
+ process.env['RUNNER_OS'] = 'Linux';
+ const linux = buildJdkCacheKey(jdk);
+ process.env['RUNNER_OS'] = 'Windows';
+ const windows = buildJdkCacheKey(jdk);
+ process.env['RUNNER_OS'] = 'macOS';
+ const macos = buildJdkCacheKey(jdk);
+
+ expect(new Set([linux, windows, macos])).toHaveProperty('size', 3);
+ expect(linux).toMatch(/^setup-java-jdk-v1-Linux-x64-/);
+ expect(windows).toMatch(/^setup-java-jdk-v1-Windows-x64-/);
+ expect(macos).toMatch(/^setup-java-jdk-v1-macOS-x64-/);
+ });
+
+ it('falls back to process.platform without RUNNER_OS', () => {
+ delete process.env['RUNNER_OS'];
+
+ expect(buildJdkCacheKey(jdk)).toMatch(
+ new RegExp(`^setup-java-jdk-v1-${process.platform}-x64-`)
+ );
+ });
+
+ it('separates verification policies and keys', () => {
+ const disabled = getJdkVerificationIdentity(false, false);
+ const checkAndWarnBundled = getJdkVerificationIdentity(true, false);
+ const enforcedBundled = getJdkVerificationIdentity(true, true);
+ const customA = getJdkVerificationIdentity(
+ true,
+ true,
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nkey-a\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n'
+ );
+ const customANormalized = getJdkVerificationIdentity(
+ true,
+ true,
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\nkey-a\n-----END PGP PUBLIC KEY BLOCK-----'
+ );
+ const customB = getJdkVerificationIdentity(true, true, 'different-key');
+ const checkAndWarnCustomA = getJdkVerificationIdentity(
+ true,
+ false,
+ '-----BEGIN PGP PUBLIC KEY BLOCK-----\nkey-a\n-----END PGP PUBLIC KEY BLOCK-----'
+ );
+ const customList = getJdkVerificationIdentity(true, true, [
+ 'key-a',
+ 'key-b'
+ ]);
+ const customListWithDifferentBoundary = getJdkVerificationIdentity(
+ true,
+ true,
+ ['key-ak', 'ey-b']
+ );
+
+ expect(
+ new Set([
+ disabled,
+ checkAndWarnBundled,
+ enforcedBundled,
+ customA,
+ customB
+ ])
+ ).toHaveProperty('size', 5);
+ expect(disabled).toBe('disabled');
+ expect(checkAndWarnBundled).toBe('check-and-warn:bundled');
+ expect(enforcedBundled).toBe('enforced:bundled');
+ expect(checkAndWarnCustomA).not.toBe(customA);
+ expect(customA).toBe(customANormalized);
+ expect(customA).not.toContain('key-a');
+ expect(customList).not.toBe(customListWithDifferentBoundary);
+ expect(
+ new Set(
+ [disabled, checkAndWarnBundled, enforcedBundled, customA, customB].map(
+ verification => buildJdkCacheKey({...jdk, verification})
+ )
+ )
+ ).toHaveProperty('size', 5);
+ });
+
+ it('restores and records an exact JDK cache hit', async () => {
+ (cache.restoreCache as jest.Mock).mockResolvedValue(buildJdkCacheKey(jdk));
+ jest.spyOn(fs, 'existsSync').mockReturnValue(true);
+
+ await expect(restoreJdk(jdk)).resolves.toBe(true);
+
+ expect(cache.restoreCache).toHaveBeenCalledWith(
+ [jdk.path],
+ buildJdkCacheKey(jdk)
+ );
+ const architecturePath = path.join(jdk.path, 'x64');
+ expect(fs.existsSync).toHaveBeenCalledWith(architecturePath);
+ expect(fs.existsSync).toHaveBeenCalledWith(`${architecturePath}.complete`);
+ expect(core.saveState).toHaveBeenCalledWith(
+ 'jdk-caches',
+ expect.stringContaining(buildJdkCacheKey(jdk))
+ );
+ });
+
+ it('falls back to download when restoration fails', async () => {
+ (cache.restoreCache as jest.Mock).mockRejectedValue(
+ new Error('cache unavailable')
+ );
+
+ await expect(restoreJdk(jdk)).resolves.toBe(false);
+ expect(core.warning).toHaveBeenCalledWith(
+ 'Failed to restore JDK cache: cache unavailable'
+ );
+ });
+
+ it('saves a downloaded JDK registered after installation', async () => {
+ const jdkPath = createInstallation();
+ const installed = {...jdk, path: jdkPath};
+ const key = buildJdkCacheKey(installed);
+ (cache.restoreCache as jest.Mock).mockResolvedValue(undefined);
+
+ await restoreJdk(installed);
+ registerJdk(installed);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+ (cache.saveCache as jest.Mock).mockResolvedValue(1);
+
+ await saveJdkCaches();
+
+ expect(cache.saveCache).toHaveBeenCalledWith([jdkPath], key);
+ });
+
+ it('does not save an installation that was replaced after registration', async () => {
+ const jdkPath = createInstallation();
+ const installed = {...jdk, path: jdkPath};
+ const key = buildJdkCacheKey(installed);
+
+ registerJdk(installed);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+ writeInstallation(jdkPath, 'replaced-by-a-later-step');
+
+ await saveJdkCaches();
+
+ expect(cache.saveCache).not.toHaveBeenCalledWith([jdkPath], key);
+ expect(core.warning).toHaveBeenCalledWith(
+ expect.stringContaining('was replaced after it was registered')
+ );
+ });
+
+ it('saves only the key matching the installation that occupies the path', async () => {
+ const jdkPath = createInstallation();
+ const enforced = {...jdk, path: jdkPath, verification: 'enforced:bundled'};
+ const disabled = {...jdk, path: jdkPath};
+
+ registerJdk(enforced);
+ writeInstallation(jdkPath, 'force-downloaded-without-verification');
+ registerJdk(disabled);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+ (cache.saveCache as jest.Mock).mockResolvedValue(1);
+
+ await saveJdkCaches();
+
+ expect(cache.saveCache).not.toHaveBeenCalledWith(
+ [jdkPath],
+ buildJdkCacheKey(enforced)
+ );
+ expect(cache.saveCache).toHaveBeenCalledWith(
+ [jdkPath],
+ buildJdkCacheKey(disabled)
+ );
+ });
+
+ it('does not save a path that was never registered as installed', async () => {
+ const jdkPath = createInstallation();
+ const installed = {...jdk, path: jdkPath};
+ (cache.restoreCache as jest.Mock).mockResolvedValue(undefined);
+
+ await restoreJdk(installed);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+
+ await saveJdkCaches();
+
+ expect(cache.saveCache).not.toHaveBeenCalledWith(
+ [jdkPath],
+ buildJdkCacheKey(installed)
+ );
+ });
+
+ it('keeps saving the remaining JDK caches when one save fails', async () => {
+ const failingPath = createInstallation();
+ const succeedingPath = createInstallation();
+ const failing = {...jdk, path: failingPath};
+ const succeeding = {...jdk, path: succeedingPath, version: '17.0.19+9'};
+
+ registerJdk(failing);
+ registerJdk(succeeding);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+ (cache.saveCache as jest.Mock).mockImplementation(
+ async (paths: unknown) => {
+ if ((paths as string[])[0] === failingPath) {
+ throw new Error('cache service unavailable');
+ }
+ return 1;
+ }
+ );
+
+ await expect(saveJdkCaches()).resolves.toBeUndefined();
+
+ expect(cache.saveCache).toHaveBeenCalledWith(
+ [succeedingPath],
+ buildJdkCacheKey(succeeding)
+ );
+ expect(core.warning).toHaveBeenCalledWith(
+ expect.stringContaining('cache service unavailable')
+ );
+ expect(core.info).toHaveBeenCalledWith(
+ `JDK cache saved with the key: ${buildJdkCacheKey(succeeding)}`
+ );
+ });
+
+ it('reports a reserved cache key without failing the remaining saves', async () => {
+ const reservedPath = createInstallation();
+ const reserved = {...jdk, path: reservedPath};
+
+ registerJdk(reserved);
+ (core.getState as jest.Mock).mockReturnValue(lastState());
+ (cache.saveCache as jest.Mock).mockRejectedValue(
+ new cache.ReserveCacheError('Unable to reserve cache')
+ );
+
+ await expect(saveJdkCaches()).resolves.toBeUndefined();
+
+ expect(core.info).toHaveBeenCalledWith('Unable to reserve cache');
+ });
+
+ it('registers a force-downloaded JDK without restoring it', () => {
+ const jdkPath = createInstallation();
+ registerJdk({...jdk, path: jdkPath});
+
+ expect(cache.restoreCache).not.toHaveBeenCalled();
+ expect(core.saveState).toHaveBeenCalledWith(
+ 'jdk-caches',
+ expect.stringContaining(buildJdkCacheKey({...jdk, path: jdkPath}))
+ );
+ });
+
+ it('does not save an exact JDK cache hit again', async () => {
+ const key = buildJdkCacheKey(jdk);
+ (core.getState as jest.Mock).mockReturnValue(
+ JSON.stringify([
+ {
+ key,
+ path: jdk.path,
+ architecture: jdk.architecture,
+ matchedKey: key
+ }
+ ])
+ );
+
+ await saveJdkCaches();
+
+ expect(cache.saveCache).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/jdk-resolution-cache.test.ts b/__tests__/jdk-resolution-cache.test.ts
new file mode 100644
index 000000000..9c6703fc6
--- /dev/null
+++ b/__tests__/jdk-resolution-cache.test.ts
@@ -0,0 +1,416 @@
+import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
+import fs from 'fs';
+import os from 'os';
+import path from 'path';
+
+jest.unstable_mockModule('@actions/cache', () => ({
+ isFeatureAvailable: jest.fn(),
+ restoreCache: jest.fn(),
+ saveCache: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn()
+}));
+
+const cache = await import('@actions/cache');
+const core = await import('@actions/core');
+const {restoreJdkResolution, registerJdkResolution, saveJdkResolutionCaches} =
+ await import('../src/jdk-resolution-cache.js');
+
+const request = {
+ distribution: 'Temurin-Hotspot',
+ packageType: 'jdk',
+ platform: 'linux-glibc',
+ architecture: 'x64',
+ versionSpec: '21',
+ stable: true
+};
+
+const release = {
+ version: '21.0.8+9',
+ url: 'https://example.com/jdk-21.0.8.tar.gz',
+ checksum: {algorithm: 'sha256' as const, value: 'abc123'}
+};
+
+const WEEK = 7 * 24 * 60 * 60 * 1000;
+const bucket = () =>
+ new Date(Math.floor(Date.now() / WEEK) * WEEK).toISOString().slice(0, 10);
+
+describe('JDK resolution cache', () => {
+ const tempRoots: string[] = [];
+ let originalTemp: string | undefined;
+ let originalOs: string | undefined;
+
+ const createRunnerTemp = (): string => {
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-java-res-'));
+ tempRoots.push(root);
+ process.env['RUNNER_TEMP'] = root;
+ return root;
+ };
+
+ /** Emulates the cache service materializing the entry at the requested path. */
+ const restoreWith = (contents: string, matchedKey: string) => {
+ jest
+ .mocked(cache.restoreCache)
+ .mockImplementation(async (paths: string[]) => {
+ fs.mkdirSync(paths[0], {recursive: true});
+ fs.writeFileSync(path.join(paths[0], 'release.json'), contents);
+ return matchedKey;
+ });
+ };
+
+ beforeEach(() => {
+ originalTemp = process.env['RUNNER_TEMP'];
+ originalOs = process.env['RUNNER_OS'];
+ process.env['RUNNER_OS'] = 'Linux';
+ jest.mocked(cache.isFeatureAvailable).mockReturnValue(true);
+ jest.mocked(cache.restoreCache).mockResolvedValue(undefined);
+ jest.mocked(cache.saveCache).mockResolvedValue(1);
+ jest.mocked(core.getState).mockReturnValue('');
+ });
+
+ afterEach(() => {
+ process.env['RUNNER_TEMP'] = originalTemp;
+ process.env['RUNNER_OS'] = originalOs;
+ if (originalTemp === undefined) {
+ delete process.env['RUNNER_TEMP'];
+ }
+ if (originalOs === undefined) {
+ delete process.env['RUNNER_OS'];
+ }
+ while (tempRoots.length > 0) {
+ fs.rmSync(tempRoots.pop()!, {recursive: true, force: true});
+ }
+ jest.resetAllMocks();
+ });
+
+ describe('restoreJdkResolution', () => {
+ it('looks the entry up with a bucket-independent path', async () => {
+ const runnerTemp = createRunnerTemp();
+ await restoreJdkResolution(request);
+
+ const [paths, primaryKey, restoreKeys] = jest.mocked(cache.restoreCache)
+ .mock.calls[0] as [string[], string, string[]];
+ expect(paths).toHaveLength(1);
+ expect(
+ paths[0].startsWith(path.join(runnerTemp, 'setup-java-jdk-resolution'))
+ ).toBe(true);
+ expect(paths[0]).not.toContain(bucket());
+ expect(primaryKey).toBe(`${restoreKeys[0]}${bucket()}`);
+ expect(restoreKeys[0]).toMatch(
+ /^setup-java-jdkres-v2-Linux-x64-[0-9a-f]{64}-$/
+ );
+ });
+
+ it('separates glibc and musl Linux resolutions', async () => {
+ createRunnerTemp();
+ await restoreJdkResolution(request);
+ const [glibcPaths, glibcKey] = jest.mocked(cache.restoreCache).mock
+ .calls[0] as [string[], string];
+
+ await restoreJdkResolution({...request, platform: 'linux-musl'});
+ const [muslPaths, muslKey] = jest.mocked(cache.restoreCache).mock
+ .calls[1] as [string[], string];
+
+ expect(muslKey).not.toBe(glibcKey);
+ expect(muslPaths).not.toEqual(glibcPaths);
+ });
+
+ it('holds the key steady for a week and then rolls it', async () => {
+ createRunnerTemp();
+ const nowSpy = jest.spyOn(Date, 'now');
+ const keyAt = async (ms: number) => {
+ nowSpy.mockReturnValue(ms);
+ await restoreJdkResolution(request);
+ return jest.mocked(cache.restoreCache).mock.calls.at(-1)![1] as string;
+ };
+
+ // A window boundary, so the offsets below are unambiguous.
+ const windowStart = 2900 * WEEK;
+
+ const start = await keyAt(windowStart);
+ const sameWindow = await keyAt(windowStart + 6 * 24 * 60 * 60 * 1000);
+ const nextWindow = await keyAt(windowStart + WEEK);
+
+ expect(sameWindow).toBe(start);
+ expect(nextWindow).not.toBe(start);
+ nowSpy.mockRestore();
+ });
+
+ it('reports a hit on the current bucket as fresh', async () => {
+ createRunnerTemp();
+ const key = `setup-java-jdkres-v2-Linux-x64-${'0'.repeat(64)}-${bucket()}`;
+ restoreWith(JSON.stringify(release), key);
+
+ // The key the module computes is the one it passes to restoreCache, so
+ // echo it back to emulate an exact hit.
+ jest
+ .mocked(cache.restoreCache)
+ .mockImplementation(async (paths: string[], primaryKey: string) => {
+ fs.mkdirSync(paths[0], {recursive: true});
+ fs.writeFileSync(
+ path.join(paths[0], 'release.json'),
+ JSON.stringify(release)
+ );
+ return primaryKey;
+ });
+
+ const restored = await restoreJdkResolution(request);
+ expect(restored?.fresh).toBe(true);
+ expect(restored?.release).toEqual(release);
+ });
+
+ it('reports a hit on an older bucket as stale', async () => {
+ createRunnerTemp();
+ restoreWith(JSON.stringify(release), 'setup-java-jdkres-v2-old');
+
+ const restored = await restoreJdkResolution(request);
+ expect(restored?.fresh).toBe(false);
+ expect(restored?.release).toEqual(release);
+ });
+
+ it('returns nothing when the entry is missing', async () => {
+ createRunnerTemp();
+ await expect(restoreJdkResolution(request)).resolves.toBeUndefined();
+ });
+
+ it('returns nothing when the cache service is unavailable', async () => {
+ createRunnerTemp();
+ jest.mocked(cache.isFeatureAvailable).mockReturnValue(false);
+
+ await expect(restoreJdkResolution(request)).resolves.toBeUndefined();
+ expect(cache.restoreCache).not.toHaveBeenCalled();
+ });
+
+ it('returns nothing when RUNNER_TEMP is not set', async () => {
+ delete process.env['RUNNER_TEMP'];
+
+ await expect(restoreJdkResolution(request)).resolves.toBeUndefined();
+ expect(cache.restoreCache).not.toHaveBeenCalled();
+ });
+
+ it('does not fail the job when the restore throws', async () => {
+ createRunnerTemp();
+ jest
+ .mocked(cache.restoreCache)
+ .mockRejectedValue(new Error('service unavailable'));
+
+ await expect(restoreJdkResolution(request)).resolves.toBeUndefined();
+ });
+
+ it.each([
+ ['malformed JSON', 'not json'],
+ ['a non-object payload', '"nope"'],
+ [
+ 'a missing version',
+ JSON.stringify({url: 'https://example.com/a.tar.gz'})
+ ],
+ ['a missing url', JSON.stringify({version: '21.0.8+9'})],
+ [
+ 'a non-HTTPS url',
+ JSON.stringify({
+ version: '21.0.8+9',
+ url: 'http://example.com/a.tar.gz'
+ })
+ ],
+ [
+ 'a malformed url',
+ JSON.stringify({version: '21.0.8+9', url: 'not-a-url'})
+ ],
+ [
+ 'a non-HTTPS signature url',
+ JSON.stringify({
+ version: '21.0.8+9',
+ url: 'https://example.com/a.tar.gz',
+ signatureUrl: 'http://example.com/a.sig'
+ })
+ ],
+ [
+ 'an unsupported checksum algorithm',
+ JSON.stringify({
+ version: '21.0.8+9',
+ url: 'https://example.com/a.tar.gz',
+ checksum: {algorithm: 'md5', value: 'abc'}
+ })
+ ],
+ [
+ 'a checksum without a value',
+ JSON.stringify({
+ version: '21.0.8+9',
+ url: 'https://example.com/a.tar.gz',
+ checksum: {algorithm: 'sha256'}
+ })
+ ]
+ ])('rejects an entry with %s', async (_name, contents) => {
+ createRunnerTemp();
+ restoreWith(contents, 'setup-java-jdkres-v2-old');
+
+ await expect(restoreJdkResolution(request)).resolves.toBeUndefined();
+ });
+
+ it('keeps the optional fields of a valid entry', async () => {
+ createRunnerTemp();
+ const full = {
+ version: '21.0.8+9',
+ url: 'https://example.com/a.tar.gz',
+ signatureUrl: 'https://example.com/a.sig',
+ checksum: {
+ algorithm: 'sha512',
+ value: 'def456',
+ source: 'https://example.com/a.sha512'
+ },
+ floating: true
+ };
+ restoreWith(JSON.stringify(full), 'setup-java-jdkres-v2-old');
+
+ const restored = await restoreJdkResolution(request);
+ expect(restored?.release).toEqual(full);
+ });
+
+ it('ignores unknown fields rather than passing them through', async () => {
+ createRunnerTemp();
+ restoreWith(
+ JSON.stringify({...release, evil: 'payload'}),
+ 'setup-java-jdkres-v2-old'
+ );
+
+ const restored = await restoreJdkResolution(request);
+ expect(restored?.release).toEqual(release);
+ });
+ });
+
+ describe('registerJdkResolution', () => {
+ it('writes the release and records it under the current bucket', () => {
+ createRunnerTemp();
+ registerJdkResolution(request, release);
+
+ const state = JSON.parse(
+ jest.mocked(core.saveState).mock.calls.at(-1)![1] as string
+ );
+ const entry = state.at(-1);
+ expect(entry.key.endsWith(bucket())).toBe(true);
+ expect(
+ JSON.parse(
+ fs.readFileSync(path.join(entry.path, 'release.json'), 'utf8')
+ )
+ ).toEqual(release);
+ });
+
+ it('does nothing when the cache service is unavailable', () => {
+ createRunnerTemp();
+ jest.mocked(cache.isFeatureAvailable).mockReturnValue(false);
+
+ registerJdkResolution(request, release);
+ expect(core.saveState).not.toHaveBeenCalled();
+ });
+
+ it('does nothing when RUNNER_TEMP is not set', () => {
+ delete process.env['RUNNER_TEMP'];
+
+ registerJdkResolution(request, release);
+ expect(core.saveState).not.toHaveBeenCalled();
+ });
+
+ it('uses different keys for different requests', () => {
+ createRunnerTemp();
+ registerJdkResolution(request, release);
+ registerJdkResolution({...request, distribution: 'zulu'}, release);
+
+ const state = JSON.parse(
+ jest.mocked(core.saveState).mock.calls.at(-1)![1] as string
+ );
+ expect(new Set(state.map((item: {key: string}) => item.key)).size).toBe(
+ state.length
+ );
+ });
+
+ it('uses different keys for different floating artifact identities', () => {
+ createRunnerTemp();
+ registerJdkResolution({...request, source: 'sha256:first'}, release);
+ registerJdkResolution({...request, source: 'sha256:second'}, release);
+
+ const state = JSON.parse(
+ jest.mocked(core.saveState).mock.calls.at(-1)![1] as string
+ );
+ expect(new Set(state.map((item: {key: string}) => item.key)).size).toBe(
+ state.length
+ );
+ });
+ });
+
+ describe('saveJdkResolutionCaches', () => {
+ const stateFor = (cachePath: string) =>
+ JSON.stringify([
+ {
+ key: 'setup-java-jdkres-v2-key',
+ path: cachePath,
+ release: JSON.stringify(release)
+ }
+ ]);
+
+ it('does nothing without state', async () => {
+ await saveJdkResolutionCaches();
+ expect(cache.saveCache).not.toHaveBeenCalled();
+ });
+
+ it('saves a recorded entry', async () => {
+ const root = createRunnerTemp();
+ jest.mocked(core.getState).mockReturnValue(stateFor(root));
+
+ await saveJdkResolutionCaches();
+ expect(cache.saveCache).toHaveBeenCalledWith(
+ [root],
+ 'setup-java-jdkres-v2-key'
+ );
+ });
+
+ it('saves the payload the key was computed for, not the file on disk', async () => {
+ const root = createRunnerTemp();
+ jest.mocked(core.getState).mockReturnValue(stateFor(root));
+ // A restore performed by a later step replaces the file behind the key.
+ fs.writeFileSync(
+ path.join(root, 'release.json'),
+ JSON.stringify({version: '8.0.1+1', url: 'https://example.com/stale'})
+ );
+
+ await saveJdkResolutionCaches();
+
+ expect(
+ JSON.parse(fs.readFileSync(path.join(root, 'release.json'), 'utf8'))
+ ).toEqual(release);
+ expect(cache.saveCache).toHaveBeenCalled();
+ });
+
+ it('does not fail the job when the payload cannot be written', async () => {
+ const root = createRunnerTemp();
+ const blocked = path.join(root, 'blocked');
+ fs.writeFileSync(blocked, 'not a directory');
+ jest.mocked(core.getState).mockReturnValue(stateFor(blocked));
+
+ await expect(saveJdkResolutionCaches()).resolves.toBeUndefined();
+ expect(cache.saveCache).not.toHaveBeenCalled();
+ });
+
+ it('does not fail the job when the save throws', async () => {
+ const root = createRunnerTemp();
+ jest.mocked(core.getState).mockReturnValue(stateFor(root));
+ jest
+ .mocked(cache.saveCache)
+ .mockRejectedValue(new Error('already reserved'));
+
+ await expect(saveJdkResolutionCaches()).resolves.toBeUndefined();
+ });
+
+ it('does not fail the job on invalid state', async () => {
+ jest.mocked(core.getState).mockReturnValue('{}');
+
+ await expect(saveJdkResolutionCaches()).resolves.toBeUndefined();
+ expect(cache.saveCache).not.toHaveBeenCalled();
+ });
+ });
+});
diff --git a/__tests__/latest-versions-report.test.ts b/__tests__/latest-versions-report.test.ts
new file mode 100644
index 000000000..1f2cba123
--- /dev/null
+++ b/__tests__/latest-versions-report.test.ts
@@ -0,0 +1,361 @@
+import {afterEach, describe, expect, it, jest} from '@jest/globals';
+import {HttpClient} from '@actions/http-client';
+import {JavaBase} from '../src/distributions/base-installer.js';
+import {
+ classifyResolutionError,
+ getDefaultVersions,
+ getSupportedArchitectures,
+ renderMarkdownReport,
+ ResolutionReport,
+ resolveLatestVersions,
+ VersionResolution
+} from '../src/reports/latest-versions.js';
+
+function result(
+ overrides: Partial &
+ Pick
+): VersionResolution {
+ return {
+ platform: 'linux',
+ architecture: 'x64',
+ status: 'resolved',
+ ...overrides
+ };
+}
+
+function report(
+ platform: string,
+ results: VersionResolution[]
+): ResolutionReport {
+ return {platform, generatedAt: '2026-11-18T06:30:00.000Z', results};
+}
+
+function tableRows(markdown: string, distribution: string): string[] {
+ const section = markdown.split(`## \`${distribution}\``)[1].split('\n## ')[0];
+ return section.split('\n').filter(line => /^\| (?!Platform|---)/.test(line));
+}
+
+describe('latest versions report', () => {
+ afterEach(() => {
+ jest.restoreAllMocks();
+ });
+
+ it('includes every major from Java 6 through GA, including non-LTS releases but not EA', async () => {
+ jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {
+ most_recent_feature_release: 27,
+ most_recent_feature_version: 28,
+ most_recent_lts: 25
+ }
+ });
+
+ await expect(getDefaultVersions(new HttpClient())).resolves.toEqual([
+ '6',
+ '7',
+ '8',
+ '9',
+ '10',
+ '11',
+ '12',
+ '13',
+ '14',
+ '15',
+ '16',
+ '17',
+ '18',
+ '19',
+ '20',
+ '21',
+ '22',
+ '23',
+ '24',
+ '25',
+ '26',
+ '27',
+ 'latest'
+ ]);
+ });
+
+ it('fails rather than publishing incomplete defaults when discovery fails', async () => {
+ jest
+ .spyOn(HttpClient.prototype, 'getJson')
+ .mockRejectedValue(new Error('Java release metadata is unavailable'));
+
+ await expect(getDefaultVersions(new HttpClient())).rejects.toThrow(
+ 'Java release metadata is unavailable'
+ );
+ });
+
+ it.each([5, 27.5, Infinity])(
+ 'rejects invalid newest major %s',
+ async major => {
+ jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: {most_recent_feature_release: major}
+ });
+
+ await expect(getDefaultVersions(new HttpClient())).rejects.toThrow(
+ 'Invalid newest Java feature release'
+ );
+ }
+ );
+
+ it('resolves Solaris metadata and combines its exact builds with every other platform', async () => {
+ const getJson = jest
+ .spyOn(HttpClient.prototype, 'getJson')
+ .mockResolvedValue({
+ statusCode: 200,
+ headers: {},
+ result: [
+ {
+ downloadUrl: 'https://example.com/solaris-jdk8-old.tar.gz',
+ version: '8.0.452+9',
+ featureVersion: 8,
+ interimVersion: 0,
+ updateVersion: 452,
+ buildVersion: 9
+ },
+ {
+ downloadUrl: 'https://example.com/solaris-jdk8.tar.gz',
+ version: '8.0.462+10',
+ featureVersion: 8,
+ interimVersion: 0,
+ updateVersion: 462,
+ buildVersion: 10
+ },
+ {
+ downloadUrl: 'https://example.com/solaris-jdk9.tar.gz',
+ version: '9.0.4+11',
+ featureVersion: 9,
+ interimVersion: 0,
+ updateVersion: 4,
+ buildVersion: 11
+ }
+ ]
+ });
+ const install = jest
+ .spyOn(JavaBase.prototype, 'setupJava')
+ .mockRejectedValue(new Error('The report must not install a JDK'));
+ const network = jest
+ .spyOn(HttpClient.prototype, 'request')
+ .mockRejectedValue(
+ new Error('Only the mocked metadata request is permitted')
+ );
+ const hostPlatform = process.platform;
+ const solaris = await resolveLatestVersions({
+ distributions: ['liberica'],
+ versions: ['8', '9', '11', 'latest'],
+ platform: 'solaris'
+ });
+
+ expect(solaris.platform).toBe('solaris');
+ expect(solaris.results).toEqual([
+ result({
+ distribution: 'liberica',
+ platform: 'solaris',
+ versionSpec: '8',
+ version: '8.0.462+10'
+ }),
+ result({
+ distribution: 'liberica',
+ platform: 'solaris',
+ versionSpec: '9',
+ version: '9.0.4+11'
+ }),
+ expect.objectContaining({
+ platform: 'solaris',
+ versionSpec: '11',
+ status: 'unavailable'
+ }),
+ result({
+ distribution: 'liberica',
+ platform: 'solaris',
+ versionSpec: 'latest',
+ version: '9.0.4+11'
+ })
+ ]);
+ expect(getJson).toHaveBeenCalledTimes(1);
+ const url = new URL(getJson.mock.calls[0][0]);
+ expect(url.origin).toBe('https://api.bell-sw.com');
+ expect(Object.fromEntries(url.searchParams)).toMatchObject({
+ os: 'solaris',
+ arch: 'x86',
+ bitness: '64',
+ 'bundle-type': 'jdk',
+ 'installation-type': 'archive'
+ });
+ expect(install).not.toHaveBeenCalled();
+ expect(network).not.toHaveBeenCalled();
+ expect(process.platform).toBe(hostPlatform);
+
+ const otherReports = ['linux', 'linux-musl', 'macos', 'windows'].map(
+ (platform, index) =>
+ report(
+ platform,
+ ['8', '9', '11', 'latest'].map(versionSpec =>
+ result({
+ distribution: 'liberica',
+ platform,
+ versionSpec,
+ version: `${versionSpec === 'latest' ? '11' : versionSpec}.0.1+${index + 1}`
+ })
+ )
+ )
+ );
+ const markdown = renderMarkdownReport([solaris, ...otherReports]);
+ expect(tableRows(markdown, 'liberica')).toEqual([
+ '| Linux x64 | `8.0.1+1` | `9.0.1+1` | `11.0.1+1` | `11.0.1+1` |',
+ '| Alpine Linux x64 | `8.0.1+2` | `9.0.1+2` | `11.0.1+2` | `11.0.1+2` |',
+ '| macOS x64 | `8.0.1+3` | `9.0.1+3` | `11.0.1+3` | `11.0.1+3` |',
+ '| Windows x64 | `8.0.1+4` | `9.0.1+4` | `11.0.1+4` | `11.0.1+4` |',
+ '| Solaris x64 | `8.0.462+10` | `9.0.4+11` | — | `9.0.4+11` |'
+ ]);
+ expect(markdown).not.toContain('Needs attention');
+ expect(markdown).not.toContain('Not checked');
+ });
+
+ it('classifies missing releases separately from lookup failures', () => {
+ const notFound = new Error("No matching version found for SemVer '8'.");
+ notFound.name = 'VersionNotFoundError';
+
+ expect(classifyResolutionError(notFound)).toBe('unavailable');
+ expect(
+ classifyResolutionError(
+ new Error('Oracle JDK is only supported for JDK 17 and later')
+ )
+ ).toBe('unavailable');
+ expect(
+ classifyResolutionError(
+ new Error(
+ 'No Kona release for the specified version "27" on OS "macos" and arch "aarch64".'
+ )
+ )
+ ).toBe('unavailable');
+ expect(classifyResolutionError(new Error('socket hang up'))).toBe('error');
+ });
+
+ it('resolves Alpine with the Linux architectures, including version-restricted ones', () => {
+ expect(getSupportedArchitectures('redhat', 'linux-musl')).toEqual([
+ 'x64',
+ 'aarch64',
+ 'ppc64le'
+ ]);
+ expect(getSupportedArchitectures('dragonwell', 'macos')).toEqual([]);
+ });
+
+ it('lists the exact version for every platform, ordered by operating system and architecture', () => {
+ const markdown = renderMarkdownReport([
+ report('macos', [
+ result({
+ distribution: 'temurin',
+ versionSpec: '21',
+ platform: 'macos',
+ architecture: 'aarch64',
+ version: '21.0.13+100000002.0.LTS'
+ })
+ ]),
+ report('linux', [
+ result({
+ distribution: 'temurin',
+ versionSpec: '21',
+ architecture: 's390x',
+ version: '21.0.12+7'
+ }),
+ result({
+ distribution: 'temurin',
+ versionSpec: '21',
+ version: '21.0.13+9'
+ })
+ ]),
+ report('linux-musl', [
+ result({
+ distribution: 'temurin',
+ versionSpec: '21',
+ platform: 'linux-musl',
+ version: '21.0.13+9'
+ })
+ ])
+ ]);
+
+ expect(tableRows(markdown, 'temurin')).toEqual([
+ '| Linux x64 | `21.0.13+9` |',
+ '| Linux s390x | `21.0.12+7` |',
+ '| Alpine Linux x64 | `21.0.13+9` |',
+ '| macOS aarch64 | `21.0.13+100000002.0.LTS` |'
+ ]);
+ expect(markdown).not.toContain('Needs attention');
+ expect(markdown).toContain(
+ 'Not checked, because no runner reported these platforms: Windows (x64, x86, aarch64).'
+ );
+ });
+
+ it('distinguishes unsupported, unpublished, and floating releases', () => {
+ const markdown = renderMarkdownReport([
+ report('linux', [
+ result({
+ distribution: 'redhat',
+ versionSpec: '11',
+ architecture: 'aarch64',
+ version: '11.0.29'
+ }),
+ result({
+ distribution: 'redhat',
+ versionSpec: '25',
+ architecture: 'aarch64',
+ status: 'unsupported'
+ }),
+ result({
+ distribution: 'oracle',
+ versionSpec: '11',
+ status: 'unavailable'
+ }),
+ result({
+ distribution: 'oracle',
+ versionSpec: '25',
+ version: '25',
+ floating: true,
+ advertisedVersion: '25.0.5.1',
+ publishedAt: '2026-10-27'
+ })
+ ])
+ ]);
+
+ expect(tableRows(markdown, 'redhat')).toEqual([
+ '| Linux aarch64 | `11.0.29` | n/a |'
+ ]);
+ expect(tableRows(markdown, 'oracle')).toEqual([
+ '| Linux x64 | — | `25.0.5.1` ¹ (published 2026-10-27) |'
+ ]);
+ expect(markdown).toContain('¹ Major-only requests download');
+ });
+
+ it('reports lookup errors and distributions that resolved nothing', () => {
+ const markdown = renderMarkdownReport([
+ report('linux', [
+ result({
+ distribution: 'oracle-openjdk',
+ versionSpec: '25',
+ status: 'unavailable'
+ }),
+ result({
+ distribution: 'zulu',
+ versionSpec: '25',
+ status: 'error',
+ message: 'socket hang up\nstack'
+ })
+ ])
+ ]);
+
+ expect(markdown).toContain('## `oracle-openjdk` ❗');
+ expect(tableRows(markdown, 'zulu')).toEqual(['| Linux x64 | ❗ error |']);
+ expect(markdown).toContain(
+ '| `oracle-openjdk` | all | all | No release matched any requested version'
+ );
+ expect(markdown).toContain(
+ '| `zulu` | `25` | Linux x64 | socket hang up |'
+ );
+ });
+});
diff --git a/__tests__/maven-args.test.ts b/__tests__/maven-args.test.ts
new file mode 100644
index 000000000..4ad6acd6c
--- /dev/null
+++ b/__tests__/maven-args.test.ts
@@ -0,0 +1,130 @@
+import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
+
+const mockGetInput = jest.fn<(...args: any[]) => any>();
+const mockExportVariable = jest.fn<(...args: any[]) => any>();
+const mockInfo = jest.fn<(...args: any[]) => any>();
+const mockDebug = jest.fn<(...args: any[]) => any>();
+const mockWarning = jest.fn<(...args: any[]) => any>();
+
+jest.unstable_mockModule('@actions/core', () => ({
+ getInput: mockGetInput,
+ exportVariable: mockExportVariable,
+ info: mockInfo,
+ debug: mockDebug,
+ warning: mockWarning,
+ setSecret: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ addPath: jest.fn(),
+ getMultilineInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getState: jest.fn(),
+ saveState: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn(),
+ isDebug: jest.fn(),
+ setCommandEcho: jest.fn(),
+ getIDToken: jest.fn(),
+ ExitCode: {Success: 0, Failure: 1},
+ summary: {},
+ markdownSummary: {},
+ platform: {},
+ toPosixPath: jest.fn(),
+ toWin32Path: jest.fn(),
+ toPlatformPath: jest.fn()
+}));
+
+const {configureMavenArgs} = await import('../src/maven-args.js');
+const {
+ INPUT_SHOW_DOWNLOAD_PROGRESS,
+ MAVEN_ARGS_ENV,
+ MAVEN_NO_TRANSFER_PROGRESS_FLAG
+} = await import('../src/constants.js');
+
+describe('configureMavenArgs', () => {
+ let inputs: Record;
+ const originalMavenArgs = process.env[MAVEN_ARGS_ENV];
+
+ beforeEach(() => {
+ inputs = {};
+
+ mockGetInput.mockImplementation((name: string) => inputs[name] ?? '');
+ mockExportVariable.mockImplementation((name: string, value: string) => {
+ process.env[name] = value;
+ });
+ mockInfo.mockImplementation(() => undefined);
+ mockDebug.mockImplementation(() => undefined);
+
+ delete process.env[MAVEN_ARGS_ENV];
+ });
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ if (originalMavenArgs === undefined) {
+ delete process.env[MAVEN_ARGS_ENV];
+ } else {
+ process.env[MAVEN_ARGS_ENV] = originalMavenArgs;
+ }
+ });
+
+ it('sets MAVEN_ARGS with -ntp by default', () => {
+ configureMavenArgs();
+
+ expect(mockExportVariable).toHaveBeenCalledWith(
+ MAVEN_ARGS_ENV,
+ MAVEN_NO_TRANSFER_PROGRESS_FLAG
+ );
+ expect(process.env[MAVEN_ARGS_ENV]).toBe(MAVEN_NO_TRANSFER_PROGRESS_FLAG);
+ });
+
+ it('does not modify MAVEN_ARGS when show-download-progress is true', () => {
+ inputs[INPUT_SHOW_DOWNLOAD_PROGRESS] = 'true';
+
+ configureMavenArgs();
+
+ expect(mockExportVariable).not.toHaveBeenCalled();
+ expect(process.env[MAVEN_ARGS_ENV]).toBeUndefined();
+ });
+
+ it('preserves an existing MAVEN_ARGS value and appends -ntp', () => {
+ process.env[MAVEN_ARGS_ENV] = '-B -Dstyle.color=always';
+
+ configureMavenArgs();
+
+ expect(mockExportVariable).toHaveBeenCalledWith(
+ MAVEN_ARGS_ENV,
+ `-B -Dstyle.color=always ${MAVEN_NO_TRANSFER_PROGRESS_FLAG}`
+ );
+ });
+
+ it('does not duplicate the flag when -ntp is already present', () => {
+ process.env[MAVEN_ARGS_ENV] = '-B -ntp';
+
+ configureMavenArgs();
+
+ expect(mockExportVariable).not.toHaveBeenCalled();
+ expect(process.env[MAVEN_ARGS_ENV]).toBe('-B -ntp');
+ });
+
+ it('does not duplicate the flag when --no-transfer-progress is already present', () => {
+ process.env[MAVEN_ARGS_ENV] = '--no-transfer-progress -B';
+
+ configureMavenArgs();
+
+ expect(mockExportVariable).not.toHaveBeenCalled();
+ expect(process.env[MAVEN_ARGS_ENV]).toBe('--no-transfer-progress -B');
+ });
+
+ it('keeps the existing MAVEN_ARGS when show-download-progress is true', () => {
+ inputs[INPUT_SHOW_DOWNLOAD_PROGRESS] = 'true';
+ process.env[MAVEN_ARGS_ENV] = '-B';
+
+ configureMavenArgs();
+
+ expect(mockExportVariable).not.toHaveBeenCalled();
+ expect(process.env[MAVEN_ARGS_ENV]).toBe('-B');
+ });
+});
diff --git a/__tests__/maven-xml-loading.test.ts b/__tests__/maven-xml-loading.test.ts
new file mode 100644
index 000000000..8f42e5461
--- /dev/null
+++ b/__tests__/maven-xml-loading.test.ts
@@ -0,0 +1,56 @@
+import {describe, expect, it, jest} from '@jest/globals';
+
+const mockXmlBuilderFactory = jest.fn();
+const mockParse = jest.fn(() => ({
+ toolchains: {
+ toolchain: [
+ {
+ type: 'foo',
+ provides: {id: 'custom'},
+ configuration: {fooHome: '/opt/foo'}
+ }
+ ]
+ }
+}));
+
+jest.unstable_mockModule('fast-xml-parser', () => {
+ mockXmlBuilderFactory();
+ return {
+ XMLParser: jest.fn().mockImplementation(() => ({
+ parse: mockParse
+ }))
+ };
+});
+
+const toolchains = await import('../src/toolchains.js');
+
+describe('Maven XML loading', () => {
+ it('does not load fast-xml-parser for new toolchains.xml generation', async () => {
+ const xml = await toolchains.generateToolchainDefinition(
+ '',
+ '21',
+ 'temurin',
+ 'temurin_21',
+ '/opt/java/21'
+ );
+
+ expect(xml).toContain('temurin_21');
+ expect(mockXmlBuilderFactory).not.toHaveBeenCalled();
+ expect(mockParse).not.toHaveBeenCalled();
+ });
+
+ it('loads fast-xml-parser for existing toolchains.xml merge generation', async () => {
+ await expect(
+ toolchains.generateToolchainDefinition(
+ 'foo',
+ '21',
+ 'temurin',
+ 'temurin_21',
+ '/opt/java/21'
+ )
+ ).resolves.toContain('temurin_21');
+
+ expect(mockXmlBuilderFactory).toHaveBeenCalledTimes(1);
+ expect(mockParse).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/__tests__/problem-matcher.test.ts b/__tests__/problem-matcher.test.ts
new file mode 100644
index 000000000..80258ec0b
--- /dev/null
+++ b/__tests__/problem-matcher.test.ts
@@ -0,0 +1,53 @@
+import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
+
+const mockGetInput = jest.fn<(...args: any[]) => any>();
+const mockInfo = jest.fn<(...args: any[]) => any>();
+const mockDebug = jest.fn<(...args: any[]) => any>();
+
+jest.unstable_mockModule('@actions/core', () => ({
+ getInput: mockGetInput,
+ info: mockInfo,
+ debug: mockDebug,
+ warning: jest.fn(),
+ setSecret: jest.fn()
+}));
+
+const {configureProblemMatcher} = await import('../src/problem-matcher.js');
+const {INPUT_PROBLEM_MATCHER} = await import('../src/constants.js');
+
+describe('configureProblemMatcher', () => {
+ let inputs: Record;
+
+ beforeEach(() => {
+ inputs = {};
+ mockGetInput.mockImplementation((name: string) => inputs[name] ?? '');
+ });
+
+ afterEach(() => {
+ jest.resetAllMocks();
+ });
+
+ it('does not register the Java problem matcher by default', () => {
+ configureProblemMatcher('/matchers/java.json');
+
+ expect(mockInfo).not.toHaveBeenCalled();
+ expect(mockDebug).toHaveBeenCalledWith('Java problem matcher is disabled');
+ });
+
+ it('registers the Java problem matcher when explicitly enabled', () => {
+ inputs[INPUT_PROBLEM_MATCHER] = 'true';
+
+ configureProblemMatcher('/matchers/java.json');
+
+ expect(mockInfo).toHaveBeenCalledWith('##[add-matcher]/matchers/java.json');
+ });
+
+ it('does not register the Java problem matcher when disabled', () => {
+ inputs[INPUT_PROBLEM_MATCHER] = 'false';
+
+ configureProblemMatcher('/matchers/java.json');
+
+ expect(mockInfo).not.toHaveBeenCalled();
+ expect(mockDebug).toHaveBeenCalledWith('Java problem matcher is disabled');
+ });
+});
diff --git a/__tests__/retrying-http-client.test.ts b/__tests__/retrying-http-client.test.ts
new file mode 100644
index 000000000..b9fb63db1
--- /dev/null
+++ b/__tests__/retrying-http-client.test.ts
@@ -0,0 +1,251 @@
+import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
+import type {IncomingMessage} from 'http';
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn()
+}));
+
+const core = await import('@actions/core');
+const httpm = await import('@actions/http-client');
+const {RetryingHttpClient, isRetryableNetworkError, parseRetryAfter} =
+ await import('../src/retrying-http-client.js');
+
+function response(
+ statusCode: number,
+ retryAfter?: string
+): httpm.HttpClientResponse {
+ return {
+ message: {
+ statusCode,
+ headers: retryAfter ? {'retry-after': retryAfter} : {}
+ } as IncomingMessage,
+ readBody: jest.fn(async () => '')
+ } as unknown as httpm.HttpClientResponse;
+}
+
+describe('RetryingHttpClient', () => {
+ let request: ReturnType;
+ let sleep: jest.Mock<(delayMs: number) => Promise>;
+
+ beforeEach(() => {
+ request = jest.spyOn(httpm.HttpClient.prototype, 'request');
+ sleep = jest.fn(async () => undefined);
+ });
+
+ afterEach(() => {
+ jest.restoreAllMocks();
+ jest.clearAllMocks();
+ });
+
+ it('uses exponential backoff with jitter for retryable responses', async () => {
+ request
+ .mockResolvedValueOnce(response(503))
+ .mockResolvedValueOnce(response(502))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0,
+ baseDelayMs: 1000,
+ maxDelayMs: 10000
+ });
+
+ await expect(client.get('https://example.com')).resolves.toBeDefined();
+
+ expect(request).toHaveBeenCalledTimes(3);
+ expect(sleep).toHaveBeenNthCalledWith(1, 500);
+ expect(sleep).toHaveBeenNthCalledWith(2, 1000);
+ expect(core.info).toHaveBeenNthCalledWith(
+ 1,
+ 'Request attempt 1 of 4 failed (HTTP 503); retrying in 500 ms'
+ );
+ expect(core.info).toHaveBeenNthCalledWith(
+ 2,
+ 'Request attempt 2 of 4 failed (HTTP 502); retrying in 1000 ms'
+ );
+ });
+
+ it('honors Retry-After delta-seconds over the client delay', async () => {
+ request
+ .mockResolvedValueOnce(response(429, '3'))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0
+ });
+
+ await client.get('https://example.com');
+
+ expect(sleep).toHaveBeenCalledWith(3000);
+ });
+
+ it('honors Retry-After HTTP dates over the client delay', async () => {
+ const now = Date.parse('2026-07-29T00:00:00Z');
+ request
+ .mockResolvedValueOnce(response(503, new Date(now + 5000).toUTCString()))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0,
+ now: () => now
+ });
+
+ await client.get('https://example.com');
+
+ expect(sleep).toHaveBeenCalledWith(5000);
+ });
+
+ it('caps Retry-After at the configured maximum delay', async () => {
+ request
+ .mockResolvedValueOnce(response(429, '60'))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0,
+ maxDelayMs: 10000
+ });
+
+ await client.get('https://example.com');
+
+ expect(sleep).toHaveBeenCalledWith(10000);
+ });
+
+ it.each([429, 502, 503, 504, 522])(
+ 'retries HTTP %s responses',
+ async statusCode => {
+ request
+ .mockResolvedValueOnce(response(statusCode))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0
+ });
+
+ await client.get('https://example.com');
+
+ expect(request).toHaveBeenCalledTimes(2);
+ }
+ );
+
+ it.each(['ETIMEDOUT', 'ECONNRESET', 'ENOTFOUND', 'ECONNREFUSED'])(
+ 'retries network errors with code %s',
+ async code => {
+ request
+ .mockRejectedValueOnce(Object.assign(new Error(code), {code}))
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0
+ });
+
+ await client.get('https://example.com');
+
+ expect(request).toHaveBeenCalledTimes(2);
+ }
+ );
+
+ it('retries retryable aggregate network errors', async () => {
+ const aggregateError = Object.assign(new Error('connection failed'), {
+ errors: [Object.assign(new Error('timed out'), {code: 'ETIMEDOUT'})]
+ });
+ request
+ .mockRejectedValueOnce(aggregateError)
+ .mockResolvedValueOnce(response(200));
+ const client = new RetryingHttpClient('test', {
+ sleep,
+ random: () => 0
+ });
+
+ await client.get('https://example.com');
+
+ expect(request).toHaveBeenCalledTimes(2);
+ expect(sleep).toHaveBeenCalledWith(500);
+ });
+
+ it('does not retry non-retryable responses or network errors', async () => {
+ request.mockResolvedValueOnce(response(500));
+ const client = new RetryingHttpClient('test', {sleep});
+
+ await expect(client.get('https://example.com')).resolves.toBeDefined();
+ expect(request).toHaveBeenCalledTimes(1);
+ expect(sleep).not.toHaveBeenCalled();
+
+ request.mockRejectedValueOnce(
+ Object.assign(new Error('certificate failed'), {code: 'CERT_HAS_EXPIRED'})
+ );
+ await expect(client.get('https://example.com')).rejects.toThrow(
+ 'certificate failed'
+ );
+ expect(request).toHaveBeenCalledTimes(2);
+ expect(sleep).not.toHaveBeenCalled();
+ });
+
+ it('stops after the configured total attempt count', async () => {
+ request
+ .mockResolvedValueOnce(response(503))
+ .mockResolvedValueOnce(response(503));
+ const client = new RetryingHttpClient('test', {
+ maxAttempts: 2,
+ sleep,
+ random: () => 0
+ });
+
+ const finalResponse = await client.get('https://example.com');
+
+ expect(finalResponse.message.statusCode).toBe(503);
+ expect(request).toHaveBeenCalledTimes(2);
+ expect(sleep).toHaveBeenCalledTimes(1);
+ });
+
+ it('propagates the final network error after exhausting attempts', async () => {
+ const finalError = Object.assign(new Error('still unavailable'), {
+ code: 'ECONNREFUSED'
+ });
+ request
+ .mockRejectedValueOnce(
+ Object.assign(new Error('unavailable'), {code: 'ECONNREFUSED'})
+ )
+ .mockRejectedValueOnce(finalError);
+ const client = new RetryingHttpClient('test', {
+ maxAttempts: 2,
+ sleep,
+ random: () => 0
+ });
+
+ await expect(client.get('https://example.com')).rejects.toBe(finalError);
+
+ expect(request).toHaveBeenCalledTimes(2);
+ expect(sleep).toHaveBeenCalledTimes(1);
+ });
+
+ it('does not retry write requests', async () => {
+ request.mockResolvedValueOnce(response(503));
+ const client = new RetryingHttpClient('test', {sleep});
+
+ await client.post('https://example.com', '{}');
+
+ expect(request).toHaveBeenCalledTimes(1);
+ expect(sleep).not.toHaveBeenCalled();
+ });
+});
+
+describe('retry classification', () => {
+ it('parses valid Retry-After values and ignores invalid or past values', () => {
+ const now = Date.parse('2026-07-29T00:00:00Z');
+
+ expect(parseRetryAfter('7', now)).toBe(7000);
+ expect(parseRetryAfter(new Date(now + 3000).toUTCString(), now)).toBe(3000);
+ expect(parseRetryAfter(new Date(now - 3000).toUTCString(), now)).toBe(
+ undefined
+ );
+ expect(parseRetryAfter('not-a-date', now)).toBe(undefined);
+ });
+
+ it('recognizes direct and nested retryable network error codes', () => {
+ expect(isRetryableNetworkError({code: 'ECONNRESET'})).toBe(true);
+ expect(
+ isRetryableNetworkError({errors: [{code: 'ENOTFOUND'}, {code: 'OTHER'}]})
+ ).toBe(true);
+ expect(isRetryableNetworkError({code: 'CERT_HAS_EXPIRED'})).toBe(false);
+ expect(isRetryableNetworkError(new Error('unknown'))).toBe(false);
+ });
+});
diff --git a/__tests__/setup-java.module-loading.test.ts b/__tests__/setup-java.module-loading.test.ts
new file mode 100644
index 000000000..e8c1e7d2e
--- /dev/null
+++ b/__tests__/setup-java.module-loading.test.ts
@@ -0,0 +1,121 @@
+import {jest, describe, it, expect, beforeEach} from '@jest/globals';
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((value: string) => value),
+ toWin32Path: jest.fn((value: string) => value),
+ toPosixPath: jest.fn((value: string) => value)
+}));
+
+jest.unstable_mockModule('fs', () => ({
+ default: {
+ ...jest.requireActual('fs'),
+ readFileSync: jest.fn()
+ }
+}));
+
+jest.unstable_mockModule('../src/util.js', () => ({
+ getBooleanInput: jest.fn(),
+ getVersionFromFileContent: jest.fn(),
+ isJdkCacheEnabled: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/toolchains.js', () => ({
+ validateToolchainIds: jest.fn(),
+ configureToolchains: jest.fn()
+}));
+
+jest.unstable_mockModule(
+ '../src/distributions/distribution-factory.js',
+ () => ({
+ getJavaDistribution: jest.fn()
+ })
+);
+
+jest.unstable_mockModule('../src/auth.js', () => ({
+ configureAuthentication: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/maven-args.js', () => ({
+ configureMavenArgs: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/problem-matcher.js', () => ({
+ configureProblemMatcher: jest.fn()
+}));
+
+// These modules should never be imported when `cache` input is empty.
+jest.unstable_mockModule('../src/cache-feature.js', () => {
+ throw new Error('cache-feature module should not be loaded');
+});
+jest.unstable_mockModule('../src/cache.js', () => {
+ throw new Error('cache module should not be loaded');
+});
+
+const core = await import('@actions/core');
+const util = await import('../src/util.js');
+const toolchains = await import('../src/toolchains.js');
+const factory = await import('../src/distributions/distribution-factory.js');
+const {run} = await import('../src/setup-java.js');
+
+describe('setup-java conditional module loading', () => {
+ const inputs = new Map();
+ const multilineInputs = new Map();
+ const booleanInputs = new Map();
+
+ beforeEach(() => {
+ jest.resetAllMocks();
+ inputs.clear();
+ multilineInputs.clear();
+ booleanInputs.clear();
+
+ (core.getInput as jest.Mock).mockImplementation((name: unknown) => {
+ return inputs.get(name as string) ?? '';
+ });
+ (core.getMultilineInput as jest.Mock).mockImplementation(
+ (name: unknown) => {
+ return multilineInputs.get(name as string) ?? [];
+ }
+ );
+ (util.getBooleanInput as jest.Mock).mockImplementation(
+ (name: unknown, defaultValue: unknown) => {
+ return booleanInputs.get(name as string) ?? defaultValue;
+ }
+ );
+ (util.isJdkCacheEnabled as jest.Mock).mockReturnValue(false);
+ (toolchains.configureToolchains as jest.Mock).mockResolvedValue(undefined);
+ });
+
+ it('does not import cache modules when cache input is not provided', async () => {
+ inputs.set('distribution', 'temurin');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockResolvedValue({
+ setupJava: jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }))
+ });
+
+ await run();
+
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+});
diff --git a/__tests__/setup-java.test.ts b/__tests__/setup-java.test.ts
new file mode 100644
index 000000000..c75ead639
--- /dev/null
+++ b/__tests__/setup-java.test.ts
@@ -0,0 +1,720 @@
+import {jest, describe, it, expect, beforeEach} from '@jest/globals';
+
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((value: string) => value),
+ toWin32Path: jest.fn((value: string) => value),
+ toPosixPath: jest.fn((value: string) => value)
+}));
+
+jest.unstable_mockModule('fs', () => ({
+ default: {
+ ...jest.requireActual('fs'),
+ readFileSync: jest.fn()
+ }
+}));
+
+jest.unstable_mockModule('../src/util.js', () => ({
+ getBooleanInput: jest.fn(),
+ getVersionFromFileContent: jest.fn(),
+ isJdkCacheEnabled: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/toolchains.js', () => ({
+ validateToolchainIds: jest.fn(),
+ configureToolchains: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/toolchain-ids.js', () => ({
+ validateToolchainIds: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/cache.js', () => ({
+ restore: jest.fn(),
+ validatePackageManager: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/cache-feature.js', () => ({
+ isCacheFeatureAvailable: jest.fn()
+}));
+
+jest.unstable_mockModule(
+ '../src/distributions/distribution-factory.js',
+ () => ({
+ getJavaDistribution: jest.fn()
+ })
+);
+
+jest.unstable_mockModule('../src/auth.js', () => ({
+ configureAuthentication: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/maven-args.js', () => ({
+ configureMavenArgs: jest.fn()
+}));
+
+jest.unstable_mockModule('../src/problem-matcher.js', () => ({
+ configureProblemMatcher: jest.fn()
+}));
+
+const core = await import('@actions/core');
+const fs = (await import('fs')).default;
+const util = await import('../src/util.js');
+const toolchains = await import('../src/toolchains.js');
+const toolchainIds = await import('../src/toolchain-ids.js');
+const cache = await import('../src/cache.js');
+const cacheFeature = await import('../src/cache-feature.js');
+const factory = await import('../src/distributions/distribution-factory.js');
+const auth = await import('../src/auth.js');
+const mavenArgs = await import('../src/maven-args.js');
+const problemMatcher = await import('../src/problem-matcher.js');
+const {run} = await import('../src/setup-java.js');
+
+const inputCallsOnImport = (core.getInput as jest.Mock).mock.calls.length;
+const multilineInputCallsOnImport = (core.getMultilineInput as jest.Mock).mock
+ .calls.length;
+
+describe('setup action orchestration', () => {
+ const inputs = new Map();
+ const multilineInputs = new Map();
+ const booleanInputs = new Map();
+
+ beforeEach(() => {
+ jest.resetAllMocks();
+ inputs.clear();
+ multilineInputs.clear();
+ booleanInputs.clear();
+
+ (core.getInput as jest.Mock).mockImplementation((name: unknown) => {
+ return inputs.get(name as string) ?? '';
+ });
+ (core.getMultilineInput as jest.Mock).mockImplementation(
+ (name: unknown) => {
+ return multilineInputs.get(name as string) ?? [];
+ }
+ );
+ (util.getBooleanInput as jest.Mock).mockImplementation(
+ (name: unknown, defaultValue: unknown) => {
+ return booleanInputs.get(name as string) ?? defaultValue;
+ }
+ );
+ (util.isJdkCacheEnabled as jest.Mock).mockImplementation(
+ (cache: string) => {
+ const explicit = inputs.get('cache-jdk');
+ return explicit
+ ? (booleanInputs.get('cache-jdk') ?? explicit === 'true')
+ : Boolean(cache);
+ }
+ );
+ (cacheFeature.isCacheFeatureAvailable as jest.Mock).mockReturnValue(true);
+ (toolchainIds.validateToolchainIds as jest.Mock).mockImplementation(
+ () => undefined
+ );
+ (toolchains.configureToolchains as jest.Mock).mockResolvedValue(undefined);
+ (auth.configureAuthentication as jest.Mock).mockResolvedValue(undefined);
+ (cache.restore as jest.Mock).mockResolvedValue(undefined);
+ (cache.validatePackageManager as jest.Mock).mockImplementation(
+ () => undefined
+ );
+ });
+
+ it('does not execute the action when imported', () => {
+ expect(inputCallsOnImport).toBe(0);
+ expect(multilineInputCallsOnImport).toBe(0);
+ });
+
+ it('requires java-version or java-version-file', async () => {
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'java-version or java-version-file input expected'
+ );
+ expect(factory.getJavaDistribution).not.toHaveBeenCalled();
+ expect(problemMatcher.configureProblemMatcher).not.toHaveBeenCalled();
+ });
+
+ it('requires distribution when java-version is provided', async () => {
+ multilineInputs.set('java-version', ['21']);
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'distribution input is required'
+ );
+ 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 () => {
+ inputs.set('java-version-file', '.java-version');
+ (fs.readFileSync as jest.Mock).mockReturnValue(Buffer.from('21'));
+ (util.getVersionFromFileContent as jest.Mock).mockReturnValue({
+ version: '21'
+ });
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'distribution input is required when not specified in the version file'
+ );
+ expect(factory.getJavaDistribution).not.toHaveBeenCalled();
+ });
+
+ it('fails when the version file has no supported version', async () => {
+ inputs.set('java-version-file', '.java-version');
+ inputs.set('distribution', 'temurin');
+ (fs.readFileSync as jest.Mock).mockReturnValue(Buffer.from('invalid'));
+ (util.getVersionFromFileContent as jest.Mock).mockReturnValue(undefined);
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'No supported version was found in file .java-version'
+ );
+ expect(factory.getJavaDistribution).not.toHaveBeenCalled();
+ });
+
+ it('uses the distribution inferred from a version file', async () => {
+ inputs.set('java-version-file', '.sdkmanrc');
+ inputs.set('architecture', 'x64');
+ inputs.set('java-package', 'jdk');
+ inputs.set('distribution', 'zulu');
+ inputs.set('jdk-file', '/tmp/java.tar.gz');
+ multilineInputs.set('mvn-toolchain-id', ['file-jdk']);
+ booleanInputs.set('check-latest', true);
+ booleanInputs.set('force-download', true);
+ booleanInputs.set('set-default', false);
+ inputs.set('verify-signature-public-key', 'public-key');
+ (fs.readFileSync as jest.Mock).mockReturnValue(
+ Buffer.from('java=21.0.5-tem')
+ );
+ (util.getVersionFromFileContent as jest.Mock).mockReturnValue({
+ version: '21.0.5',
+ distribution: 'temurin'
+ });
+ const setupJava = jest.fn(async () => ({
+ version: '21.0.5+11',
+ path: '/opt/java/21'
+ }));
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({setupJava});
+
+ await run();
+
+ expect(util.getVersionFromFileContent).toHaveBeenCalledWith(
+ 'java=21.0.5-tem',
+ 'zulu',
+ '.sdkmanrc'
+ );
+ expect(factory.getJavaDistribution).toHaveBeenCalledWith(
+ 'temurin',
+ {
+ version: '21.0.5',
+ architecture: 'x64',
+ packageType: 'jdk',
+ checkLatest: true,
+ forceDownload: true,
+ cacheJdk: false,
+ setDefault: false,
+ verifySignature: undefined,
+ verifySignaturePublicKey: 'public-key'
+ },
+ '/tmp/java.tar.gz'
+ );
+ expect(toolchainIds.validateToolchainIds).toHaveBeenCalledWith(
+ [],
+ '.sdkmanrc',
+ ['file-jdk']
+ );
+ expect(toolchains.configureToolchains).toHaveBeenCalledWith(
+ '21.0.5',
+ 'temurin',
+ '/opt/java/21',
+ 'file-jdk'
+ );
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+
+ it('installs multiple JDKs in order with matching toolchain IDs', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('architecture', 'x64');
+ inputs.set('java-package', 'jdk');
+ multilineInputs.set('java-version', ['17', '21']);
+ multilineInputs.set('mvn-toolchain-id', ['java-17', 'java-21']);
+
+ const setupJava17 = jest.fn(async () => ({
+ version: '17.0.12+7',
+ path: '/opt/java/17'
+ }));
+ const setupJava21 = jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }));
+ (factory.getJavaDistribution as jest.Mock)
+ .mockReturnValueOnce({setupJava: setupJava17})
+ .mockReturnValueOnce({setupJava: setupJava21});
+
+ await run();
+
+ expect(factory.getJavaDistribution).toHaveBeenNthCalledWith(
+ 1,
+ 'temurin',
+ expect.objectContaining({version: '17'}),
+ ''
+ );
+ expect(factory.getJavaDistribution).toHaveBeenNthCalledWith(
+ 2,
+ 'temurin',
+ expect.objectContaining({version: '21'}),
+ ''
+ );
+ expect(toolchains.configureToolchains).toHaveBeenNthCalledWith(
+ 1,
+ '17',
+ 'temurin',
+ '/opt/java/17',
+ 'java-17'
+ );
+ expect(toolchains.configureToolchains).toHaveBeenNthCalledWith(
+ 2,
+ '21',
+ 'temurin',
+ '/opt/java/21',
+ 'java-21'
+ );
+ expect(setupJava17.mock.invocationCallOrder[0]).toBeLessThan(
+ setupJava21.mock.invocationCallOrder[0]
+ );
+ });
+
+ it('uses the resolved version for the latest Maven toolchain', async () => {
+ inputs.set('distribution', 'temurin');
+ multilineInputs.set('java-version', ['latest']);
+ const setupJava = jest.fn(async () => ({
+ version: '24.0.2+12',
+ path: '/opt/java/24'
+ }));
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({setupJava});
+
+ await run();
+
+ expect(toolchains.configureToolchains).toHaveBeenCalledWith(
+ '24.0.2+12',
+ 'temurin',
+ '/opt/java/24',
+ undefined
+ );
+ });
+
+ it('starts cache restoration before post-install steps and awaits it before finishing', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'maven');
+ inputs.set('cache-dependency-path', '**/pom.xml');
+ multilineInputs.set('java-version', ['21']);
+ multilineInputs.set('cache-path', [
+ '/custom/maven/repository',
+ '!/custom/maven/repository/excluded'
+ ]);
+ const cacheRestore = deferred();
+ let resolveSetupJava: (() => void) | undefined;
+ const setupJava = jest.fn(
+ () =>
+ new Promise<{version: string; path: string}>(resolve => {
+ resolveSetupJava = () =>
+ resolve({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ });
+ })
+ );
+ (cache.restore as jest.Mock).mockReturnValue(cacheRestore.promise);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({setupJava});
+
+ const runPromise = run();
+ try {
+ await tick();
+
+ expect(cacheFeature.isCacheFeatureAvailable).toHaveBeenCalled();
+ expect(cache.restore).toHaveBeenCalledWith('maven', '**/pom.xml', [
+ '/custom/maven/repository',
+ '!/custom/maven/repository/excluded'
+ ]);
+ expect(toolchains.configureToolchains).not.toHaveBeenCalled();
+
+ resolveSetupJava?.();
+ await tick();
+ expect(problemMatcher.configureProblemMatcher).toHaveBeenCalledWith(
+ expect.stringMatching(/\.github[/\\]java\.json$/)
+ );
+
+ expect(
+ (problemMatcher.configureProblemMatcher as jest.Mock).mock
+ .invocationCallOrder[0]
+ ).toBeLessThan(
+ (auth.configureAuthentication as jest.Mock).mock.invocationCallOrder[0]
+ );
+ expect(
+ (problemMatcher.configureProblemMatcher as jest.Mock).mock
+ .invocationCallOrder[0]
+ ).toBeLessThan(
+ (toolchains.configureToolchains as jest.Mock).mock
+ .invocationCallOrder[0]
+ );
+ expect(
+ (auth.configureAuthentication as jest.Mock).mock.invocationCallOrder[0]
+ ).toBeLessThan(
+ (mavenArgs.configureMavenArgs as jest.Mock).mock.invocationCallOrder[0]
+ );
+ expect(
+ (toolchains.configureToolchains as jest.Mock).mock
+ .invocationCallOrder[0]
+ ).toBeLessThan(
+ (mavenArgs.configureMavenArgs as jest.Mock).mock.invocationCallOrder[0]
+ );
+
+ let completed = false;
+ runPromise.then(() => {
+ completed = true;
+ });
+ await tick();
+ expect(completed).toBe(false);
+ } finally {
+ resolveSetupJava?.();
+ cacheRestore.resolve();
+ await runPromise;
+ }
+
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+
+ it('overlaps independent Maven settings and toolchains configuration', async () => {
+ inputs.set('distribution', 'temurin');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }))
+ });
+ const authentication = deferred();
+ const toolchainConfiguration = deferred();
+ (auth.configureAuthentication as jest.Mock).mockReturnValue(
+ authentication.promise
+ );
+ (toolchains.configureToolchains as jest.Mock).mockReturnValue(
+ toolchainConfiguration.promise
+ );
+
+ const runPromise = run();
+ try {
+ await tick();
+ await tick();
+
+ expect(auth.configureAuthentication).toHaveBeenCalled();
+ expect(toolchains.configureToolchains).toHaveBeenCalledWith(
+ '21',
+ 'temurin',
+ '/opt/java/21',
+ undefined
+ );
+ expect(mavenArgs.configureMavenArgs).not.toHaveBeenCalled();
+
+ authentication.resolve();
+ await tick();
+ expect(mavenArgs.configureMavenArgs).not.toHaveBeenCalled();
+
+ toolchainConfiguration.resolve();
+ await runPromise;
+ } finally {
+ authentication.resolve();
+ toolchainConfiguration.resolve();
+ await runPromise;
+ }
+
+ expect(mavenArgs.configureMavenArgs).toHaveBeenCalled();
+ expect(core.setFailed).not.toHaveBeenCalled();
+ });
+
+ it('skips cache restoration when the cache feature is unavailable', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'maven');
+ multilineInputs.set('java-version', ['21']);
+ (cacheFeature.isCacheFeatureAvailable as jest.Mock).mockReturnValue(false);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }))
+ });
+
+ await run();
+
+ expect(cache.restore).not.toHaveBeenCalled();
+ });
+
+ it('does not initialize cache modules when cache input is absent', async () => {
+ inputs.set('distribution', 'temurin');
+ multilineInputs.set('java-version', ['21']);
+ booleanInputs.set('cache-jdk', false);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }))
+ });
+
+ await run();
+
+ expect(cacheFeature.isCacheFeatureAvailable).not.toHaveBeenCalled();
+ expect(cache.restore).not.toHaveBeenCalled();
+ expect(factory.getJavaDistribution).toHaveBeenCalledWith(
+ 'temurin',
+ expect.objectContaining({cacheJdk: false}),
+ ''
+ );
+ });
+
+ it('fails invalid cache input before resolving a Java distribution', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'ant');
+ multilineInputs.set('java-version', ['21']);
+ const setupJava = jest.fn();
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({setupJava});
+ (cache.validatePackageManager as jest.Mock).mockImplementation(() => {
+ throw new Error('unknown package manager specified: ant');
+ });
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'unknown package manager specified: ant'
+ );
+ expect(factory.getJavaDistribution).not.toHaveBeenCalled();
+ expect(setupJava).not.toHaveBeenCalled();
+ expect(cache.restore).not.toHaveBeenCalled();
+ });
+
+ it('reports missing java-version before validating the cache input', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'ant');
+ (cache.validatePackageManager as jest.Mock).mockImplementation(() => {
+ throw new Error('unknown package manager specified: ant');
+ });
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'java-version or java-version-file input expected'
+ );
+ expect(cache.validatePackageManager).not.toHaveBeenCalled();
+ });
+
+ it.each([
+ ['', '', false],
+ ['', 'true', true],
+ ['', 'false', false],
+ ['maven', '', true],
+ ['maven', 'true', true],
+ ['maven', 'false', false]
+ ])(
+ 'passes effective JDK caching for cache=%j and cache-jdk=%j',
+ async (cacheInput, cacheJdkInput, expected) => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', cacheInput);
+ inputs.set('cache-jdk', cacheJdkInput);
+ multilineInputs.set('java-version', ['21']);
+ if (cacheJdkInput) {
+ booleanInputs.set('cache-jdk', cacheJdkInput === 'true');
+ }
+ (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(
+ 'temurin',
+ expect.objectContaining({cacheJdk: expected}),
+ ''
+ );
+ }
+ );
+
+ it('reports unsupported distributions through core.setFailed', async () => {
+ inputs.set('distribution', 'unsupported');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue(null);
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith(
+ 'No supported distribution was found for input unsupported'
+ );
+ expect(toolchains.configureToolchains).not.toHaveBeenCalled();
+ expect(problemMatcher.configureProblemMatcher).not.toHaveBeenCalled();
+ });
+
+ it('reports collaborator failures and stops post-install configuration', async () => {
+ inputs.set('distribution', 'temurin');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => {
+ throw new Error('download failed');
+ })
+ });
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith('download failed');
+ expect(toolchains.configureToolchains).not.toHaveBeenCalled();
+ expect(problemMatcher.configureProblemMatcher).not.toHaveBeenCalled();
+ expect(auth.configureAuthentication).not.toHaveBeenCalled();
+ expect(mavenArgs.configureMavenArgs).not.toHaveBeenCalled();
+ expect(cache.restore).not.toHaveBeenCalled();
+ });
+
+ it('reports post-install failures and skips later collaborators', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'maven');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => ({
+ version: '21.0.4+7',
+ path: '/opt/java/21'
+ }))
+ });
+ (auth.configureAuthentication as jest.Mock).mockRejectedValue(
+ new Error('authentication failed')
+ );
+
+ await run();
+
+ expect(problemMatcher.configureProblemMatcher).toHaveBeenCalled();
+ expect(core.setFailed).toHaveBeenCalledWith('authentication failed');
+ expect(mavenArgs.configureMavenArgs).not.toHaveBeenCalled();
+ expect(cache.restore).toHaveBeenCalled();
+ });
+
+ it('keeps Java setup errors deterministic when cache restore also fails', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'maven');
+ multilineInputs.set('java-version', ['21']);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({
+ setupJava: jest.fn(async () => {
+ throw new Error('download failed');
+ })
+ });
+ (cache.restore as jest.Mock).mockRejectedValue(
+ new Error('cache restore failed')
+ );
+
+ await run();
+
+ expect(core.setFailed).toHaveBeenCalledWith('download failed');
+ });
+
+ it('observes cache failures while Java setup is still pending', async () => {
+ inputs.set('distribution', 'temurin');
+ inputs.set('cache', 'maven');
+ multilineInputs.set('java-version', ['21']);
+ const javaSetup = deferred<{version: string; path: string}>();
+ const setupJava = jest.fn(() => javaSetup.promise);
+ (factory.getJavaDistribution as jest.Mock).mockReturnValue({setupJava});
+ const cacheRestore = deferred();
+ const cacheRestoreCalled = deferred();
+ (cache.restore as jest.Mock).mockImplementation(() => {
+ cacheRestoreCalled.resolve();
+ return cacheRestore.promise;
+ });
+ const unhandledRejections: unknown[] = [];
+ const onUnhandledRejection = (reason: unknown) => {
+ unhandledRejections.push(reason);
+ };
+ process.on('unhandledRejection', onUnhandledRejection);
+
+ const runPromise = run();
+ try {
+ // Only reject once the restore has actually started and while the Java
+ // installation is still pending, so the unfixed code would leave the
+ // rejection unhandled.
+ await cacheRestoreCalled.promise;
+ cacheRestore.reject(new Error('cache restore failed'));
+ await tick();
+
+ expect(setupJava).toHaveBeenCalled();
+ expect(unhandledRejections).toEqual([]);
+ expect(core.setFailed).not.toHaveBeenCalled();
+ } finally {
+ javaSetup.resolve({version: '21.0.4+7', path: '/opt/java/21'});
+ await runPromise;
+ process.off('unhandledRejection', onUnhandledRejection);
+ }
+
+ expect(unhandledRejections).toEqual([]);
+ expect(core.setFailed).toHaveBeenCalledWith('cache restore failed');
+ });
+});
+
+function deferred() {
+ let resolve!: (value: T | PromiseLike) => void;
+ let reject!: (reason?: unknown) => void;
+ const promise = new Promise((res, rej) => {
+ resolve = res;
+ reject = rej;
+ });
+ return {promise, resolve, reject};
+}
+
+async function tick() {
+ await new Promise(resolve => setTimeout(resolve, 0));
+}
diff --git a/__tests__/toolchains.test.ts b/__tests__/toolchains.test.ts
index 483077dc1..ea5248629 100644
--- a/__tests__/toolchains.test.ts
+++ b/__tests__/toolchains.test.ts
@@ -1,23 +1,64 @@
+import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterEach,
+ beforeAll,
+ afterAll
+} from '@jest/globals';
+import {fileURLToPath} from 'url';
import * as fs from 'fs';
import os from 'os';
import * as path from 'path';
-import * as core from '@actions/core';
import * as io from '@actions/io';
-import * as toolchains from '../src/toolchains';
-import {M2_DIR, MVN_TOOLCHAINS_FILE} from '../src/constants';
+import {XMLParser} from 'fast-xml-parser';
+// Mock @actions/core before importing source modules that depend on it
+jest.unstable_mockModule('@actions/core', () => ({
+ info: jest.fn(),
+ warning: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ setFailed: jest.fn(),
+ setOutput: jest.fn(),
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+// Dynamic imports after mocking
+const core = await import('@actions/core');
+const toolchains = await import('../src/toolchains.js');
+const {M2_DIR, MVN_TOOLCHAINS_FILE} = await import('../src/constants.js');
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
const m2Dir = path.join(__dirname, M2_DIR);
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
describe('toolchains tests', () => {
- let spyOSHomedir: jest.SpyInstance;
- let spyInfo: jest.SpyInstance;
+ let spyOSHomedir: any;
+ let spyInfo: any;
beforeEach(async () => {
await io.rmRF(m2Dir);
spyOSHomedir = jest.spyOn(os, 'homedir');
spyOSHomedir.mockReturnValue(__dirname);
- spyInfo = jest.spyOn(core, 'info');
+ spyInfo = core.info as jest.Mock;
spyInfo.mockImplementation(() => null);
}, 300000);
@@ -46,8 +87,7 @@ describe('toolchains tests', () => {
await toolchains.createToolchainsSettings({
jdkInfo,
- settingsDirectory: altHome,
- overwriteSettings: true
+ settingsDirectory: altHome
});
expect(fs.existsSync(m2Dir)).toBe(false);
@@ -56,7 +96,7 @@ describe('toolchains tests', () => {
expect(fs.existsSync(altHome)).toBe(true);
expect(fs.existsSync(altToolchainsFile)).toBe(true);
expect(fs.readFileSync(altToolchainsFile, 'utf-8')).toEqual(
- toolchains.generateToolchainDefinition(
+ await toolchains.generateToolchainDefinition(
'',
jdkInfo.version,
jdkInfo.vendor,
@@ -95,14 +135,13 @@ describe('toolchains tests', () => {
await toolchains.createToolchainsSettings({
jdkInfo,
- settingsDirectory: m2Dir,
- overwriteSettings: true
+ settingsDirectory: m2Dir
});
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(toolchainsFile)).toBe(true);
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
- toolchains.generateToolchainDefinition(
+ await toolchains.generateToolchainDefinition(
'',
jdkInfo.version,
jdkInfo.vendor,
@@ -111,7 +150,7 @@ describe('toolchains tests', () => {
)
);
expect(
- toolchains.generateToolchainDefinition(
+ await toolchains.generateToolchainDefinition(
'',
jdkInfo.version,
jdkInfo.vendor,
@@ -143,7 +182,20 @@ describe('toolchains tests', () => {
`;
const result = `
-
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
jdk
@@ -155,6 +207,67 @@ describe('toolchains tests', () => {
/opt/jdk/sun/1.6
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
+ }, 100000);
+
+ it('does not discard custom elements in existing toolchain definitions', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = `
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+ foo
+
+
+ /opt/jdk/sun/1.6
+ /usr/local/bin/bash
+
+
+ `;
+ const result = `
+
jdk
@@ -166,6 +279,19 @@ describe('toolchains tests', () => {
/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+ foo
+
+
+ /opt/jdk/sun/1.6
+ /usr/local/bin/bash
+
+
`;
fs.mkdirSync(m2Dir, {recursive: true});
@@ -175,14 +301,13 @@ describe('toolchains tests', () => {
await toolchains.createToolchainsSettings({
jdkInfo,
- settingsDirectory: m2Dir,
- overwriteSettings: true
+ settingsDirectory: m2Dir
});
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(toolchainsFile)).toBe(true);
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
- toolchains.generateToolchainDefinition(
+ await toolchains.generateToolchainDefinition(
originalFile,
jdkInfo.version,
jdkInfo.vendor,
@@ -191,7 +316,7 @@ describe('toolchains tests', () => {
)
);
expect(
- toolchains.generateToolchainDefinition(
+ await toolchains.generateToolchainDefinition(
originalFile,
jdkInfo.version,
jdkInfo.vendor,
@@ -201,7 +326,7 @@ describe('toolchains tests', () => {
).toEqual(result);
}, 100000);
- it('does not overwrite existing toolchains.xml files', async () => {
+ it('does not discard existing, custom toolchain definitions', async () => {
const jdkInfo = {
version: '17',
vendor: 'Eclipse Temurin',
@@ -211,17 +336,40 @@ describe('toolchains tests', () => {
const originalFile = `
- jdk
-
- 1.6
- Sun
- sun_1.6
-
-
- /opt/jdk/sun/1.6
-
+ foo
+
+ baz
+
+
+ /usr/local/bin/foo
+
`;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+
+ foo
+
+ baz
+
+
+ /usr/local/bin/foo
+
+
+`;
fs.mkdirSync(m2Dir, {recursive: true});
fs.writeFileSync(toolchainsFile, originalFile);
@@ -230,75 +378,809 @@ describe('toolchains tests', () => {
await toolchains.createToolchainsSettings({
jdkInfo,
- settingsDirectory: m2Dir,
- overwriteSettings: false
+ settingsDirectory: m2Dir
});
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(toolchainsFile)).toBe(true);
- expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(originalFile);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
}, 100000);
- it('generates valid toolchains.xml with minimal configuration', () => {
+ it('does not duplicate existing toolchain definitions', async () => {
const jdkInfo = {
- version: 'JAVA_VERSION',
- vendor: 'JAVA_VENDOR',
- id: 'VENDOR_VERSION',
- jdkHome: 'JAVA_HOME'
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
};
- const expectedToolchains = `
+ const originalFile = `
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+ `;
+ const result = `
jdk
- ${jdkInfo.version}
- ${jdkInfo.vendor}
- ${jdkInfo.id}
+ 17
+ Eclipse Temurin
+ temurin_17
- ${jdkInfo.jdkHome}
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
`;
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
expect(
- toolchains.generateToolchainDefinition(
- '',
+ await toolchains.generateToolchainDefinition(
+ originalFile,
jdkInfo.version,
jdkInfo.vendor,
jdkInfo.id,
jdkInfo.jdkHome
)
- ).toEqual(expectedToolchains);
+ ).toEqual(result);
}, 100000);
- it('creates toolchains.xml with correct id when none is supplied', async () => {
- const version = '17';
- const distributionName = 'temurin';
- const id = 'temurin_17';
- const jdkHome =
- '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
+ it('does not duplicate existing toolchain definitions if multiple exist', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
- await toolchains.configureToolchains(
- version,
- distributionName,
- jdkHome,
- undefined
- );
+ const originalFile = `
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+
+
+ /opt/jdk/sun/1.6
+
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+ `;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+
+
+ /opt/jdk/sun/1.6
+
+
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
expect(fs.existsSync(m2Dir)).toBe(true);
expect(fs.existsSync(toolchainsFile)).toBe(true);
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
- toolchains.generateToolchainDefinition(
- '',
- version,
- distributionName,
- id,
- jdkHome
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
)
);
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
}, 100000);
-});
+
+ it('handles an empty list of existing toolchains correctly', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = `
+ `;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
+ }, 100000);
+
+ it('handles an empty existing toolchains.xml correctly', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = ``;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
+ }, 100000);
+
+ it('preserves custom root attributes on existing toolchains.xml', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = `
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+
+
+ /opt/jdk/sun/1.6
+
+
+ `;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+
+
+ /opt/jdk/sun/1.6
+
+
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
+ }, 100000);
+
+ it('keeps partially-formed jdk toolchains without an id instead of crashing', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = `
+
+ jdk
+
+ 1.6
+ Sun
+
+
+ /opt/jdk/sun/1.6
+
+
+ `;
+ const result = `
+
+
+ jdk
+
+ 17
+ Eclipse Temurin
+ temurin_17
+
+
+ /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64
+
+
+
+ jdk
+
+ 1.6
+ Sun
+
+
+ /opt/jdk/sun/1.6
+
+
+`;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ );
+ expect(
+ await toolchains.generateToolchainDefinition(
+ originalFile,
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(result);
+ }, 100000);
+
+ it('extends existing toolchains.xml files instead of overwriting them', async () => {
+ const jdkInfo = {
+ version: '17',
+ vendor: 'Eclipse Temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ };
+
+ const originalFile = `
+
+ jdk
+
+ 1.6
+ Sun
+ sun_1.6
+
+
+ /opt/jdk/sun/1.6
+
+
+ `;
+
+ fs.mkdirSync(m2Dir, {recursive: true});
+ fs.writeFileSync(toolchainsFile, originalFile);
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ await toolchains.createToolchainsSettings({
+ jdkInfo,
+ settingsDirectory: m2Dir
+ });
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+
+ const updated = fs.readFileSync(toolchainsFile, 'utf-8');
+ // The pre-existing (Sun 1.6) toolchain must be preserved ...
+ expect(updated).toContain('sun_1.6');
+ expect(updated).toContain('/opt/jdk/sun/1.6');
+ // ... and the newly installed JDK must be appended.
+ expect(updated).toContain('temurin_17');
+ expect(updated).toContain('Eclipse Temurin');
+ expect(updated).toContain(`${jdkInfo.jdkHome}`);
+ }, 100000);
+
+ it('generates valid toolchains.xml with minimal configuration', async () => {
+ const jdkInfo = {
+ version: 'JAVA_VERSION',
+ vendor: 'JAVA_VENDOR',
+ id: 'VENDOR_VERSION',
+ jdkHome: 'JAVA_HOME'
+ };
+
+ const expectedToolchains = `
+
+
+ jdk
+
+ ${jdkInfo.version}
+ ${jdkInfo.vendor}
+ ${jdkInfo.id}
+
+
+ ${jdkInfo.jdkHome}
+
+
+`;
+
+ expect(
+ await toolchains.generateToolchainDefinition(
+ '',
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ )
+ ).toEqual(expectedToolchains);
+ }, 100000);
+
+ it('escapes new toolchains.xml values while preserving parsed semantics', () => {
+ const jdkInfo = {
+ version: `21&<>"'é`,
+ vendor: `Temurin&<>"'é`,
+ id: `temurin&<>"'é`,
+ jdkHome: `/opt/java&<>"'é`
+ };
+
+ const xml = toolchains.generateNewToolchainDefinition(
+ jdkInfo.version,
+ jdkInfo.vendor,
+ jdkInfo.id,
+ jdkInfo.jdkHome
+ );
+ const parsed = parseXmlObject(xml) as any;
+
+ expect(parsed.toolchains.toolchain[0].type).toBe('jdk');
+ expect(xmlElementText(xml, 'version')).toBe(jdkInfo.version);
+ expect(xmlElementText(xml, 'vendor')).toBe(jdkInfo.vendor);
+ expect(xmlElementText(xml, 'id')).toBe(jdkInfo.id);
+ expect(xmlElementText(xml, 'jdkHome')).toBe(jdkInfo.jdkHome);
+ });
+
+ it('creates toolchains.xml with correct id when none is supplied', async () => {
+ const version = '17';
+ const distributionName = 'temurin';
+ const id = 'temurin_17';
+ const jdkHome =
+ '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
+
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ if (name === 'settings-path') return m2Dir;
+ return '';
+ });
+
+ await toolchains.configureToolchains(
+ version,
+ distributionName,
+ jdkHome,
+ undefined
+ );
+
+ expect(fs.existsSync(m2Dir)).toBe(true);
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
+ await toolchains.generateToolchainDefinition(
+ '',
+ version,
+ distributionName,
+ id,
+ jdkHome
+ )
+ );
+ }, 100000);
+
+ it('merges a second JDK into a toolchains.xml produced by the new-file fast path', async () => {
+ const firstJdk = {
+ version: '17',
+ vendor: 'temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/java/17'
+ };
+ const secondJdk = {
+ version: '21',
+ vendor: 'temurin',
+ id: 'temurin_21',
+ jdkHome: '/opt/java/21'
+ };
+
+ const firstToolchains = await toolchains.generateToolchainDefinition(
+ '',
+ firstJdk.version,
+ firstJdk.vendor,
+ firstJdk.id,
+ firstJdk.jdkHome
+ );
+ const mergedToolchains = await toolchains.generateToolchainDefinition(
+ firstToolchains,
+ secondJdk.version,
+ secondJdk.vendor,
+ secondJdk.id,
+ secondJdk.jdkHome
+ );
+
+ for (const jdk of [firstJdk, secondJdk]) {
+ expect(mergedToolchains).toContain(`${jdk.id}`);
+ expect(mergedToolchains).toContain(`${jdk.jdkHome}`);
+ }
+ expect((mergedToolchains.match(//g) || []).length).toBe(2);
+ });
+
+ it('preserves custom attributes and elements when merging existing toolchains.xml', async () => {
+ const originalFile = `
+
+ foo
+
+ baz & qux
+
+
+ /usr/local/bin/foo
+
+
+ `;
+
+ const mergedToolchains = await toolchains.generateToolchainDefinition(
+ originalFile,
+ '21&<>"\'',
+ 'Temurin&<>"\'',
+ 'temurin_21&<>"\'',
+ '/opt/java/21&<>"\''
+ );
+ const parsed = parseXmlObject(mergedToolchains) as any;
+ const merged = parsed.toolchains.toolchain;
+
+ expect(parsed.toolchains['@customRoot']).toBe('A & B');
+ expect(merged).toHaveLength(2);
+ expect(merged[0].provides.id).toBe('temurin_21&<>"\'');
+ expect(merged[0].configuration.jdkHome).toBe('/opt/java/21&<>"\'');
+ expect(merged[1]['@customAttr']).toBe('custom & value');
+ expect(merged[1].provides['@customProvides']).toBe('yes');
+ expect(merged[1].provides.custom['#text']).toBe('baz & qux');
+ expect(merged[1].provides.custom['@attr']).toBe('custom " attr');
+ });
+
+ it('preserves toolchains from previous executions across multiple setup-java runs', async () => {
+ // Regression test for https://github.com/actions/setup-java/issues/1099
+ // Running setup-java several times in the same job (e.g. multiple steps / multiple
+ // java-version entries) must accumulate every JDK in toolchains.xml rather
+ // than replacing previously registered entries.
+ (core.getInput as jest.Mock).mockImplementation((name: string) => {
+ if (name === 'settings-path') return m2Dir;
+ return '';
+ });
+
+ const runs = [
+ {
+ version: '8',
+ distributionName: 'temurin',
+ id: 'temurin_8',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.1-12/x64'
+ },
+ {
+ version: '11',
+ distributionName: 'temurin',
+ id: 'temurin_11',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.1-12/x64'
+ },
+ {
+ version: '17',
+ distributionName: 'temurin',
+ id: 'temurin_17',
+ jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
+ }
+ ];
+
+ for (const run of runs) {
+ await toolchains.configureToolchains(
+ run.version,
+ run.distributionName,
+ run.jdkHome,
+ undefined
+ );
+ }
+
+ expect(fs.existsSync(toolchainsFile)).toBe(true);
+ const contents = fs.readFileSync(toolchainsFile, 'utf-8');
+
+ for (const run of runs) {
+ expect(contents).toContain(`${run.id}`);
+ expect(contents).toContain(`${run.jdkHome}`);
+ }
+ // Exactly one entry per run – no duplicates, none dropped.
+ expect((contents.match(//g) || []).length).toBe(runs.length);
+ }, 100000);
+});
+
+describe('validateToolchainIds', () => {
+ it.each([
+ {
+ name: 'uses generated IDs when no custom IDs are supplied',
+ versions: ['17', '21'],
+ versionFile: '',
+ toolchainIds: []
+ },
+ {
+ name: 'accepts one custom ID for a single Java version',
+ versions: ['21'],
+ versionFile: '',
+ toolchainIds: ['custom-21']
+ },
+ {
+ name: 'accepts one custom ID per Java version',
+ versions: ['17', '21'],
+ versionFile: '',
+ toolchainIds: ['custom-17', 'custom-21']
+ },
+ {
+ name: 'accepts one custom ID with java-version-file',
+ versions: [],
+ versionFile: '.java-version',
+ toolchainIds: ['custom-file-version']
+ }
+ ])('$name', ({versions, versionFile, toolchainIds}) => {
+ expect(() =>
+ toolchains.validateToolchainIds(versions, versionFile, toolchainIds)
+ ).not.toThrow();
+ });
+
+ it.each([
+ {
+ name: 'rejects fewer IDs than Java versions',
+ versions: ['17', '21'],
+ versionFile: '',
+ toolchainIds: ['custom-17'],
+ expectedMessage:
+ 'The number of Maven toolchain IDs (1) must match the number of Java versions (2)'
+ },
+ {
+ name: 'rejects extra IDs for a single Java version',
+ versions: ['21'],
+ versionFile: '',
+ toolchainIds: ['custom-21', 'custom-extra'],
+ expectedMessage:
+ 'The number of Maven toolchain IDs (2) must match the number of Java versions (1)'
+ },
+ {
+ name: 'rejects extra IDs with java-version-file',
+ versions: [],
+ versionFile: '.java-version',
+ toolchainIds: ['custom-file-version', 'custom-extra'],
+ expectedMessage:
+ 'The number of Maven toolchain IDs (2) must match the number of Java versions (1)'
+ }
+ ])('$name', ({versions, versionFile, toolchainIds, expectedMessage}) => {
+ expect(() =>
+ toolchains.validateToolchainIds(versions, versionFile, toolchainIds)
+ ).toThrow(expectedMessage);
+ });
+});
+
+function xmlElementText(xml: string, tagName: string): string {
+ const match = new RegExp(`<${tagName}>([\\s\\S]*?)${tagName}>`).exec(xml);
+ expect(match).not.toBeNull();
+ return (parseXmlObject(`${match?.[1]}`) as {value: string})
+ .value;
+}
+
+function parseXmlObject(xml: string): unknown {
+ const parser = new XMLParser({
+ ignoreAttributes: false,
+ attributeNamePrefix: '@',
+ textNodeName: '#text',
+ parseAttributeValue: false,
+ parseTagValue: false,
+ trimValues: true,
+ isArray: tagName => tagName === 'toolchain'
+ });
+ return parser.parse(xml);
+}
diff --git a/__tests__/util-install.test.ts b/__tests__/util-install.test.ts
new file mode 100644
index 000000000..b32cead72
--- /dev/null
+++ b/__tests__/util-install.test.ts
@@ -0,0 +1,520 @@
+import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
+import * as fs from 'fs';
+import * as os from 'os';
+import * as path from 'path';
+
+jest.unstable_mockModule('@actions/core', () => ({
+ debug: jest.fn(),
+ info: jest.fn(),
+ warning: jest.fn(),
+ error: jest.fn(),
+ getInput: jest.fn(() => ''),
+ isDebug: jest.fn(() => false),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ setOutput: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/tool-cache', () => ({
+ cacheDir: jest.fn(),
+ extractTar: jest.fn(),
+ extractZip: jest.fn(),
+ extract7z: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/exec', () => ({
+ exec: jest.fn()
+}));
+
+jest.unstable_mockModule('@actions/io', () => ({
+ which: jest.fn(),
+ rmRF: jest.fn(async (target: string) =>
+ fs.rmSync(target, {recursive: true, force: true})
+ ),
+ mkdirP: jest.fn(async (target: string) =>
+ fs.mkdirSync(target, {recursive: true})
+ )
+}));
+
+jest.unstable_mockModule('@actions/http-client', () => ({
+ HttpClient: jest.fn(),
+ HttpClientError: class HttpClientError extends Error {}
+}));
+
+const tc = await import('@actions/tool-cache');
+const exec = await import('@actions/exec');
+const io = await import('@actions/io');
+const {
+ cacheJdkDir,
+ extractJdkFile,
+ getArtifactFingerprint,
+ getJavaVersionFromReleaseFile
+} = await import('../src/util.js');
+
+const originalToolCache = process.env['RUNNER_TOOL_CACHE'];
+const originalTemp = process.env['RUNNER_TEMP'];
+const originalPlatform = process.platform;
+
+let workDir: string;
+
+function setPlatform(platform: NodeJS.Platform) {
+ Object.defineProperty(process, 'platform', {
+ value: platform,
+ configurable: true
+ });
+}
+
+beforeEach(() => {
+ workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-java-util-'));
+ process.env['RUNNER_TOOL_CACHE'] = path.join(workDir, 'toolcache');
+ process.env['RUNNER_TEMP'] = path.join(workDir, 'temp');
+ fs.mkdirSync(process.env['RUNNER_TEMP'], {recursive: true});
+});
+
+afterEach(() => {
+ jest.clearAllMocks();
+ setPlatform(originalPlatform);
+ while (lockedDirs.length) {
+ fs.chmodSync(lockedDirs.pop()!, 0o755);
+ }
+ fs.rmSync(workDir, {recursive: true, force: true});
+ if (originalToolCache === undefined) {
+ delete process.env['RUNNER_TOOL_CACHE'];
+ } else {
+ process.env['RUNNER_TOOL_CACHE'] = originalToolCache;
+ }
+ if (originalTemp === undefined) {
+ delete process.env['RUNNER_TEMP'];
+ } else {
+ process.env['RUNNER_TEMP'] = originalTemp;
+ }
+});
+
+function createJdkDir(name = 'jdk-source'): string {
+ const sourceDir = path.join(workDir, name);
+ fs.mkdirSync(path.join(sourceDir, 'bin'), {recursive: true});
+ fs.writeFileSync(path.join(sourceDir, 'bin', 'java'), 'binary');
+ fs.writeFileSync(path.join(sourceDir, 'release'), 'JAVA_VERSION="17"');
+
+ return sourceDir;
+}
+
+// A rename needs write permission on the source's parent directory, so making
+// that parent read-only is a portable way to force the same failure a
+// cross-device tool-cache (EXDEV) or a Windows anti-virus handle (EPERM) would.
+// Root ignores the permission bits, so those tests are skipped there.
+const canForceRenameFailure =
+ process.platform !== 'win32' &&
+ typeof process.getuid === 'function' &&
+ process.getuid() !== 0;
+const itUnlessRoot = canForceRenameFailure ? it : it.skip;
+const lockedDirs: string[] = [];
+
+function createUnrenameableJdkDir(): string {
+ const parent = path.join(workDir, 'locked');
+ fs.mkdirSync(parent, {recursive: true});
+ const sourceDir = path.join(parent, 'jdk-source');
+ fs.mkdirSync(path.join(sourceDir, 'bin'), {recursive: true});
+ fs.writeFileSync(path.join(sourceDir, 'bin', 'java'), 'binary');
+ fs.chmodSync(parent, 0o555);
+ lockedDirs.push(parent);
+
+ return sourceDir;
+}
+
+describe('cacheJdkDir', () => {
+ it('moves the JDK into the tool-cache instead of copying it', async () => {
+ const sourceDir = createJdkDir();
+
+ const javaPath = await cacheJdkDir(
+ sourceDir,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+
+ expect(javaPath).toBe(
+ path.join(
+ process.env['RUNNER_TOOL_CACHE']!,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ )
+ );
+ expect(fs.existsSync(path.join(javaPath, 'bin', 'java'))).toBe(true);
+ expect(fs.existsSync(path.join(javaPath, 'release'))).toBe(true);
+ // the source is moved, not copied, so it no longer exists
+ expect(fs.existsSync(sourceDir)).toBe(false);
+ expect(tc.cacheDir).not.toHaveBeenCalled();
+ });
+
+ it('writes the .complete marker expected by the tool-cache', async () => {
+ const javaPath = await cacheJdkDir(
+ createJdkDir(),
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+
+ expect(fs.existsSync(`${javaPath}.complete`)).toBe(true);
+ });
+
+ it('replaces an existing tool-cache entry', async () => {
+ const destPath = path.join(
+ process.env['RUNNER_TOOL_CACHE']!,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+ fs.mkdirSync(destPath, {recursive: true});
+ fs.writeFileSync(path.join(destPath, 'stale'), 'stale');
+
+ const javaPath = await cacheJdkDir(
+ createJdkDir(),
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+
+ expect(fs.existsSync(path.join(javaPath, 'stale'))).toBe(false);
+ expect(fs.existsSync(path.join(javaPath, 'bin', 'java'))).toBe(true);
+ });
+
+ it('normalizes the version the same way as tc.cacheDir', async () => {
+ const javaPath = await cacheJdkDir(
+ createJdkDir(),
+ 'Java_temurin_jdk',
+ 'v17.0.1',
+ 'x64'
+ );
+
+ expect(path.basename(path.dirname(javaPath))).toBe('17.0.1');
+ });
+
+ it('keeps unparseable versions as-is', async () => {
+ const javaPath = await cacheJdkDir(
+ createJdkDir(),
+ 'Java_temurin_jdk',
+ '17.0.1-ea.3',
+ 'x64'
+ );
+
+ expect(path.basename(path.dirname(javaPath))).toBe('17.0.1-ea.3');
+ });
+
+ it('falls back to tc.cacheDir when the move fails', async () => {
+ (tc.cacheDir as jest.Mock).mockResolvedValue('/fallback/path' as never);
+ const missingDir = path.join(workDir, 'does-not-exist');
+
+ const javaPath = await cacheJdkDir(
+ missingDir,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+
+ expect(javaPath).toBe('/fallback/path');
+ expect(tc.cacheDir).toHaveBeenCalledWith(
+ missingDir,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+ });
+
+ itUnlessRoot(
+ 'falls back to tc.cacheDir when the rename itself fails',
+ async () => {
+ const sourceDir = createUnrenameableJdkDir();
+ (tc.cacheDir as jest.Mock).mockResolvedValue('/fallback/path' as never);
+
+ await expect(
+ cacheJdkDir(sourceDir, 'Java_temurin_jdk', '17.0.1', 'x64')
+ ).resolves.toBe('/fallback/path');
+ // the source must survive so the copy-based fallback can still read it
+ expect(fs.existsSync(path.join(sourceDir, 'bin', 'java'))).toBe(true);
+ }
+ );
+
+ itUnlessRoot(
+ 'does not leave a .complete marker behind when the rename fails',
+ async () => {
+ const destPath = path.join(
+ process.env['RUNNER_TOOL_CACHE']!,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+ fs.mkdirSync(destPath, {recursive: true});
+ fs.writeFileSync(`${destPath}.complete`, '');
+ (tc.cacheDir as jest.Mock).mockResolvedValue('/fallback/path' as never);
+
+ await cacheJdkDir(
+ createUnrenameableJdkDir(),
+ 'Java_temurin_jdk',
+ '17.0.1',
+ 'x64'
+ );
+
+ // a stale marker without a matching installation would make the
+ // tool-cache resolve a directory that is no longer there
+ expect(fs.existsSync(`${destPath}.complete`)).toBe(false);
+ }
+ );
+
+ it('falls back to tc.cacheDir for symlinked sources', async () => {
+ const realDir = createJdkDir('real-jdk');
+ const linkDir = path.join(workDir, 'linked-jdk');
+ fs.symlinkSync(realDir, linkDir, 'dir');
+ (tc.cacheDir as jest.Mock).mockResolvedValue('/fallback/path' as never);
+
+ await expect(
+ cacheJdkDir(linkDir, 'Java_temurin_jdk', '17.0.1', 'x64')
+ ).resolves.toBe('/fallback/path');
+ // moving the symlink itself would leave a dangling tool-cache entry
+ expect(fs.lstatSync(linkDir).isSymbolicLink()).toBe(true);
+ });
+
+ it('defaults the architecture the same way as tc.cacheDir', async () => {
+ const javaPath = await cacheJdkDir(
+ createJdkDir(),
+ 'Java_temurin_jdk',
+ '17.0.1',
+ ''
+ );
+
+ expect(javaPath).toBe(
+ path.join(
+ process.env['RUNNER_TOOL_CACHE']!,
+ 'Java_temurin_jdk',
+ '17.0.1',
+ os.arch()
+ )
+ );
+ });
+
+ it('falls back to tc.cacheDir when the tool-cache location is unknown', async () => {
+ delete process.env['RUNNER_TOOL_CACHE'];
+ (tc.cacheDir as jest.Mock).mockResolvedValue('/fallback/path' as never);
+
+ await expect(
+ cacheJdkDir(createJdkDir(), 'Java_temurin_jdk', '17.0.1', 'x64')
+ ).resolves.toBe('/fallback/path');
+ });
+});
+
+describe('getJavaVersionFromReleaseFile', () => {
+ it.each([
+ ['JAVA_RUNTIME_VERSION="21.0.9+7-LTS-123"', '21.0.9+7'],
+ ['JAVA_RUNTIME_VERSION="17.0.12+8-jvmci-23.1-b52"', '17.0.12+8'],
+ ['JAVA_RUNTIME_VERSION="25+36-LTS"', '25.0.0+36'],
+ ['JAVA_VERSION="25.0.1"', '25.0.1'],
+ ['JAVA_VERSION="25"', '25.0.0']
+ ])('reads a concrete version from %s', (contents, expected) => {
+ const javaHome = createJdkDir();
+ fs.writeFileSync(path.join(javaHome, 'release'), contents);
+
+ expect(getJavaVersionFromReleaseFile(javaHome)).toBe(expected);
+ });
+
+ it('reads the macOS Contents/Home release file', () => {
+ const javaHome = path.join(workDir, 'macos-jdk');
+ fs.mkdirSync(path.join(javaHome, 'Contents', 'Home'), {recursive: true});
+ fs.writeFileSync(
+ path.join(javaHome, 'Contents', 'Home', 'release'),
+ 'JAVA_RUNTIME_VERSION="21.0.9+7-LTS"'
+ );
+
+ expect(getJavaVersionFromReleaseFile(javaHome)).toBe('21.0.9+7');
+ });
+
+ it('fails when the JDK release metadata has no usable version', () => {
+ const javaHome = createJdkDir();
+ fs.writeFileSync(path.join(javaHome, 'release'), 'IMPLEMENTOR="Oracle"');
+
+ expect(() => getJavaVersionFromReleaseFile(javaHome)).toThrow(
+ /Unable to determine the installed Java version/
+ );
+ });
+});
+
+describe('extractJdkFile', () => {
+ it('uses pigz for tarballs when it is available', async () => {
+ (io.which as jest.Mock).mockResolvedValue('/usr/bin/pigz' as never);
+ (tc.extractTar as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.tar.gz')).resolves.toBe('/extracted');
+ expect(tc.extractTar).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.gz',
+ expect.stringContaining(process.env['RUNNER_TEMP']!),
+ ['--use-compress-program', '/usr/bin/pigz -d', '-x']
+ );
+ });
+
+ it('falls back to gzip when pigz is not installed', async () => {
+ (io.which as jest.Mock).mockResolvedValue('' as never);
+ (tc.extractTar as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.tar.gz')).resolves.toBe('/extracted');
+ expect(tc.extractTar).toHaveBeenCalledWith('/tmp/jdk.tar.gz');
+ });
+
+ it('falls back to gzip when pigz extraction fails', async () => {
+ (io.which as jest.Mock).mockResolvedValue('/usr/bin/pigz' as never);
+ (tc.extractTar as jest.Mock)
+ .mockRejectedValueOnce(new Error('pigz exploded') as never)
+ .mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.tar.gz')).resolves.toBe('/extracted');
+ expect(tc.extractTar).toHaveBeenNthCalledWith(2, '/tmp/jdk.tar.gz');
+ });
+
+ it('cleans up the abandoned folder when pigz extraction fails', async () => {
+ (io.which as jest.Mock).mockResolvedValue('/usr/bin/pigz' as never);
+ let pigzDest: string | undefined;
+ (tc.extractTar as jest.Mock)
+ .mockImplementationOnce((...args: unknown[]) => {
+ pigzDest = args[1] as string;
+ throw new Error('pigz exploded');
+ })
+ .mockResolvedValue('/extracted' as never);
+
+ await extractJdkFile('/tmp/jdk.tar.gz');
+
+ expect(pigzDest).toBeDefined();
+ expect(fs.existsSync(pigzDest!)).toBe(false);
+ });
+
+ it('ignores pigz when its path contains whitespace', async () => {
+ (io.which as jest.Mock).mockResolvedValue(
+ 'C:\\Program Files\\pigz.exe' as never
+ );
+ (tc.extractTar as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await extractJdkFile('/tmp/jdk.tar.gz');
+
+ // tar word-splits --use-compress-program, so a spaced path is unusable
+ expect(tc.extractTar).toHaveBeenCalledWith('/tmp/jdk.tar.gz');
+ });
+
+ it('leaves uncompressed tarballs on the default extraction path', async () => {
+ (tc.extractTar as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.tar')).resolves.toBe('/extracted');
+ expect(tc.extractTar).toHaveBeenCalledWith('/tmp/jdk.tar');
+ expect(io.which).not.toHaveBeenCalled();
+ });
+
+ it('extracts xz-compressed tarballs with xz tar flags', async () => {
+ (tc.extractTar as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.tar.xz')).resolves.toBe('/extracted');
+ expect(tc.extractTar).toHaveBeenCalledWith(
+ '/tmp/jdk.tar.xz',
+ undefined,
+ 'xJ'
+ );
+ expect(io.which).not.toHaveBeenCalled();
+ });
+
+ it('uses the bundled tar.exe for zip archives on Windows', async () => {
+ setPlatform('win32');
+ const systemRoot = path.join(workDir, 'Windows');
+ fs.mkdirSync(path.join(systemRoot, 'System32'), {recursive: true});
+ const systemTar = path.join(systemRoot, 'System32', 'tar.exe');
+ fs.writeFileSync(systemTar, '');
+ process.env['SystemRoot'] = systemRoot;
+
+ const javaPath = await extractJdkFile('/tmp/jdk.zip');
+
+ expect(tc.extractZip).not.toHaveBeenCalled();
+ expect(exec.exec).toHaveBeenCalledWith(
+ `"${systemTar}"`,
+ ['-xf', '/tmp/jdk.zip', '-C', javaPath],
+ {silent: true}
+ );
+ expect(fs.existsSync(javaPath)).toBe(true);
+ });
+
+ it('falls back to tc.extractZip when tar.exe fails', async () => {
+ setPlatform('win32');
+ const systemRoot = path.join(workDir, 'Windows');
+ fs.mkdirSync(path.join(systemRoot, 'System32'), {recursive: true});
+ fs.writeFileSync(path.join(systemRoot, 'System32', 'tar.exe'), '');
+ process.env['SystemRoot'] = systemRoot;
+ let tarDest: string | undefined;
+ (exec.exec as jest.Mock).mockImplementation((...args: unknown[]) => {
+ tarDest = (args[1] as string[])[3];
+ throw new Error('boom');
+ });
+ (tc.extractZip as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.zip')).resolves.toBe('/extracted');
+ expect(tarDest).toBeDefined();
+ expect(fs.existsSync(tarDest!)).toBe(false);
+ });
+
+ it('uses tc.extractZip on non-Windows platforms', async () => {
+ setPlatform('linux');
+ (tc.extractZip as jest.Mock).mockResolvedValue('/extracted' as never);
+
+ await expect(extractJdkFile('/tmp/jdk.zip')).resolves.toBe('/extracted');
+ expect(exec.exec).not.toHaveBeenCalled();
+ });
+});
+
+describe('getArtifactFingerprint', () => {
+ it('prefers the ETag over the other validators', () => {
+ expect(
+ getArtifactFingerprint({
+ etag: '"abc123"',
+ 'last-modified': 'Wed, 21 Oct 2026 07:28:00 GMT',
+ 'content-length': '195000000'
+ })
+ ).toBe('etag:"abc123"');
+ });
+
+ it('combines the last-modified date and the content length without an ETag', () => {
+ expect(
+ getArtifactFingerprint({
+ 'last-modified': 'Wed, 21 Oct 2026 07:28:00 GMT',
+ 'content-length': '195000000'
+ })
+ ).toBe('mtime:Wed, 21 Oct 2026 07:28:00 GMT;length:195000000');
+ });
+
+ it.each([
+ ['no validators', {}],
+ [
+ 'only a last-modified date',
+ {'last-modified': 'Wed, 21 Oct 2026 07:28:00 GMT'}
+ ],
+ ['only a content length', {'content-length': '195000000'}],
+ [
+ 'blank validators',
+ {etag: ' ', 'last-modified': '', 'content-length': ''}
+ ],
+ ['missing headers', undefined]
+ ])('returns undefined for %s', (_label, headers) => {
+ expect(getArtifactFingerprint(headers)).toBeUndefined();
+ });
+
+ it('uses the first value of a repeated header', () => {
+ expect(getArtifactFingerprint({etag: ['"first"', '"second"'] as any})).toBe(
+ 'etag:"first"'
+ );
+ });
+
+ it('distinguishes a republished artifact from the previous one', () => {
+ const before = getArtifactFingerprint({
+ 'last-modified': 'Wed, 21 Oct 2026 07:28:00 GMT',
+ 'content-length': '195000000'
+ });
+ const after = getArtifactFingerprint({
+ 'last-modified': 'Thu, 22 Oct 2026 09:03:00 GMT',
+ 'content-length': '195400000'
+ });
+
+ expect(before).not.toBe(after);
+ });
+});
diff --git a/__tests__/util.test.ts b/__tests__/util.test.ts
index bb7560dca..be3f10bc1 100644
--- a/__tests__/util.test.ts
+++ b/__tests__/util.test.ts
@@ -1,13 +1,152 @@
-import * as cache from '@actions/cache';
-import * as core from '@actions/core';
import {
+ jest,
+ describe,
+ it,
+ expect,
+ beforeEach,
+ afterAll,
+ afterEach
+} from '@jest/globals';
+import {fileURLToPath} from 'url';
+import * as fs from 'fs';
+import * as path from 'path';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+// Mock @actions/core
+jest.unstable_mockModule('@actions/core', () => ({
+ getInput: jest.fn(),
+ getBooleanInput: jest.fn(),
+ getMultilineInput: jest.fn(),
+ setOutput: jest.fn(),
+ setFailed: jest.fn(),
+ warning: jest.fn(),
+ info: jest.fn(),
+ debug: jest.fn(),
+ error: jest.fn(),
+ notice: jest.fn(),
+ startGroup: jest.fn(),
+ endGroup: jest.fn(),
+ addPath: jest.fn(),
+ exportVariable: jest.fn(),
+ saveState: jest.fn(),
+ getState: jest.fn(),
+ setSecret: jest.fn(),
+ isDebug: jest.fn(() => false),
+ group: jest.fn((_name: string, fn: () => Promise) => fn()),
+ toPlatformPath: jest.fn((p: string) => p),
+ toWin32Path: jest.fn((p: string) => p),
+ toPosixPath: jest.fn((p: string) => p)
+}));
+
+const core = await import('@actions/core');
+
+const {
convertVersionToSemver,
+ normalizeJavaVersionToSemver,
+ getNextPageUrlFromLinkHeader,
+ getVersionFromFileContent,
isVersionSatisfies,
- isCacheFeatureAvailable
-} from '../src/util';
+ isGhes,
+ validatePaginationUrl,
+ getLatestMajorVersion,
+ getBooleanInput,
+ isJdkCacheEnabled
+} = await import('../src/util.js');
+
+describe('getBooleanInput', () => {
+ let inputs: Record