mirror of
https://github.com/actions/setup-java.git
synced 2026-11-05 10:05:50 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca21d6d9c1 |
No files matched your search
@@ -1,43 +0,0 @@
|
||||
# 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.
|
||||
@@ -174,203 +174,3 @@ 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"
|
||||
@'
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>setup-java.test</groupId>
|
||||
<artifactId>mirror-settings</artifactId>
|
||||
<version>1.0</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>pom-dependencies</id>
|
||||
<url>https://dependencies.example.invalid/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>pom-plugins</id>
|
||||
<url>https://plugins.example.invalid/maven</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
'@ | 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.
|
||||
@'
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>setup-java.test</groupId>
|
||||
<artifactId>repository-settings</artifactId>
|
||||
<version>1.0</version>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>inspection</id>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
'@ | Set-Content -Path $pomPath
|
||||
'<settings />' | 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"
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@actions/cache"
|
||||
version: 6.3.0
|
||||
version: 6.2.0
|
||||
type: npm
|
||||
summary: Actions cache lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@azure/core-client"
|
||||
version: 1.11.1
|
||||
version: 1.11.0
|
||||
type: npm
|
||||
summary: Core library for interfacing with AutoRest generated code
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client/
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
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: []
|
||||
File renamed without changes.
+2
-2
@@ -1,9 +1,9 @@
|
||||
---
|
||||
name: "@azure/storage-blob"
|
||||
version: 12.31.0
|
||||
version: 12.33.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/
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@azure/storage-common"
|
||||
version: 12.5.0
|
||||
version: 12.4.1
|
||||
type: npm
|
||||
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
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@nodable/entities"
|
||||
version: 3.1.0
|
||||
version: 3.0.0
|
||||
type: npm
|
||||
summary: Entity parser for XML, HTML, External entites with security and NCR control
|
||||
homepage:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: "@typespec/ts-http-runtime"
|
||||
version: 0.3.9
|
||||
version: 0.3.7
|
||||
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
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: fast-xml-parser
|
||||
version: 5.11.2
|
||||
version: 5.11.1
|
||||
type: npm
|
||||
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
||||
homepage:
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: undici
|
||||
version: 6.29.1
|
||||
version: 6.29.0
|
||||
type: npm
|
||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||
homepage: https://undici.nodejs.org
|
||||
|
||||
@@ -168,12 +168,9 @@ steps:
|
||||
| `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` |
|
||||
| `mvn-repositories-include-central` | Include Maven Central in the generated dependency repositories profile. When `false`, Central is disabled unless an explicit `central` repository is declared. | `true` |
|
||||
| `mvn-repositories-prioritize-central` | Place Maven Central before custom dependency repositories. Has no effect when Maven Central is excluded. | `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. | |
|
||||
@@ -236,10 +233,13 @@ Additional distribution notes:
|
||||
| --- | --- |
|
||||
| Major version | `8`, `11`, `17`, `21`, `25` |
|
||||
| Specific feature or patch version | `11.0`, `11.0.4`, `17.0`, `8.0.282+8` |
|
||||
| Exact build, with optional `jdk-` prefix | `27+35`, `27.0+35`, `27.0.0+35`, `jdk-27+35` |
|
||||
| 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` |
|
||||
|
||||
Numeric Java versions can use a `jdk-` prefix. For example, `jdk-27+35`, `27+35`, and `27.0+35` all normalize to `27.0.0+35` and pin that exact build; `jdk-27` and `27` remain major-version ranges. The prefix does not select a distribution or package type. Release availability depends on the selected distribution and platform.
|
||||
|
||||
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.
|
||||
@@ -484,25 +484,10 @@ steps:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
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.
|
||||
For dependencies hosted outside Maven Central, use `mvn-repositories` to add
|
||||
resolution repositories to an 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).
|
||||
|
||||
### GPG signing
|
||||
|
||||
|
||||
+57
-792
@@ -63,51 +63,12 @@ const credentials = (id: string, username: string, password: string) => [
|
||||
const repositorySettings = (
|
||||
repositories: auth.MavenRepository[],
|
||||
includeCentral = true,
|
||||
prioritizeCentral = true,
|
||||
pluginRepositories: auth.MavenRepository[] = []
|
||||
prioritizeCentral = true
|
||||
): 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: any;
|
||||
@@ -357,21 +318,6 @@ describe('auth tests', () => {
|
||||
).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(` <repositoryOrigins>
|
||||
<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>
|
||||
</repositoryOrigins>`);
|
||||
});
|
||||
|
||||
it('does not add a gpg profile when the passphrase env var is the maven-gpg-plugin default', () => {
|
||||
const id = 'packages';
|
||||
const username = 'USER';
|
||||
@@ -514,87 +460,6 @@ describe('auth tests', () => {
|
||||
).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(
|
||||
@@ -626,9 +491,6 @@ describe('auth tests', () => {
|
||||
snapshots: {enabled: 'false'}
|
||||
}
|
||||
]);
|
||||
expect(
|
||||
parsed.settings.profiles.profile.pluginRepositories.pluginRepository
|
||||
).toEqual(disabledCentralRepositoryXml);
|
||||
});
|
||||
|
||||
it('combines repository and GPG configuration in shared profile blocks', () => {
|
||||
@@ -666,9 +528,6 @@ describe('auth tests', () => {
|
||||
snapshots: {enabled: 'false'}
|
||||
}
|
||||
]
|
||||
},
|
||||
pluginRepositories: {
|
||||
pluginRepository: disabledCentralRepositoryXml
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -682,161 +541,6 @@ describe('auth tests', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
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('<repositories>');
|
||||
}
|
||||
if (!includePluginRepositories) {
|
||||
expect(xml).not.toContain('<pluginRepositories>');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
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(/<id>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=<value>"'é`,
|
||||
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('<repositories>');
|
||||
});
|
||||
|
||||
it('escapes repository values while preserving parsed semantics', () => {
|
||||
const repository = {
|
||||
id: `private&<>"'é`,
|
||||
@@ -882,291 +586,81 @@ describe('auth tests', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
'*',
|
||||
'central',
|
||||
'external:*',
|
||||
'external:http:*',
|
||||
'*,!internal',
|
||||
'external:*,!internal',
|
||||
'!internal,external:http:*',
|
||||
'external:*,!external:http:*'
|
||||
])('preserves the mirror selector %s and URL colons', mirrorOf => {
|
||||
it('parses Maven repositories while preserving colons in URLs', () => {
|
||||
expect(
|
||||
auth.parseMavenMirrors([
|
||||
'',
|
||||
' \t ',
|
||||
` private : https://[2001:db8::1]:8443/maven : ${mirrorOf} `,
|
||||
'public:https://repo.example.com:443/releases:central'
|
||||
])
|
||||
auth.parseMavenRepositories(
|
||||
[
|
||||
'',
|
||||
' private : https://repo.example.com:8443/maven : true ',
|
||||
'releases:https://repo.example.com/releases:false'
|
||||
],
|
||||
true
|
||||
)
|
||||
).toEqual([
|
||||
{
|
||||
id: 'private',
|
||||
url: 'https://[2001:db8::1]:8443/maven',
|
||||
mirrorOf
|
||||
url: 'https://repo.example.com:8443/maven',
|
||||
snapshotsEnabled: true
|
||||
},
|
||||
{
|
||||
id: 'public',
|
||||
url: 'https://repo.example.com:443/releases',
|
||||
mirrorOf: 'central'
|
||||
id: 'releases',
|
||||
url: 'https://repo.example.com/releases',
|
||||
snapshotsEnabled: false
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
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('<mirrors>');
|
||||
});
|
||||
|
||||
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('<profiles>');
|
||||
expect(xml).not.toContain('<activeProfiles>');
|
||||
});
|
||||
|
||||
it('escapes all mirror fields as XML text', () => {
|
||||
const mirror = {
|
||||
id: 'private<&>',
|
||||
url: 'https://repo.example.com/maven?a=1&b=<value>',
|
||||
mirrorOf: '*,!internal<&>'
|
||||
};
|
||||
const xml = auth.generate([], undefined, undefined, [mirror]);
|
||||
expect(xml).toContain('<id>private<&></id>');
|
||||
expect(xml).toContain('a=1&b=<value>');
|
||||
expect(xml).toContain('<mirrorOf>*,!internal<&></mirrorOf>');
|
||||
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<string, string> = {
|
||||
'settings-path': directory,
|
||||
'overwrite-settings': String(overwrite),
|
||||
'mvn-repositories-include-central': 'false',
|
||||
...(combined ? {'gpg-passphrase-env-var': 'GPG_PASSPHRASE'} : {})
|
||||
};
|
||||
const multilineInputs: Record<string, string[]> = {
|
||||
'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('<repositories>');
|
||||
expect(xml).toContain('<pluginRepositories>');
|
||||
expect(xml).toContain('<gpg.passphraseEnvName>GPG_PASSPHRASE');
|
||||
} else {
|
||||
expect(xml).not.toContain('<profiles>');
|
||||
expect(core.getInput).not.toHaveBeenCalledWith(
|
||||
'mvn-repositories-include-central'
|
||||
);
|
||||
}
|
||||
{
|
||||
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:sometimes'],
|
||||
error:
|
||||
"Invalid snapshots-enabled value 'sometimes' in mvn-repositories entry at line 1. Expected true or false"
|
||||
}
|
||||
);
|
||||
|
||||
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
|
||||
);
|
||||
])('rejects malformed Maven repositories: $entries', ({entries, error}) => {
|
||||
expect(() => auth.parseMavenRepositories(entries, true)).toThrow(error);
|
||||
});
|
||||
|
||||
it.each(repositoryInputs)('rejects duplicate IDs in %s', inputName => {
|
||||
it('rejects duplicate Maven repository ids', () => {
|
||||
expect(() =>
|
||||
auth.parseMavenRepositories(
|
||||
[
|
||||
'private:https://first.example.com:false',
|
||||
'private:https://second.example.com:true'
|
||||
],
|
||||
true,
|
||||
inputName
|
||||
true
|
||||
)
|
||||
).toThrow(`Duplicate repository-id 'private' in ${inputName} input`);
|
||||
).toThrow("Duplicate repository-id 'private' in mvn-repositories 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';
|
||||
it('reserves the Central repository id only when automatic Central inclusion is enabled', () => {
|
||||
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
|
||||
}
|
||||
]);
|
||||
}
|
||||
);
|
||||
expect(() => auth.parseMavenRepositories([central], true)).toThrow(
|
||||
"Repository-id 'central' is reserved when mvn-repositories-include-central is enabled"
|
||||
);
|
||||
expect(auth.parseMavenRepositories([central], false)).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(
|
||||
@@ -1212,138 +706,16 @@ describe('auth tests', () => {
|
||||
snapshotsEnabled: true
|
||||
}
|
||||
],
|
||||
pluginRepositories: [],
|
||||
includeCentral: false,
|
||||
prioritizeCentral: false
|
||||
});
|
||||
});
|
||||
|
||||
it('does not read repository controls when no repositories are configured', () => {
|
||||
(
|
||||
core.getInput as jest.MockedFunction<typeof core.getInput>
|
||||
).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<typeof core.getInput>
|
||||
).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<typeof core.getInput>
|
||||
).mockImplementation(name => {
|
||||
const inputs: Record<string, string> = {
|
||||
'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<string, string[]> = {
|
||||
'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'],
|
||||
@@ -1377,23 +749,16 @@ describe('auth tests', () => {
|
||||
});
|
||||
|
||||
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']
|
||||
: []
|
||||
);
|
||||
(core.getMultilineInput as jest.Mock).mockReturnValue([
|
||||
'releases:RELEASES_USERNAME:RELEASES_PASSWORD',
|
||||
'snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD'
|
||||
]);
|
||||
|
||||
expect(auth.getMavenServerSettings()).toEqual([
|
||||
{
|
||||
id: 'releases',
|
||||
usernameEnvVar: 'RELEASES_USERNAME',
|
||||
passwordEnvVar: 'RELEASES_PASSWORD',
|
||||
repositoryOrigins: ['https://repo.example.com']
|
||||
passwordEnvVar: 'RELEASES_PASSWORD'
|
||||
},
|
||||
{
|
||||
id: 'snapshots',
|
||||
@@ -1438,106 +803,6 @@ describe('auth tests', () => {
|
||||
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();
|
||||
|
||||
@@ -374,6 +374,49 @@ describe('findInToolcache', () => {
|
||||
);
|
||||
});
|
||||
|
||||
describe('exact build requests in tool-cache', () => {
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
it.each(['jdk-27+35', '27+35', '27.0+35', '27.0.0+35'])(
|
||||
'only matches the requested build for %s',
|
||||
input => {
|
||||
const findAllVersions = jest.mocked(tc.findAllVersions);
|
||||
findAllVersions.mockReturnValue([
|
||||
'27.0.1-35',
|
||||
'27.0.0-36',
|
||||
'27.0.0-ea.35',
|
||||
'27.0.0-35'
|
||||
]);
|
||||
jest
|
||||
.mocked(util.getToolcachePath)
|
||||
.mockImplementation(
|
||||
(toolname, version, architecture) =>
|
||||
`/hostedtoolcache/${toolname}/${version}/${architecture}`
|
||||
);
|
||||
const distribution = new EmptyJavaBase({
|
||||
version: input,
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
expect(distribution['findInToolcache']()).toEqual({
|
||||
version: '27.0.0+35',
|
||||
path: '/hostedtoolcache/Java_Empty_jdk/27.0.0-35/x64'
|
||||
});
|
||||
|
||||
findAllVersions.mockReturnValue([
|
||||
'27.0.1-35',
|
||||
'27.0.0-36',
|
||||
'27.0.0-ea.35'
|
||||
]);
|
||||
expect(distribution['findInToolcache']()).toBeNull();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('setupJava', () => {
|
||||
const actualJavaVersion = '11.0.9';
|
||||
const installedJavaVersion = '11.0.8';
|
||||
@@ -1749,6 +1792,15 @@ describe('normalizeVersion', () => {
|
||||
const DummyJavaBase = JavaBase as any;
|
||||
|
||||
it.each([
|
||||
['jdk-27+35', {version: '27.0.0+35', stable: true, latest: false}],
|
||||
['27+35', {version: '27.0.0+35', stable: true, latest: false}],
|
||||
['27.0+35', {version: '27.0.0+35', stable: true, latest: false}],
|
||||
['jdk-27', {version: '27', stable: true, latest: false}],
|
||||
['jdk-27.0', {version: '27.0', stable: true, latest: false}],
|
||||
['jdk-27-ea', {version: '27', stable: false, latest: false}],
|
||||
['jdk-27+35-ea', {version: '27.0.0+35', stable: false, latest: false}],
|
||||
['jdk-27-ea.35', {version: '27.0.0+35', stable: false, latest: false}],
|
||||
['jdk-26.0.2.1+1', {version: '26.0.2+1.1', stable: true, latest: 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}],
|
||||
@@ -1778,6 +1830,24 @@ describe('normalizeVersion', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
'jdk-',
|
||||
'jdk-latest',
|
||||
'jdk-27.x',
|
||||
'jdk->=27',
|
||||
'jdk8u442-b06',
|
||||
'temurin-27+35',
|
||||
'jdk-27-ea+35',
|
||||
'jdk-27+',
|
||||
'jdk-27+35..1',
|
||||
'27+35..1',
|
||||
'jdk-27..0+35'
|
||||
])('rejects malformed or unsupported release tags: %s', input => {
|
||||
expect(() =>
|
||||
DummyJavaBase.prototype.normalizeVersion.call(null, input)
|
||||
).toThrow(/is not valid SemVer notation for a Java version/);
|
||||
});
|
||||
|
||||
it.each(['latest-ea', 'latest.1', 'LATEST-EA', ' latest-ea '])(
|
||||
'normalizeVersion should throw a targeted error for latest combined with a qualifier (%s)',
|
||||
version => {
|
||||
|
||||
@@ -244,282 +244,19 @@ describe('getAvailableVersions', () => {
|
||||
).rejects.toThrow('Early access versions are not supported');
|
||||
});
|
||||
|
||||
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\` /<br /> \`${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) +
|
||||
'`|'
|
||||
}
|
||||
});
|
||||
it('with non major version expect to throw not supported error', async () => {
|
||||
const version = '18.0.1';
|
||||
const distribution = new CorrettoDistribution({
|
||||
version: '25.0.5.0.10',
|
||||
version,
|
||||
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'](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"
|
||||
);
|
||||
distribution['findPackageForDownload'](version)
|
||||
).rejects.toThrow('Only major versions are supported');
|
||||
});
|
||||
|
||||
it('with unfound version throw could not find error', async () => {
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('getJavaDistribution', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each(['8', '23.x', '23.0.1.1', '23.0.1.1+1', '<24'])(
|
||||
it.each(['8', '23.x', '23.0.1.1', '23.0.1.1+1', '<24', 'jdk-23+35'])(
|
||||
"rejects Temurin java-package 'jdk+jmods' for version %s",
|
||||
async version => {
|
||||
await expect(
|
||||
@@ -96,7 +96,15 @@ describe('getJavaDistribution', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it.each(['24', '24.0.1.1', '25.0.4.1+1', '25-ea', '>=21', 'latest'])(
|
||||
it.each([
|
||||
'24',
|
||||
'24.0.1.1',
|
||||
'25.0.4.1+1',
|
||||
'25-ea',
|
||||
'>=21',
|
||||
'latest',
|
||||
'jdk-27+35'
|
||||
])(
|
||||
"accepts Temurin java-package 'jdk+jmods' for version %s",
|
||||
async version => {
|
||||
expect(
|
||||
@@ -117,6 +125,17 @@ describe('getJavaDistribution', () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('does not change the distribution or package for a jdk-prefixed version', async () => {
|
||||
const distribution = await getJavaDistribution(
|
||||
JavaDistribution.Zulu,
|
||||
installerOptions('jre', 'jdk-27+35')
|
||||
);
|
||||
|
||||
expect(distribution!['distribution']).toBe('Zulu');
|
||||
expect(distribution!['packageType']).toBe('jre');
|
||||
expect(distribution!['version']).toBe('27.0.0+35');
|
||||
});
|
||||
|
||||
it.each(['adopt', 'adopt-hotspot', 'adopt-openj9'])(
|
||||
'does not support legacy Adopt distribution %s',
|
||||
async distributionName => {
|
||||
|
||||
@@ -15,7 +15,6 @@ import type {
|
||||
} 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' with {type: 'json'};
|
||||
|
||||
@@ -254,126 +253,39 @@ 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}`;
|
||||
|
||||
describe('compound build versions', () => {
|
||||
beforeEach(() => {
|
||||
distribution['getAvailableVersions'] = async () =>
|
||||
['+1', '+10', '.1+1', '.1+2', '.1+10', '.2+1', '.10+1'].map(suffix => ({
|
||||
featureVersion,
|
||||
['1', '1.1', '1.2', '1.10'].map(build => ({
|
||||
featureVersion: 25,
|
||||
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`
|
||||
updateVersion: 4,
|
||||
buildVersion: 1,
|
||||
version: `25.0.4+${build}`,
|
||||
downloadUrl: `https://download.bell-sw.com/java/25.0.4+${build}/bellsoft-jdk25.0.4+${build}-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) => {
|
||||
['25.0.4+1.1', '25.0.4+1.1'],
|
||||
['25.0.4+1', '25.0.4+1'],
|
||||
['25.0.4', '25.0.4+1.10'],
|
||||
['25', '25.0.4+1.10']
|
||||
])('version is %s -> %s', async (input, expected) => {
|
||||
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`
|
||||
url: `https://download.bell-sw.com/java/${expected}/bellsoft-jdk${expected}-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`)
|
||||
distribution['findPackageForDownload']('25.0.4+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(
|
||||
/No matching version found for SemVer/
|
||||
@@ -381,193 +293,6 @@ describe('findPackageForDownload', () => {
|
||||
});
|
||||
});
|
||||
|
||||
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
|
||||
@@ -644,46 +369,6 @@ describe('convertVersionToSemver', () => {
|
||||
},
|
||||
'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',
|
||||
|
||||
@@ -378,7 +378,7 @@ describe('findPackageForDownload', () => {
|
||||
expect(resolvedVersion.version).toBe('16.0.2+7');
|
||||
});
|
||||
|
||||
describe('OpenJDK patch (respin) versions', () => {
|
||||
describe('OpenJDK versions and release tags', () => {
|
||||
const makeRelease = (
|
||||
semverVersion: string,
|
||||
openjdkVersion: string,
|
||||
@@ -402,6 +402,21 @@ describe('findPackageForDownload', () => {
|
||||
});
|
||||
|
||||
const respinManifest = [
|
||||
makeRelease('27.0.1+35', '27.0.1+35', {
|
||||
major: 27,
|
||||
security: 1,
|
||||
build: 35
|
||||
}),
|
||||
makeRelease('27.0.0+36', '27+36', {
|
||||
major: 27,
|
||||
security: 0,
|
||||
build: 36
|
||||
}),
|
||||
makeRelease('27.0.0+35', '27+35', {
|
||||
major: 27,
|
||||
security: 0,
|
||||
build: 35
|
||||
}),
|
||||
makeRelease('26.0.2+101', '26.0.2.1+1', {
|
||||
major: 26,
|
||||
security: 2,
|
||||
@@ -427,6 +442,13 @@ describe('findPackageForDownload', () => {
|
||||
];
|
||||
|
||||
it.each([
|
||||
['jdk-27+35', '27.0.0+35'],
|
||||
['27+35', '27.0.0+35'],
|
||||
['27.0+35', '27.0.0+35'],
|
||||
['jdk-27.0.0+35', '27.0.0+35'],
|
||||
['jdk-27', '27.0.1+35'],
|
||||
['27', '27.0.1+35'],
|
||||
['jdk-26.0.2.1+1', '26.0.2+101'],
|
||||
['26.0.2.1+1', '26.0.2+101'],
|
||||
['26.0.2+10', '26.0.2+10'],
|
||||
['26', '26.0.2+101'],
|
||||
@@ -452,21 +474,27 @@ describe('findPackageForDownload', () => {
|
||||
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.each(['26.0.2.2+1', 'jdk-27+34', '27+34'])(
|
||||
'does not match a non-existent build or respin: %s',
|
||||
async input => {
|
||||
const distribution = new TemurinDistribution(
|
||||
{
|
||||
version: input,
|
||||
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 '${distribution['version']}'`
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('version is found but binaries list is empty', async () => {
|
||||
|
||||
@@ -102,6 +102,24 @@ describe('Java platform capabilities', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it.each(['jdk-27+35', '27+35', 'jdk-27-ea.35'])(
|
||||
'enforces version-dependent architecture restrictions for %s',
|
||||
version => {
|
||||
expect(() =>
|
||||
validateJavaPlatform('corretto', 'linux', 'x86', version)
|
||||
).toThrow(/x86 \(<12\)/);
|
||||
}
|
||||
);
|
||||
|
||||
it.each(['jdk-11+9', '11+9', 'jdk-11-ea.9'])(
|
||||
'accepts compatible numeric release tags: %s',
|
||||
version => {
|
||||
expect(validateJavaPlatform('corretto', 'linux', 'x86', version)).toBe(
|
||||
'x86'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('allows local archives on any platform and architecture', () => {
|
||||
expect(validateJavaPlatform('jdkfile', 'aix', 'mips64', '21')).toBe(
|
||||
'mips64'
|
||||
|
||||
+17
-27
@@ -191,6 +191,17 @@ describe('convertVersionToSemver', () => {
|
||||
|
||||
describe('normalizeJavaVersionToSemver', () => {
|
||||
it.each([
|
||||
['jdk-27+35', '27.0.0+35'],
|
||||
['27+35', '27.0.0+35'],
|
||||
['27.0+35', '27.0.0+35'],
|
||||
['jdk-27.0+35', '27.0.0+35'],
|
||||
['jdk-27.0.0+35', '27.0.0+35'],
|
||||
['jdk-27', '27'],
|
||||
['jdk-27.0', '27.0'],
|
||||
['jdk-27.0.1', '27.0.1'],
|
||||
['27+35.0.LTS', '27.0.0+35.0.LTS'],
|
||||
['jdk-26.0.2.1+1', '26.0.2+1.1'],
|
||||
['jdk-11.0.9.1', '11.0.9+1'],
|
||||
['17', '17'],
|
||||
['17.0.8', '17.0.8'],
|
||||
['17.0.8+7', '17.0.8+7'],
|
||||
@@ -199,7 +210,11 @@ describe('normalizeJavaVersionToSemver', () => {
|
||||
['26.0.2.1+1', '26.0.2+1.1'],
|
||||
['17.0.8.1+1080.1', '17.0.8+1.1080.1'],
|
||||
['>=11.0.9.1', '>=11.0.9.1'],
|
||||
['17.x', '17.x']
|
||||
['17.x', '17.x'],
|
||||
['>=17 <28', '>=17 <28'],
|
||||
['jdk-27.x', 'jdk-27.x'],
|
||||
['jdk-latest', 'jdk-latest'],
|
||||
['temurin-27+35', 'temurin-27+35']
|
||||
])('%s -> %s', (input: string, expected: string) => {
|
||||
expect(normalizeJavaVersionToSemver(input)).toBe(expected);
|
||||
});
|
||||
@@ -278,28 +293,6 @@ describe('validatePaginationUrl', () => {
|
||||
});
|
||||
|
||||
describe('getVersionFromFileContent', () => {
|
||||
it.each(['25.0.5.0.10', '8.472.08.1', '25.0.5+0.10'])(
|
||||
'preserves full Corretto release %s in .java-version',
|
||||
version => {
|
||||
expect(
|
||||
getVersionFromFileContent(version, 'corretto', '.java-version')
|
||||
).toEqual({version, distribution: undefined});
|
||||
}
|
||||
);
|
||||
|
||||
it.each([
|
||||
['17.0.3.1', '.java-version', '17'],
|
||||
['1.8.0.472.1', '.java-version', '8'],
|
||||
['8.0.472.08.1', '.java-version', '8'],
|
||||
['8.0.282+8', '.java-version', '8'],
|
||||
['java corretto-17.0.13.11.1-jre', '.tool-versions', '17'],
|
||||
['java corretto-17.0.13.11.1+1', '.tool-versions', '17']
|
||||
])('keeps the existing major selection for %s', (content, file, version) => {
|
||||
expect(getVersionFromFileContent(content, 'corretto', file)?.version).toBe(
|
||||
version
|
||||
);
|
||||
});
|
||||
|
||||
describe('.sdkmanrc', () => {
|
||||
it.each([
|
||||
['java=26-tem', '26', 'temurin'],
|
||||
@@ -312,8 +305,6 @@ describe('getVersionFromFileContent', () => {
|
||||
['java=21.0.5-zulu', '21.0.5', 'zulu'],
|
||||
['java=17.0.13-albba', '17.0.13', 'dragonwell'],
|
||||
['java=17.0.13-amzn', '17', 'corretto'],
|
||||
['java=25.0.5.0.10-amzn', '25.0.5.0.10', 'corretto'],
|
||||
['java=8.472.08.1-amzn', '8.472.08.1', 'corretto'],
|
||||
['java=21.0.5-graal', '21.0.5', 'graalvm'],
|
||||
['java=17.0.9-graalce', '17.0.9', 'graalvm'],
|
||||
['java=11.0.25-librca', '11.0.25', 'liberica'],
|
||||
@@ -392,8 +383,7 @@ describe('getVersionFromFileContent', () => {
|
||||
['java adoptopenjdk-11.0.16+8', '11.0.16+8', 'temurin'],
|
||||
['java adoptopenjdk-openj9-11.0.16+8', '11.0.16+8', 'temurin'],
|
||||
['java zulu-11.56.19', '11.56.19', 'zulu'],
|
||||
['java corretto-17.0.13.11.1', '17.0.13.11.1', 'corretto'],
|
||||
['java corretto-8.472.08.1', '8.472.08.1', 'corretto'],
|
||||
['java corretto-17.0.13.11.1', '17', 'corretto'], // corretto -> major only
|
||||
['java liberica-11.0.15+10', '11.0.15+10', 'liberica'],
|
||||
['java microsoft-11.0.13.8.1', '11.0.13', 'microsoft'],
|
||||
['java semeru-openj9-11.0.25+9', '11.0.25+9', 'semeru'],
|
||||
|
||||
+2
-11
@@ -66,24 +66,15 @@ inputs:
|
||||
mvn-server-credentials:
|
||||
description: 'Multiline list of Maven server credentials in the format `server-id:USERNAME_ENV:PASSWORD_ENV`. When set, replaces the single server configured by server-id, server-username-env-var, and server-password-env-var.'
|
||||
required: false
|
||||
mvn-server-repository-origins:
|
||||
description: 'Multiline list of Maven credential origins in the format `server-id:repository-origin`. Each origin must belong to a configured server ID. Requires Maven 3.10+.'
|
||||
required: false
|
||||
mvn-repositories:
|
||||
description: 'Multiline list of Maven dependency repositories in the format `repository-id:repository-url:snapshots-enabled`.'
|
||||
required: false
|
||||
mvn-plugin-repositories:
|
||||
description: 'Multiline list of Maven plugin repositories in the format `repository-id:repository-url:snapshots-enabled`.'
|
||||
required: false
|
||||
mvn-mirrors:
|
||||
description: 'Multiline list of Maven mirrors in the format `mirror-id:mirror-url:mirror-of`. The URL must include a scheme; percent-encode colons in its path, query, or fragment. Use a matching server ID for authentication. Can be used independently of repository inputs.'
|
||||
required: false
|
||||
mvn-repositories-include-central:
|
||||
description: '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 ID `central`. Has no effect when neither repository list is configured.'
|
||||
description: 'Include Maven Central in the generated dependency repositories profile. When false, Central is disabled unless an explicit repository with ID `central` is declared.'
|
||||
required: false
|
||||
default: true
|
||||
mvn-repositories-prioritize-central:
|
||||
description: 'Place Maven Central before custom dependency and plugin repositories. Has no effect when Maven Central is excluded or neither repository list is configured.'
|
||||
description: 'Place Maven Central before custom dependency repositories. Has no effect when Maven Central is excluded.'
|
||||
required: false
|
||||
default: true
|
||||
settings-path:
|
||||
|
||||
Vendored
+2
-2
@@ -21,8 +21,8 @@ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_);
|
||||
// EXTERNAL MODULE: external "path"
|
||||
var external_path_ = __webpack_require__(6928);
|
||||
var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_);
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/cache/lib/cache.js + 322 modules
|
||||
var lib_cache = __webpack_require__(6080);
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/cache/lib/cache.js + 291 modules
|
||||
var lib_cache = __webpack_require__(5767);
|
||||
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js + 7 modules
|
||||
var lib_core = __webpack_require__(3838);
|
||||
// EXTERNAL MODULE: ./src/util.ts
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ export const modules = {
|
||||
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6080);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5767);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -13,7 +13,7 @@ export const modules = {
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(857);
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6080);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5767);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3838);
|
||||
/* harmony import */ var _actions_glob__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2377);
|
||||
/**
|
||||
|
||||
Vendored
-63317
File diff suppressed because it is too large.
Load diff
Vendored
+64
-162
@@ -7217,7 +7217,7 @@ function defaultFactory (origin, opts) {
|
||||
}
|
||||
|
||||
class Agent extends DispatcherBase {
|
||||
constructor ({ factory = defaultFactory, maxRedirections = 0, connect, tls, ...options } = {}) {
|
||||
constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
|
||||
if (typeof factory !== 'function') {
|
||||
throw new InvalidArgumentError('factory must be a function.')
|
||||
}
|
||||
@@ -7236,15 +7236,11 @@ class Agent extends DispatcherBase {
|
||||
connect = { ...connect }
|
||||
}
|
||||
|
||||
if (tls && typeof tls !== 'function') {
|
||||
tls = { ...tls }
|
||||
}
|
||||
|
||||
this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)
|
||||
? options.interceptors.Agent
|
||||
: [createRedirectInterceptor({ maxRedirections })]
|
||||
|
||||
this[kOptions] = { ...util.deepClone(options), connect, tls }
|
||||
this[kOptions] = { ...util.deepClone(options), connect }
|
||||
this[kOptions].interceptors = options.interceptors
|
||||
? { ...options.interceptors }
|
||||
: undefined
|
||||
@@ -8277,6 +8273,8 @@ async function connectH1 (client, socket) {
|
||||
socket[kParser] = new Parser(client, socket, llhttpInstance)
|
||||
|
||||
addListener(socket, 'error', function (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
const parser = this[kParser]
|
||||
|
||||
// On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
|
||||
@@ -9206,6 +9204,8 @@ async function connectH2 (client, socket) {
|
||||
socket[kHTTP2Session] = session
|
||||
|
||||
util.addListener(socket, 'error', function (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
this[kError] = err
|
||||
|
||||
this[kClient][kOnError](err)
|
||||
@@ -9279,6 +9279,8 @@ function resumeH2 (client) {
|
||||
}
|
||||
|
||||
function onHttp2SessionError (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
this[kSocket][kError] = err
|
||||
this[kClient][kOnError](err)
|
||||
}
|
||||
@@ -9976,10 +9978,9 @@ class Client extends DispatcherBase {
|
||||
// h2
|
||||
maxConcurrentStreams,
|
||||
allowH2,
|
||||
webSocket,
|
||||
eventSource
|
||||
webSocket
|
||||
} = {}) {
|
||||
super({ webSocket, eventSource })
|
||||
super({ webSocket })
|
||||
|
||||
if (keepAlive !== undefined) {
|
||||
throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
|
||||
@@ -10500,7 +10501,6 @@ module.exports = Client
|
||||
|
||||
|
||||
|
||||
const buffer = __nccwpck_require__(4573)
|
||||
const Dispatcher = __nccwpck_require__(883)
|
||||
const {
|
||||
ClientDestroyedError,
|
||||
@@ -10513,7 +10513,6 @@ const kOnDestroyed = Symbol('onDestroyed')
|
||||
const kOnClosed = Symbol('onClosed')
|
||||
const kInterceptedDispatch = Symbol('Intercepted Dispatch')
|
||||
const kWebSocketOptions = Symbol('webSocketOptions')
|
||||
const kEventSourceOptions = Symbol('eventSourceOptions')
|
||||
|
||||
class DispatcherBase extends Dispatcher {
|
||||
constructor (opts) {
|
||||
@@ -10524,7 +10523,6 @@ class DispatcherBase extends Dispatcher {
|
||||
this[kClosed] = false
|
||||
this[kOnClosed] = []
|
||||
this[kWebSocketOptions] = opts?.webSocket ?? {}
|
||||
this[kEventSourceOptions] = opts?.eventSource ?? {}
|
||||
}
|
||||
|
||||
get webSocketOptions () {
|
||||
@@ -10534,12 +10532,6 @@ class DispatcherBase extends Dispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
get eventSourceOptions () {
|
||||
return {
|
||||
maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer.kStringMaxLength
|
||||
}
|
||||
}
|
||||
|
||||
get destroyed () {
|
||||
return this[kDestroyed]
|
||||
}
|
||||
@@ -16898,7 +16890,6 @@ module.exports = {
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
|
||||
const buffer = __nccwpck_require__(4573)
|
||||
const { Transform } = __nccwpck_require__(7075)
|
||||
const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(4811)
|
||||
|
||||
@@ -16923,19 +16914,11 @@ const COLON = 0x3A
|
||||
*/
|
||||
const SPACE = 0x20
|
||||
|
||||
const defaultMaxEventSize = buffer.kStringMaxLength
|
||||
|
||||
const DATA = Buffer.from('data')
|
||||
const EVENT = Buffer.from('event')
|
||||
const ID = Buffer.from('id')
|
||||
const RETRY = Buffer.from('retry')
|
||||
|
||||
// Each data field creates a string node, and each unconsumed input chunk keeps
|
||||
// a Buffer wrapper. The absolute ceiling protects the large default byte limit.
|
||||
const minParserItems = 1024
|
||||
const maxParserItems = 131072
|
||||
const bytesPerParserItem = 128
|
||||
|
||||
function isASCIINumberBytes (buffer, start) {
|
||||
if (start >= buffer.length) {
|
||||
return false
|
||||
@@ -16974,12 +16957,6 @@ function isFieldName (line, length, field) {
|
||||
return true
|
||||
}
|
||||
|
||||
function createMaxEventSizeExceededError () {
|
||||
const error = new Error('EventSource message size exceeded')
|
||||
error.aborted = false
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} EventSourceStreamEvent
|
||||
* @type {object}
|
||||
@@ -17028,13 +17005,6 @@ class EventSourceStream extends Transform {
|
||||
pos = 0
|
||||
lineChunkIndex = 0
|
||||
linePos = 0
|
||||
lineLength = 0
|
||||
eventSize = 0
|
||||
eventFieldSizes = { data: 0, event: 0, id: 0, retry: 0 }
|
||||
dataLineCount = 0
|
||||
maxEventSize
|
||||
maxDataLines
|
||||
maxBufferedChunks
|
||||
|
||||
event = {
|
||||
data: undefined,
|
||||
@@ -17045,7 +17015,6 @@ class EventSourceStream extends Transform {
|
||||
|
||||
/**
|
||||
* @param {object} options
|
||||
* @param {number} [options.maxEventSize]
|
||||
* @param {eventSourceSettings} options.eventSourceSettings
|
||||
* @param {Function} [options.push]
|
||||
*/
|
||||
@@ -17057,12 +17026,6 @@ class EventSourceStream extends Transform {
|
||||
super(options)
|
||||
|
||||
this.state = options.eventSourceSettings || {}
|
||||
this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize
|
||||
const parserItemLimit = this.maxEventSize > 0
|
||||
? Math.min(maxParserItems, Math.max(minParserItems, Math.floor(this.maxEventSize / bytesPerParserItem)))
|
||||
: 0
|
||||
this.maxDataLines = parserItemLimit
|
||||
this.maxBufferedChunks = parserItemLimit
|
||||
if (options.push) {
|
||||
this.push = options.push
|
||||
}
|
||||
@@ -17080,14 +17043,6 @@ class EventSourceStream extends Transform {
|
||||
return
|
||||
}
|
||||
|
||||
// A leading line ending can immediately release the currently buffered
|
||||
// line, even when it uses the final allowed chunk slot.
|
||||
if (this.maxEventSize > 0 &&
|
||||
this.chunks.length >= this.maxBufferedChunks &&
|
||||
chunk[0] !== LF && chunk[0] !== CR) {
|
||||
callback(createMaxEventSizeExceededError())
|
||||
return
|
||||
}
|
||||
this.chunks.push(chunk)
|
||||
|
||||
// Strip leading byte-order-mark if we opened the stream and started
|
||||
@@ -17166,12 +17121,7 @@ class EventSourceStream extends Transform {
|
||||
|
||||
// In any case, we can process the line as we reached an
|
||||
// end-of-line character
|
||||
try {
|
||||
this.parseLine(this.readLine(), this.event)
|
||||
} catch (error) {
|
||||
callback(error)
|
||||
return
|
||||
}
|
||||
this.parseLine(this.readLine(), this.event)
|
||||
this.consumeCurrentByte()
|
||||
// A line was processed and this could be the end of the event. We need
|
||||
// to check if the next line is empty to determine if the event is
|
||||
@@ -17180,28 +17130,15 @@ class EventSourceStream extends Transform {
|
||||
continue
|
||||
}
|
||||
|
||||
// readLine() is only called after CR or LF. Reject an unfinished line
|
||||
// before it can retain an unbounded number of decoded chunks. The seven
|
||||
// extra bytes allow the longest field prefix ("event: " or "retry: ").
|
||||
if (this.maxEventSize > 0 && ++this.lineLength > this.maxEventSize + 7) {
|
||||
callback(createMaxEventSizeExceededError())
|
||||
return
|
||||
}
|
||||
this.advanceCursor()
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
|
||||
_destroy (error, callback) {
|
||||
this.chunks.length = 0
|
||||
this.clearEvent()
|
||||
super._destroy(error, callback)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Buffer} line
|
||||
* @param {EventSourceStreamEvent} event
|
||||
* @param {EventStreamEvent} event
|
||||
*/
|
||||
parseLine (line, event) {
|
||||
// If the line is empty (a blank line)
|
||||
@@ -17235,13 +17172,6 @@ class EventSourceStream extends Transform {
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, DATA)) {
|
||||
if (this.maxEventSize > 0 && this.dataLineCount >= this.maxDataLines) {
|
||||
throw createMaxEventSizeExceededError()
|
||||
}
|
||||
const valueBytes = line.length - valueStart
|
||||
const dataSize = this.eventFieldSizes.data + (event.data === undefined ? 0 : 1) + valueBytes
|
||||
this.setEventFieldSize('data', dataSize)
|
||||
|
||||
const value = line.toString('utf8', valueStart)
|
||||
|
||||
if (event.data === undefined) {
|
||||
@@ -17249,13 +17179,11 @@ class EventSourceStream extends Transform {
|
||||
} else {
|
||||
event.data += `\n${value}`
|
||||
}
|
||||
this.dataLineCount++
|
||||
return
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, RETRY)) {
|
||||
if (isASCIINumberBytes(line, valueStart)) {
|
||||
this.setEventFieldSize('retry', line.length - valueStart)
|
||||
event.retry = line.toString('utf8', valueStart)
|
||||
}
|
||||
return
|
||||
@@ -17263,29 +17191,20 @@ class EventSourceStream extends Transform {
|
||||
|
||||
if (isFieldName(line, fieldLength, ID)) {
|
||||
if (isValidLastEventIdBytes(line, valueStart)) {
|
||||
this.setEventFieldSize('id', line.length - valueStart)
|
||||
event.id = line.toString('utf8', valueStart)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, EVENT)) {
|
||||
if (valueStart < line.length) {
|
||||
this.setEventFieldSize('event', line.length - valueStart)
|
||||
event.event = line.toString('utf8', valueStart)
|
||||
const value = line.toString('utf8', valueStart)
|
||||
|
||||
if (value.length > 0) {
|
||||
event.event = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEventFieldSize (field, size) {
|
||||
const eventSize = this.eventSize - this.eventFieldSizes[field] + size
|
||||
if (this.maxEventSize > 0 && eventSize > this.maxEventSize) {
|
||||
throw createMaxEventSizeExceededError()
|
||||
}
|
||||
this.eventSize = eventSize
|
||||
this.eventFieldSizes[field] = size
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {EventSourceStreamEvent} event
|
||||
*/
|
||||
@@ -17316,12 +17235,6 @@ class EventSourceStream extends Transform {
|
||||
this.event.event = undefined
|
||||
this.event.id = undefined
|
||||
this.event.retry = undefined
|
||||
this.eventSize = 0
|
||||
this.dataLineCount = 0
|
||||
this.eventFieldSizes.data = 0
|
||||
this.eventFieldSizes.event = 0
|
||||
this.eventFieldSizes.id = 0
|
||||
this.eventFieldSizes.retry = 0
|
||||
}
|
||||
|
||||
hasPendingEvent () {
|
||||
@@ -17357,16 +17270,14 @@ class EventSourceStream extends Transform {
|
||||
syncLineStartToCursor () {
|
||||
this.lineChunkIndex = this.chunkIndex
|
||||
this.linePos = this.pos
|
||||
this.lineLength = 0
|
||||
this.dropConsumedChunks()
|
||||
}
|
||||
|
||||
dropConsumedChunks () {
|
||||
if (this.lineChunkIndex > 0) {
|
||||
const consumed = this.lineChunkIndex
|
||||
this.chunks.splice(0, consumed)
|
||||
this.lineChunkIndex = 0
|
||||
this.chunkIndex -= consumed
|
||||
while (this.lineChunkIndex > 0) {
|
||||
this.chunks.shift()
|
||||
this.lineChunkIndex--
|
||||
this.chunkIndex--
|
||||
}
|
||||
|
||||
if (this.chunkIndex === this.chunks.length) {
|
||||
@@ -17491,7 +17402,6 @@ const { isNetworkError } = __nccwpck_require__(9051)
|
||||
const { delay } = __nccwpck_require__(4811)
|
||||
const { kEnumerableProperty } = __nccwpck_require__(3440)
|
||||
const { environmentSettingsObject } = __nccwpck_require__(3168)
|
||||
const { getGlobalDispatcher } = __nccwpck_require__(2581)
|
||||
|
||||
let experimentalWarned = false
|
||||
|
||||
@@ -17773,7 +17683,6 @@ class EventSource extends EventTarget {
|
||||
|
||||
const eventSourceStream = new EventSourceStream({
|
||||
eventSourceSettings: this.#state,
|
||||
maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize,
|
||||
push: (event) => {
|
||||
this.dispatchEvent(createFastMessageEvent(
|
||||
event.type,
|
||||
@@ -17952,8 +17861,7 @@ webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
|
||||
},
|
||||
{
|
||||
key: 'dispatcher', // undici only
|
||||
converter: webidl.converters.any,
|
||||
defaultValue: () => getGlobalDispatcher()
|
||||
converter: webidl.converters.any
|
||||
}
|
||||
])
|
||||
|
||||
@@ -23049,10 +22957,8 @@ async function httpNetworkFetch (
|
||||
// 19. Run these steps in parallel:
|
||||
|
||||
// 1. Run these steps, but abort when fetchParams is canceled:
|
||||
if (!fetchParams.controller.resume) {
|
||||
fetchParams.controller.on('terminated', onAborted)
|
||||
}
|
||||
|
||||
fetchParams.controller.onAborted = onAborted
|
||||
fetchParams.controller.on('terminated', onAborted)
|
||||
fetchParams.controller.resume = async () => {
|
||||
// 1. While true
|
||||
while (true) {
|
||||
@@ -23221,6 +23127,8 @@ async function httpNetworkFetch (
|
||||
}
|
||||
location = headersList.get('location', true)
|
||||
|
||||
this.body = new Readable({ read: resume })
|
||||
|
||||
const decoders = []
|
||||
|
||||
const willFollow = location && request.redirect === 'follow' &&
|
||||
@@ -23238,7 +23146,7 @@ async function httpNetworkFetch (
|
||||
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
||||
const maxContentEncodings = 5
|
||||
if (codings.length > maxContentEncodings) {
|
||||
this.abort(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
||||
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -23271,8 +23179,6 @@ async function httpNetworkFetch (
|
||||
}
|
||||
}
|
||||
|
||||
this.body = new Readable({ read: resume })
|
||||
|
||||
const onError = this.onError.bind(this)
|
||||
|
||||
resolve({
|
||||
@@ -23319,6 +23225,10 @@ async function httpNetworkFetch (
|
||||
fetchParams.controller.off('terminated', this.abort)
|
||||
}
|
||||
|
||||
if (fetchParams.controller.onAborted) {
|
||||
fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
|
||||
}
|
||||
|
||||
fetchParams.controller.ended = true
|
||||
|
||||
this.body.push(null)
|
||||
@@ -29793,20 +29703,6 @@ class ByteParser extends Writable {
|
||||
if (isControlFrame(this.#info.opcode)) {
|
||||
this.#loop = this.parseControlFrame(body)
|
||||
this.#state = parserStates.INFO
|
||||
|
||||
// If the automatic PONG/CLOSE reply filled the socket's write buffer,
|
||||
// stop parsing and resume on drain so a PING flood cannot grow the
|
||||
// outbound queue without bound.
|
||||
const socket = this.ws[kResponse].socket
|
||||
if (this.#loop && socket.writableNeedDrain) {
|
||||
this.#loop = false
|
||||
socket.once('drain', () => {
|
||||
if (this.destroyed) return
|
||||
this.#loop = true
|
||||
this.run(callback)
|
||||
})
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!this.#info.compressed) {
|
||||
if (!this.writeFragments(body)) {
|
||||
@@ -31144,7 +31040,7 @@ module.exports = {
|
||||
/* harmony export */ gk: () => (/* binding */ INPUT_CACHE),
|
||||
/* harmony export */ wG: () => (/* binding */ INPUT_JOB_STATUS)
|
||||
/* harmony export */ });
|
||||
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_SERVER_REPOSITORY_ORIGINS, INPUT_MVN_REPOSITORIES, INPUT_MVN_PLUGIN_REPOSITORIES, INPUT_MVN_MIRRORS, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
|
||||
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_REPOSITORIES, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
|
||||
const MACOS_JAVA_CONTENT_POSTFIX = 'Contents/Home';
|
||||
const INPUT_JAVA_VERSION = 'java-version';
|
||||
const INPUT_JAVA_VERSION_FILE = 'java-version-file';
|
||||
@@ -31162,10 +31058,7 @@ const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
|
||||
const SIGNATURE_VERIFICATION_DOCUMENTATION_URL = 'https://github.com/actions/setup-java#download-integrity-and-signatures';
|
||||
const SIGNATURE_VERIFICATION_FAILURE_HELP = (/* unused pure expression or super */ null && (`If this is a legitimate vendor signing-key rotation, see ${SIGNATURE_VERIFICATION_DOCUMENTATION_URL} for instructions to configure the updated public key or temporarily disable signature verification.`));
|
||||
const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
|
||||
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
|
||||
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
|
||||
const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
|
||||
const INPUT_MVN_MIRRORS = 'mvn-mirrors';
|
||||
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
|
||||
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';
|
||||
const INPUT_SERVER_ID = 'server-id';
|
||||
@@ -31221,7 +31114,7 @@ const DISTRIBUTIONS_ONLY_MAJOR_VERSION = (/* unused pure expression or super */
|
||||
/* harmony export */ Vt: () => (/* binding */ getBooleanInput),
|
||||
/* harmony export */ lN: () => (/* binding */ isJdkCacheEnabled)
|
||||
/* harmony export */ });
|
||||
/* unused harmony exports getVersionFromToolcachePath, extractJdkFile, cacheJdkDir, getJavaVersionFromReleaseFile, getDownloadArchiveExtension, isVersionSatisfies, getToolcachePath, isGhes, getVersionFromFileContent, isExactCorrettoVersion, convertVersionToSemver, normalizeJavaVersionToSemver, getArtifactFingerprint, getGitHubToken, getGitHubHttpHeaders, MAX_PAGINATION_PAGES, getNextPageUrlFromLinkHeader, validatePaginationUrl, renameWinArchive, getLatestMajorVersion */
|
||||
/* unused harmony exports getVersionFromToolcachePath, extractJdkFile, cacheJdkDir, getJavaVersionFromReleaseFile, getDownloadArchiveExtension, isVersionSatisfies, getToolcachePath, isGhes, getVersionFromFileContent, convertVersionToSemver, normalizeJavaVersionToSemver, getArtifactFingerprint, getGitHubToken, getGitHubHttpHeaders, MAX_PAGINATION_PAGES, getNextPageUrlFromLinkHeader, validatePaginationUrl, renameWinArchive, getLatestMajorVersion */
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(857);
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(os__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(6928);
|
||||
@@ -31528,15 +31421,6 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||
}
|
||||
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||
const rawVersion = tentativeVersion.split('-')[0];
|
||||
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
|
||||
if ((extractedDistribution || distributionName) === 'corretto' &&
|
||||
capturedVersion === tentativeVersion &&
|
||||
isExactCorrettoVersion(tentativeVersion)) {
|
||||
return {
|
||||
version: tentativeVersion,
|
||||
distribution: extractedDistribution
|
||||
};
|
||||
}
|
||||
let version = semver.validRange(rawVersion)
|
||||
? tentativeVersion
|
||||
: semver.coerce(tentativeVersion);
|
||||
@@ -31620,10 +31504,6 @@ function mapAsdfDistribution(asdfDist) {
|
||||
function avoidOldNotation(content) {
|
||||
return content.startsWith('1.') ? content.substring(2) : content;
|
||||
}
|
||||
function isExactCorrettoVersion(version) {
|
||||
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
|
||||
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(version.replace('+', '.'));
|
||||
}
|
||||
function convertVersionToSemver(version) {
|
||||
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
|
||||
const versionArray = Array.isArray(version) ? version : version.split('.');
|
||||
@@ -31634,18 +31514,26 @@ function convertVersionToSemver(version) {
|
||||
return mainVersion;
|
||||
}
|
||||
/**
|
||||
* Java versions (JEP 322) can contain more numeric fields than SemVer allows,
|
||||
* e.g. '11.0.9.1' or Temurin respins such as '26.0.2.1+1'. Move the extra
|
||||
* fields into SemVer build metadata ('11.0.9+1', '26.0.2+1.1'). Any other
|
||||
* input (ranges, regular SemVer versions) is returned unchanged.
|
||||
* Normalize numeric Java versions, optionally prefixed with 'jdk-'. Pad
|
||||
* abbreviated build requests ('27+35' -> '27.0.0+35') to preserve exact
|
||||
* matching, and move extra JEP 322 fields into build metadata
|
||||
* ('26.0.2.1+1' -> '26.0.2+1.1'). Leave ranges unchanged.
|
||||
*/
|
||||
function normalizeJavaVersionToSemver(version) {
|
||||
const match = /^(\d+(?:\.\d+){3,})(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
const match = /^(?:jdk-)?(\d+(?:\.\d+)*)(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
if (!match) {
|
||||
return version;
|
||||
}
|
||||
const converted = convertVersionToSemver(match[1]);
|
||||
return match[2] ? `${converted}.${match[2]}` : converted;
|
||||
const versionParts = match[1].split('.');
|
||||
if (match[2]) {
|
||||
while (versionParts.length < 3) {
|
||||
versionParts.push('0');
|
||||
}
|
||||
}
|
||||
const converted = convertVersionToSemver(versionParts.join('.'));
|
||||
return match[2]
|
||||
? `${converted}${versionParts.length > 3 ? '.' : '+'}${match[2]}`
|
||||
: converted;
|
||||
}
|
||||
/**
|
||||
* Builds a validator for the bytes currently served by a URL from the response
|
||||
@@ -31908,6 +31796,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https")
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8995:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7030:
|
||||
/***/ ((module) => {
|
||||
|
||||
@@ -31922,6 +31817,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6760:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 643:
|
||||
/***/ ((module) => {
|
||||
|
||||
@@ -36343,12 +36245,12 @@ async function saveCaches() {
|
||||
}
|
||||
const saves = [];
|
||||
if (cache) {
|
||||
const { save } = await Promise.all(/* import() */[__nccwpck_require__.e(80), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
const { save } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
saves.push(save(cache));
|
||||
}
|
||||
if (cacheJdk) {
|
||||
const { saveJdkCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(80), __nccwpck_require__.e(314)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2314));
|
||||
const { saveJdkResolutionCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(80), __nccwpck_require__.e(348)]).then(__nccwpck_require__.bind(__nccwpck_require__, 967));
|
||||
const { saveJdkCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(314)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2314));
|
||||
const { saveJdkResolutionCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(348)]).then(__nccwpck_require__.bind(__nccwpck_require__, 967));
|
||||
saves.push(saveJdkCaches());
|
||||
saves.push(saveJdkResolutionCaches());
|
||||
}
|
||||
|
||||
Vendored
+13
-98
@@ -13,11 +13,9 @@ export const modules = {
|
||||
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4942);
|
||||
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4527);
|
||||
/* harmony import */ var _base_installer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6242);
|
||||
/* harmony import */ var _platform_types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7444);
|
||||
|
||||
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4527);
|
||||
/* harmony import */ var _base_installer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6242);
|
||||
/* harmony import */ var _platform_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7444);
|
||||
|
||||
|
||||
|
||||
@@ -25,42 +23,29 @@ export const modules = {
|
||||
|
||||
|
||||
const CORRETTO_VERSIONS_URL = 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
|
||||
class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5__/* .JavaBase */ .O {
|
||||
requestedVersion;
|
||||
class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4__/* .JavaBase */ .O {
|
||||
constructor(installerOptions) {
|
||||
super('Corretto', {
|
||||
...installerOptions,
|
||||
// Java 8 releases use zero-padded fields, e.g. 8.472.08.1.
|
||||
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .isExactCorrettoVersion */ .kI)(installerOptions.version)
|
||||
? installerOptions.version.replace(/(^|\.)0+(?=\d)/g, '$1')
|
||||
: installerOptions.version
|
||||
});
|
||||
this.requestedVersion = installerOptions.version
|
||||
.replace('+', '.')
|
||||
.replace(/^8\.(\d+)\.(\d)\./, '8.$1.0$2.');
|
||||
super('Corretto', installerOptions);
|
||||
}
|
||||
async downloadTool(javaRelease) {
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
|
||||
let javaArchivePath = await this.downloadAndVerify(javaRelease);
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Extracting Java archive...`);
|
||||
const extension = (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getDownloadArchiveExtension */ .ag)();
|
||||
const extension = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .getDownloadArchiveExtension */ .ag)();
|
||||
if (process.platform === 'win32') {
|
||||
javaArchivePath = (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .renameWinArchive */ .n2)(javaArchivePath);
|
||||
javaArchivePath = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .renameWinArchive */ .n2)(javaArchivePath);
|
||||
}
|
||||
const extractedJavaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .extractJdkFile */ .PE)(javaArchivePath, extension);
|
||||
const extractedJavaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .extractJdkFile */ .PE)(javaArchivePath, extension);
|
||||
const archiveName = fs__WEBPACK_IMPORTED_MODULE_1___default().readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path__WEBPACK_IMPORTED_MODULE_2___default().join(extractedJavaPath, archiveName);
|
||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||
const javaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .cacheJdkDir */ .Vj)(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||
const javaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .cacheJdkDir */ .Vj)(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
}
|
||||
async findPackageForDownload(version) {
|
||||
if (!this.stable) {
|
||||
throw new Error('Early access versions are not supported');
|
||||
}
|
||||
if ((0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .isExactCorrettoVersion */ .kI)(this.requestedVersion)) {
|
||||
return this.findExactRelease();
|
||||
}
|
||||
const availableVersions = await this.getAvailableVersions();
|
||||
// The `latest` alias is normalized to the SemVer wildcard, but Corretto
|
||||
// matches on an exact major version, so resolve it to the newest available
|
||||
@@ -75,13 +60,13 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5
|
||||
version = Math.max(...majors).toString();
|
||||
}
|
||||
if (version.includes('.')) {
|
||||
throw new Error('Specify a major version or a full Corretto release, such as 25.0.5.0.10');
|
||||
throw new Error('Only major versions are supported');
|
||||
}
|
||||
const matchingVersions = availableVersions
|
||||
.filter(item => item.version == version)
|
||||
.map(item => {
|
||||
return {
|
||||
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .convertVersionToSemver */ .ZY)(item.correttoVersion),
|
||||
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .convertVersionToSemver */ .ZY)(item.correttoVersion),
|
||||
url: item.downloadLink,
|
||||
checksum: {
|
||||
algorithm: 'sha256',
|
||||
@@ -97,76 +82,6 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5
|
||||
}
|
||||
return resolvedVersion;
|
||||
}
|
||||
async findExactRelease() {
|
||||
const version = this.requestedVersion;
|
||||
const major = version.split('.')[0];
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.architecture;
|
||||
if (platform !== 'windows' && this.packageType !== 'jdk') {
|
||||
throw new Error('Corretto JRE archives are only available for Windows');
|
||||
}
|
||||
const os = platform === 'macos'
|
||||
? 'macosx'
|
||||
: platform === 'alpine'
|
||||
? 'alpine-linux'
|
||||
: platform;
|
||||
const suffix = platform === 'windows' ? `-${this.packageType}.zip` : '.tar.gz';
|
||||
const url = `https://corretto.aws/downloads/resources/${version}/amazon-corretto-${version}-${os}-${arch}${suffix}`;
|
||||
// Versioned archives have no checksum sidecar; Amazon publishes their SHA-256s in the release notes.
|
||||
const source = `https://api.github.com/repos/corretto/corretto-${major}/releases/tags/${version}`;
|
||||
const findCatalogRelease = async () => {
|
||||
const archive = (await this.getAvailableVersions()).find(item => item.downloadLink === url);
|
||||
if (!archive) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
version: this.version,
|
||||
url,
|
||||
checksum: {
|
||||
algorithm: 'sha256',
|
||||
value: archive.checksum_sha256,
|
||||
source: CORRETTO_VERSIONS_URL
|
||||
}
|
||||
};
|
||||
};
|
||||
let response;
|
||||
try {
|
||||
response = await this.http.getJson(source, {
|
||||
...(0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getGitHubHttpHeaders */ .U_)(),
|
||||
accept: 'application/vnd.github+json'
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
const catalogRelease = await findCatalogRelease();
|
||||
if (catalogRelease) {
|
||||
return catalogRelease;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const row = response.result?.body
|
||||
?.split(/\r?\n/)
|
||||
.find(line => line.includes(`](${url})`));
|
||||
const checksum = row?.match(/`([a-fA-F0-9]{64})`/)?.[1];
|
||||
if (checksum) {
|
||||
return {
|
||||
version: this.version,
|
||||
url,
|
||||
checksum: { algorithm: 'sha256', value: checksum, source }
|
||||
};
|
||||
}
|
||||
// The current catalog also covers releases missing from GitHub, such as Corretto 15 and 16.
|
||||
const catalogRelease = await findCatalogRelease();
|
||||
if (catalogRelease) {
|
||||
return catalogRelease;
|
||||
}
|
||||
if (response.statusCode === _actions_http_client__WEBPACK_IMPORTED_MODULE_3__/* .HttpCodes */ .Hv.NotFound) {
|
||||
throw new Error(`Corretto release ${version} was not found in Amazon's GitHub releases or current download catalog`);
|
||||
}
|
||||
if (!row) {
|
||||
throw new Error(`No ${platform}/${arch} ${this.packageType} archive is listed for Corretto ${version}`);
|
||||
}
|
||||
throw new Error(`No SHA-256 checksum is published for Corretto ${version} (${platform}, ${arch}, ${this.packageType})`);
|
||||
}
|
||||
async getAvailableVersions() {
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.distributionArchitecture();
|
||||
@@ -197,7 +112,7 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5
|
||||
for (const version in eligibleVersions) {
|
||||
const availableVersion = eligibleVersions[version];
|
||||
for (const fileType in availableVersion) {
|
||||
const skipNonExtractableBinaries = fileType != (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getDownloadArchiveExtension */ .ag)();
|
||||
const skipNonExtractableBinaries = fileType != (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .getDownloadArchiveExtension */ .ag)();
|
||||
if (skipNonExtractableBinaries) {
|
||||
continue;
|
||||
}
|
||||
@@ -224,7 +139,7 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
case 'linux':
|
||||
return (0,_platform_types_js__WEBPACK_IMPORTED_MODULE_6__/* .isAlpineLinux */ .G6)() ? 'alpine' : 'linux';
|
||||
return (0,_platform_types_js__WEBPACK_IMPORTED_MODULE_5__/* .isAlpineLinux */ .G6)() ? 'alpine' : 'linux';
|
||||
default:
|
||||
return process.platform;
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -56,7 +56,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
|
||||
let jdkCache;
|
||||
if (this.cacheJdk) {
|
||||
const [{ getJdkVerificationIdentity }, source] = await Promise.all([
|
||||
Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779)),
|
||||
Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779)),
|
||||
hashFile(jdkFilePath)
|
||||
]);
|
||||
jdkCache = {
|
||||
@@ -70,7 +70,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
|
||||
};
|
||||
}
|
||||
if (!this.forceDownload && jdkCache) {
|
||||
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const restored = await restoreJdk(jdkCache);
|
||||
const restoredPath = restored
|
||||
? this.getRestoredJdkPath(this.version)
|
||||
@@ -94,7 +94,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
|
||||
path: javaPath
|
||||
};
|
||||
if (jdkCache) {
|
||||
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
registerJdk(jdkCache);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-56152
File diff suppressed because it is too large.
Load diff
Vendored
+12
-20
@@ -360,7 +360,7 @@ class JavaBase {
|
||||
? await this.createJdkCache(javaRelease)
|
||||
: undefined;
|
||||
if (!this.forceDownload && jdkCache) {
|
||||
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const restored = await restoreJdk(jdkCache);
|
||||
if (restored) {
|
||||
const restoredPath = this.getRestoredJdkPath(javaRelease.version);
|
||||
@@ -378,7 +378,7 @@ class JavaBase {
|
||||
core/* info */.pq(`Java ${foundJava.version} was downloaded`);
|
||||
if (javaRelease.floating) {
|
||||
if (!semver_default().valid(foundJava.version) ||
|
||||
!this.isVersionSatisfied(this.version, foundJava.version)) {
|
||||
!(0,util/* isVersionSatisfies */.y)(this.version, foundJava.version)) {
|
||||
throw new Error(`The downloaded ${this.distribution} artifact reported Java ${foundJava.version}, which does not satisfy '${this.version}'.`);
|
||||
}
|
||||
javaRelease = { ...javaRelease, version: foundJava.version };
|
||||
@@ -392,7 +392,7 @@ class JavaBase {
|
||||
// Register after the installation exists so its identity is
|
||||
// captured; the post-job save refuses to upload a path whose
|
||||
// installation was replaced afterwards.
|
||||
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
registerJdk(jdkCache);
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,7 @@ class JavaBase {
|
||||
const release = await this.findPackageForDownload(this.version);
|
||||
return this.restoreFloatingResolution(release);
|
||||
}
|
||||
const { restoreJdkResolution, registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
const { restoreJdkResolution, registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
const request = {
|
||||
distribution: this.distribution,
|
||||
packageType: this.packageType,
|
||||
@@ -477,7 +477,7 @@ class JavaBase {
|
||||
return false;
|
||||
}
|
||||
async createJdkCache(javaRelease) {
|
||||
const { getJdkVerificationIdentity } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
const { getJdkVerificationIdentity } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
||||
return {
|
||||
distribution: this.distribution,
|
||||
packageType: this.packageType,
|
||||
@@ -495,13 +495,13 @@ class JavaBase {
|
||||
this.forceDownload) {
|
||||
return javaRelease;
|
||||
}
|
||||
const { restoreJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
const { restoreJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
const restored = await restoreJdkResolution(this.getFloatingResolutionRequest(javaRelease));
|
||||
if (!restored) {
|
||||
return javaRelease;
|
||||
}
|
||||
if (!semver_default().valid(restored.release.version) ||
|
||||
!this.isVersionSatisfied(this.version, restored.release.version)) {
|
||||
!(0,util/* isVersionSatisfies */.y)(this.version, restored.release.version)) {
|
||||
core/* debug */.Yz(`Ignoring the cached concrete version '${restored.release.version}' for ${this.distribution} ${this.version}.`);
|
||||
return javaRelease;
|
||||
}
|
||||
@@ -515,7 +515,7 @@ class JavaBase {
|
||||
this.forceDownload) {
|
||||
return;
|
||||
}
|
||||
const { registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
const { registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
|
||||
registerJdkResolution(this.getFloatingResolutionRequest(javaRelease), javaRelease);
|
||||
}
|
||||
getFloatingResolutionRequest(javaRelease) {
|
||||
@@ -684,10 +684,10 @@ class JavaBase {
|
||||
})
|
||||
.filter(item => item.stable === this.stable);
|
||||
const satisfiedVersions = availableVersions
|
||||
.filter(item => this.isVersionSatisfied(this.version, item.version))
|
||||
.filter(item => (0,util/* isVersionSatisfies */.y)(this.version, item.version))
|
||||
.filter(item => item.path)
|
||||
.sort((a, b) => {
|
||||
return -this.compareVersions(a.version, b.version);
|
||||
return -semver_default().compareBuild(a.version, b.version);
|
||||
});
|
||||
if (!satisfiedVersions || satisfiedVersions.length === 0) {
|
||||
return null;
|
||||
@@ -697,12 +697,6 @@ class JavaBase {
|
||||
path: satisfiedVersions[0].path
|
||||
};
|
||||
}
|
||||
isVersionSatisfied(range, version) {
|
||||
return (0,util/* isVersionSatisfies */.y)(range, version);
|
||||
}
|
||||
compareVersions(a, b) {
|
||||
return semver_default().compareBuild(a, b);
|
||||
}
|
||||
normalizeVersion(version) {
|
||||
let stable = true;
|
||||
const latest = false;
|
||||
@@ -734,10 +728,8 @@ class JavaBase {
|
||||
version = version.replace('-ea.', '+');
|
||||
stable = false;
|
||||
}
|
||||
// Java uses a versioning scheme (JEP 322) that can contain more numeric
|
||||
// fields than SemVer allows, e.g. '18.0.1.1' or '11.0.9.1'. Convert such
|
||||
// exact versions to SemVer build notation ('18.0.1+1', or '26.0.2+1.1'
|
||||
// for '26.0.2.1+1') so they are accepted. Ranges are left untouched.
|
||||
// Normalize Java release tags and JEP 322 versions without losing exact
|
||||
// build constraints ('jdk-27+35' -> '27.0.0+35'). Leave ranges unchanged.
|
||||
version = (0,util/* normalizeJavaVersionToSemver */.zZ)(version);
|
||||
if (!semver_default().validRange(version)) {
|
||||
throw new Error(`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`);
|
||||
|
||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ export const modules = {
|
||||
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4219);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6971);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ export const modules = {
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(857);
|
||||
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4219);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6971);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3838);
|
||||
/* harmony import */ var _actions_glob__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2377);
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ export const modules = {
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ isCacheFeatureAvailable: () => (/* binding */ isCacheFeatureAvailable)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4219);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3838);
|
||||
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4527);
|
||||
|
||||
|
||||
Vendored
+2
-54
@@ -52,58 +52,14 @@ class LibericaDistributions extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
|
||||
version: this.convertVersionToSemver(item)
|
||||
}));
|
||||
const satisfiedVersion = availableVersions
|
||||
.filter(item => this.isVersionSatisfied(range, item.version))
|
||||
.sort((a, b) => -this.compareVersions(a.version, b.version))[0];
|
||||
.filter(item => (0,_util_js__WEBPACK_IMPORTED_MODULE_2__/* .isVersionSatisfies */ .y)(range, item.version))
|
||||
.sort((a, b) => -semver__WEBPACK_IMPORTED_MODULE_1___default().compareBuild(a.version, b.version))[0];
|
||||
if (!satisfiedVersion) {
|
||||
const availableVersionStrings = availableVersions.map(item => item.version);
|
||||
throw this.createVersionNotFoundError(range, availableVersionStrings);
|
||||
}
|
||||
return satisfiedVersion;
|
||||
}
|
||||
normalizeVersion(version) {
|
||||
const normalized = super.normalizeVersion(version);
|
||||
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
|
||||
// Keep patch-only requests distinct from exact SDKMAN build requests.
|
||||
normalized.version = version.replace(/-ea$/, '');
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
isVersionSatisfied(range, version) {
|
||||
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
|
||||
if (patchRequest) {
|
||||
const candidate = semver__WEBPACK_IMPORTED_MODULE_1___default().parse(version);
|
||||
if (!candidate || !semver__WEBPACK_IMPORTED_MODULE_1___default().eq(patchRequest[1], candidate)) {
|
||||
return false;
|
||||
}
|
||||
const patch = candidate.build.length > 1
|
||||
? candidate.build.slice(0, -1).join('.')
|
||||
: '0';
|
||||
return patch === patchRequest[2].slice(1);
|
||||
}
|
||||
return super.isVersionSatisfied(range, version);
|
||||
}
|
||||
compareVersions(a, b) {
|
||||
const mainComparison = semver__WEBPACK_IMPORTED_MODULE_1___default().compare(a, b);
|
||||
if (mainComparison !== 0) {
|
||||
return mainComparison;
|
||||
}
|
||||
const getPatchAndBuild = (version) => {
|
||||
const build = new (semver__WEBPACK_IMPORTED_MODULE_1___default().SemVer)(version).build;
|
||||
return build.length > 1
|
||||
? { patch: build.slice(0, -1), build: build[build.length - 1] }
|
||||
: { patch: [], build: build[0] ?? '0' };
|
||||
};
|
||||
const first = getPatchAndBuild(a);
|
||||
const second = getPatchAndBuild(b);
|
||||
const compareNumericIdentifiers = (left, right) => semver__WEBPACK_IMPORTED_MODULE_1___default().compareBuild(`0.0.0+${left}`, `0.0.0+${right}`);
|
||||
for (let index = 0; index < Math.max(first.patch.length, second.patch.length); index++) {
|
||||
const patchComparison = compareNumericIdentifiers(first.patch[index] ?? '0', second.patch[index] ?? '0');
|
||||
if (patchComparison !== 0) {
|
||||
return patchComparison;
|
||||
}
|
||||
}
|
||||
return compareNumericIdentifiers(first.build, second.build);
|
||||
}
|
||||
async getAvailableVersions() {
|
||||
if (_actions_core__WEBPACK_IMPORTED_MODULE_3__/* .isDebug */ ._o()) {
|
||||
console.time('Retrieving available versions for Liberica took'); // eslint-disable-line no-console
|
||||
@@ -175,14 +131,6 @@ class LibericaDistributions extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
|
||||
const { featureVersion, interimVersion, updateVersion } = version;
|
||||
const buildVersion = version.version.split('+')[1] || version.buildVersion;
|
||||
const mainVersion = [featureVersion, interimVersion, updateVersion].join('.');
|
||||
const patchVersion = version.version
|
||||
.split('+')[0]
|
||||
.split('.')
|
||||
.slice(3)
|
||||
.join('.');
|
||||
if (patchVersion) {
|
||||
return `${mainVersion}+${patchVersion}.${buildVersion}`;
|
||||
}
|
||||
if (buildVersion != 0) {
|
||||
return `${mainVersion}+${buildVersion}`;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -8,7 +8,7 @@ export const modules = {
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ isCacheFeatureAvailable: () => (/* binding */ isCacheFeatureAvailable)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4219);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3838);
|
||||
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4527);
|
||||
|
||||
@@ -46,7 +46,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4219);
|
||||
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6971);
|
||||
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);
|
||||
/* harmony import */ var _cache_feature_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1394);
|
||||
|
||||
|
||||
Vendored
+48
-161
@@ -7,14 +7,12 @@ export const modules = {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ addMavenServerRepositoryOrigins: () => (/* binding */ addMavenServerRepositoryOrigins),
|
||||
/* harmony export */ configureAuthentication: () => (/* binding */ configureAuthentication),
|
||||
/* harmony export */ createAuthenticationSettings: () => (/* binding */ createAuthenticationSettings),
|
||||
/* harmony export */ generate: () => (/* binding */ generate),
|
||||
/* harmony export */ getInputWithDeprecatedAlias: () => (/* binding */ getInputWithDeprecatedAlias),
|
||||
/* harmony export */ getMavenRepositorySettings: () => (/* binding */ getMavenRepositorySettings),
|
||||
/* harmony export */ getMavenServerSettings: () => (/* binding */ getMavenServerSettings),
|
||||
/* harmony export */ parseMavenMirrors: () => (/* binding */ parseMavenMirrors),
|
||||
/* harmony export */ parseMavenRepositories: () => (/* binding */ parseMavenRepositories),
|
||||
/* harmony export */ parseMavenServerCredentials: () => (/* binding */ parseMavenServerCredentials)
|
||||
/* harmony export */ });
|
||||
@@ -39,11 +37,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
const MAVEN_REPOSITORY_ORIGIN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+\/?$/;
|
||||
async function configureAuthentication() {
|
||||
const servers = getMavenServerSettings();
|
||||
const repositorySettings = getMavenRepositorySettings();
|
||||
const mirrors = parseMavenMirrors(_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_MIRRORS */ .K));
|
||||
const settingsDirectory = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SETTINGS_PATH */ .Xh) ||
|
||||
path__WEBPACK_IMPORTED_MODULE_0__.join(os__WEBPACK_IMPORTED_MODULE_4__.homedir(), _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .M2_DIR */ .iT);
|
||||
const overwriteSettings = (0,_util_js__WEBPACK_IMPORTED_MODULE_6__/* .getBooleanInput */ .Vt)(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_OVERWRITE_SETTINGS */ .TS, true);
|
||||
@@ -53,7 +49,7 @@ async function configureAuthentication() {
|
||||
if (gpgPrivateKey) {
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .setSecret */ .Pq(gpgPrivateKey);
|
||||
}
|
||||
await createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar, repositorySettings, mirrors);
|
||||
await createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar, repositorySettings);
|
||||
if (gpgPrivateKey) {
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .info */ .pq('Importing private gpg key');
|
||||
const gpgHome = await _gpg_js__WEBPACK_IMPORTED_MODULE_5__/* .importKey */ .Fh(gpgPrivateKey);
|
||||
@@ -78,16 +74,16 @@ function getInputWithDeprecatedAlias(inputName, deprecatedInputName, defaultValu
|
||||
// only exported for testing purposes
|
||||
function getMavenServerSettings() {
|
||||
const entries = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_SERVER_CREDENTIALS */ .MM);
|
||||
const servers = entries.some(entry => entry.trim())
|
||||
? parseMavenServerCredentials(entries)
|
||||
: [
|
||||
{
|
||||
id: _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_ID */ .fd),
|
||||
usernameEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_ENV_VAR */ .sc, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_DEPRECATED */ .sp, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_USERNAME */ .Wj),
|
||||
passwordEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_ENV_VAR */ .r4, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_DEPRECATED */ .Vt, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_PASSWORD */ .xp)
|
||||
}
|
||||
];
|
||||
return addMavenServerRepositoryOrigins(servers, _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_SERVER_REPOSITORY_ORIGINS */ .Pt));
|
||||
if (entries.some(entry => entry.trim())) {
|
||||
return parseMavenServerCredentials(entries);
|
||||
}
|
||||
return [
|
||||
{
|
||||
id: _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_ID */ .fd),
|
||||
usernameEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_ENV_VAR */ .sc, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_DEPRECATED */ .sp, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_USERNAME */ .Wj),
|
||||
passwordEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_ENV_VAR */ .r4, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_DEPRECATED */ .Vt, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_PASSWORD */ .xp)
|
||||
}
|
||||
];
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function parseMavenServerCredentials(entries) {
|
||||
@@ -114,78 +110,20 @@ function parseMavenServerCredentials(entries) {
|
||||
return servers;
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function addMavenServerRepositoryOrigins(servers, entries) {
|
||||
const serverIds = new Set(servers.map(server => server.id));
|
||||
const originsByServer = new Map();
|
||||
entries.forEach((entry, index) => {
|
||||
if (!entry.trim()) {
|
||||
return;
|
||||
}
|
||||
const separator = entry.indexOf(':');
|
||||
if (separator <= 0 || separator === entry.length - 1) {
|
||||
throw new Error(`Invalid mvn-server-repository-origins entry at line ${index + 1}. Expected format: server-id:repository-origin`);
|
||||
}
|
||||
const id = entry.slice(0, separator).trim();
|
||||
const value = entry.slice(separator + 1).trim();
|
||||
if (!id || !value) {
|
||||
throw new Error(`Invalid mvn-server-repository-origins entry at line ${index + 1}. Server ID and repository origin are required`);
|
||||
}
|
||||
if (!serverIds.has(id)) {
|
||||
throw new Error(`Unknown server-id '${id}' in mvn-server-repository-origins at line ${index + 1}`);
|
||||
}
|
||||
let url;
|
||||
try {
|
||||
if (!MAVEN_REPOSITORY_ORIGIN.test(value)) {
|
||||
throw new Error();
|
||||
}
|
||||
url = new URL(value);
|
||||
}
|
||||
catch {
|
||||
throw new Error(`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`);
|
||||
}
|
||||
if (!url.host ||
|
||||
url.username ||
|
||||
url.password ||
|
||||
(url.pathname !== '' && url.pathname !== '/') ||
|
||||
url.search ||
|
||||
url.hash) {
|
||||
throw new Error(`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`);
|
||||
}
|
||||
const explicitPort = /:(\d+)\/?$/.exec(value)?.[1];
|
||||
const port = explicitPort ? Number.parseInt(explicitPort, 10) : undefined;
|
||||
const includePort = port !== undefined &&
|
||||
!((url.protocol === 'http:' && port === 80) ||
|
||||
(url.protocol === 'https:' && port === 443));
|
||||
const origin = `${url.protocol}//${url.hostname}${includePort ? `:${port}` : ''}`;
|
||||
const origins = originsByServer.get(id) || [];
|
||||
if (!origins.includes(origin)) {
|
||||
origins.push(origin);
|
||||
originsByServer.set(id, origins);
|
||||
}
|
||||
});
|
||||
return servers.map(server => {
|
||||
const repositoryOrigins = originsByServer.get(server.id);
|
||||
return repositoryOrigins ? { ...server, repositoryOrigins } : server;
|
||||
});
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function getMavenRepositorySettings() {
|
||||
const entries = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES */ .W2);
|
||||
const pluginEntries = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_PLUGIN_REPOSITORIES */ .gR);
|
||||
if (!entries.some(entry => entry.trim()) &&
|
||||
!pluginEntries.some(entry => entry.trim())) {
|
||||
if (!entries.some(entry => entry.trim())) {
|
||||
return undefined;
|
||||
}
|
||||
const includeCentral = (0,_util_js__WEBPACK_IMPORTED_MODULE_6__/* .getBooleanInput */ .Vt)(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL */ .H5, true);
|
||||
return {
|
||||
repositories: parseMavenRepositories(entries, includeCentral),
|
||||
pluginRepositories: parseMavenRepositories(pluginEntries, includeCentral, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_PLUGIN_REPOSITORIES */ .gR),
|
||||
includeCentral,
|
||||
prioritizeCentral: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__/* .getBooleanInput */ .Vt)(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL */ .OT, true)
|
||||
};
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function parseMavenRepositories(entries, includeCentral, inputName = _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES */ .W2) {
|
||||
function parseMavenRepositories(entries, includeCentral) {
|
||||
const repositories = [];
|
||||
const repositoryIds = new Set();
|
||||
entries.forEach((entry, index) => {
|
||||
@@ -195,7 +133,7 @@ function parseMavenRepositories(entries, includeCentral, inputName = _constants_
|
||||
const firstSeparator = entry.indexOf(':');
|
||||
const lastSeparator = entry.lastIndexOf(':');
|
||||
if (firstSeparator <= 0 || lastSeparator <= firstSeparator) {
|
||||
throw new Error(`Invalid ${inputName} entry at line ${index + 1}. Expected format: repository-id:repository-url:snapshots-enabled`);
|
||||
throw new Error(`Invalid mvn-repositories entry at line ${index + 1}. Expected format: repository-id:repository-url:snapshots-enabled`);
|
||||
}
|
||||
const id = entry.slice(0, firstSeparator).trim();
|
||||
const url = entry.slice(firstSeparator + 1, lastSeparator).trim();
|
||||
@@ -204,13 +142,13 @@ function parseMavenRepositories(entries, includeCentral, inputName = _constants_
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
if (!id || !url || !snapshotsValue) {
|
||||
throw new Error(`Invalid ${inputName} entry at line ${index + 1}. repository-id, repository URL, and snapshots-enabled are required`);
|
||||
throw new Error(`Invalid mvn-repositories entry at line ${index + 1}. repository-id, repository URL, and snapshots-enabled are required`);
|
||||
}
|
||||
if (snapshotsValue !== 'true' && snapshotsValue !== 'false') {
|
||||
throw new Error(`Invalid snapshots-enabled value '${snapshotsValue}' in ${inputName} entry at line ${index + 1}. Expected true or false`);
|
||||
throw new Error(`Invalid snapshots-enabled value '${snapshotsValue}' in mvn-repositories entry at line ${index + 1}. Expected true or false`);
|
||||
}
|
||||
if (repositoryIds.has(id)) {
|
||||
throw new Error(`Duplicate repository-id '${id}' in ${inputName} input`);
|
||||
throw new Error(`Duplicate repository-id '${id}' in mvn-repositories input`);
|
||||
}
|
||||
if (includeCentral && id === _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg) {
|
||||
throw new Error(`Repository-id '${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg}' is reserved when ${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL */ .H5} is enabled`);
|
||||
@@ -224,77 +162,15 @@ function parseMavenRepositories(entries, includeCentral, inputName = _constants_
|
||||
});
|
||||
return repositories;
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function parseMavenMirrors(entries) {
|
||||
const mirrors = [];
|
||||
const mirrorIds = new Set();
|
||||
entries.forEach((entry, index) => {
|
||||
if (!entry.trim()) {
|
||||
return;
|
||||
}
|
||||
const separator = entry.indexOf(':');
|
||||
const remainder = entry.slice(separator + 1).trim();
|
||||
// Protect scheme/authority colons (including IPv6 and ports) before
|
||||
// finding the selector, which may itself contain external:http:*.
|
||||
const urlPrefix = /^[A-Za-z][A-Za-z0-9+.-]*:(?:\/\/(?:[^/?#@\s]*@)?(?:\[[^\]]+\]|[^:/?#\s]+)(?::\d+(?=[/?#:\s]|$))?)?/.exec(remainder)?.[0] ?? '';
|
||||
const fields = /^(.*?):((?:\s*!?external:(?:http:)?\*\s*|[^:,]*)(?:,(?:\s*!?external:(?:http:)?\*\s*|[^:,]*))*)$/.exec(remainder.slice(urlPrefix.length));
|
||||
if (separator < 0 || !fields) {
|
||||
throw new Error(`Invalid mvn-mirrors entry at line ${index + 1}. Expected format: mirror-id:mirror-url:mirror-of`);
|
||||
}
|
||||
const id = entry.slice(0, separator).trim();
|
||||
const url = `${urlPrefix}${fields[1]}`.trim();
|
||||
const mirrorOf = fields[2].trim();
|
||||
if (!id || !url || !mirrorOf) {
|
||||
throw new Error(`Invalid mvn-mirrors entry at line ${index + 1}. mirror-id, mirror URL, and mirror-of are required`);
|
||||
}
|
||||
if (mirrorIds.has(id)) {
|
||||
throw new Error(`Duplicate mirror-id '${id}' in mvn-mirrors input at line ${index + 1}`);
|
||||
}
|
||||
mirrorIds.add(id);
|
||||
mirrors.push({ id, url, mirrorOf });
|
||||
});
|
||||
return mirrors;
|
||||
}
|
||||
function generateRepositorySection(customRepositories, settings, element) {
|
||||
if (!customRepositories.length && settings.includeCentral) {
|
||||
return [];
|
||||
}
|
||||
const centralRepository = {
|
||||
id: _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg,
|
||||
url: _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_URL */ .jv,
|
||||
snapshotsEnabled: false
|
||||
};
|
||||
const customCentralConfigured = customRepositories.some(repository => repository.id === _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg);
|
||||
const repositories = settings.includeCentral
|
||||
? settings.prioritizeCentral
|
||||
? [centralRepository, ...customRepositories]
|
||||
: [...customRepositories, centralRepository]
|
||||
: customCentralConfigured
|
||||
? customRepositories
|
||||
: [...customRepositories, { ...centralRepository, releasesEnabled: false }];
|
||||
const container = element === 'repository' ? 'repositories' : 'pluginRepositories';
|
||||
const lines = [` <${container}>`];
|
||||
for (const repository of repositories) {
|
||||
lines.push(` <${element}>`, ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(repository.id)}</id>`, ` <url>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(repository.url)}</url>`, ...(repository.releasesEnabled === undefined
|
||||
? []
|
||||
: [
|
||||
' <releases>',
|
||||
` <enabled>${repository.releasesEnabled}</enabled>`,
|
||||
' </releases>'
|
||||
]), ' <snapshots>', ` <enabled>${repository.snapshotsEnabled}</enabled>`, ' </snapshots>', ` </${element}>`);
|
||||
}
|
||||
lines.push(` </${container}>`);
|
||||
return lines;
|
||||
}
|
||||
async function createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar = undefined, repositorySettings = undefined, mirrors = []) {
|
||||
async function createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar = undefined, repositorySettings = undefined) {
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .info */ .pq(`Creating ${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MVN_SETTINGS_FILE */ .vO} with server-id: ${servers.map(server => server.id).join(', ')}`);
|
||||
// when an alternate m2 location is specified use only that location (no .m2 directory)
|
||||
// otherwise use the home/.m2/ path
|
||||
await _actions_io__WEBPACK_IMPORTED_MODULE_2__/* .mkdirP */ .U$(settingsDirectory);
|
||||
await write(settingsDirectory, generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors), overwriteSettings);
|
||||
await write(settingsDirectory, generate(servers, gpgPassphraseEnvVar, repositorySettings), overwriteSettings);
|
||||
}
|
||||
// only exported for testing purposes
|
||||
function generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors = []) {
|
||||
function generate(servers, gpgPassphraseEnvVar, repositorySettings) {
|
||||
// The maven-gpg-plugin reads the passphrase from the environment variable
|
||||
// named by the `gpg.passphraseEnvName` property (default MAVEN_GPG_PASSPHRASE).
|
||||
// Only configure it when the requested env var name differs from that default;
|
||||
@@ -311,28 +187,39 @@ function generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors = []
|
||||
' <servers>'
|
||||
];
|
||||
for (const server of servers) {
|
||||
lines.push(' <server>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(server.id)}</id>`, ` <username>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.usernameEnvVar}}`)}</username>`, ` <password>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.passwordEnvVar}}`)}</password>`);
|
||||
if (server.repositoryOrigins) {
|
||||
lines.push(' <repositoryOrigins>');
|
||||
for (const origin of server.repositoryOrigins) {
|
||||
lines.push(` <repositoryOrigin>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(origin)}</repositoryOrigin>`);
|
||||
}
|
||||
lines.push(' </repositoryOrigins>');
|
||||
}
|
||||
lines.push(' </server>');
|
||||
lines.push(' <server>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(server.id)}</id>`, ` <username>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.usernameEnvVar}}`)}</username>`, ` <password>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.passwordEnvVar}}`)}</password>`, ' </server>');
|
||||
}
|
||||
lines.push(' </servers>');
|
||||
if (mirrors.length) {
|
||||
lines.push(' <mirrors>');
|
||||
for (const mirror of mirrors) {
|
||||
lines.push(' <mirror>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.id)}</id>`, ` <url>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.url)}</url>`, ` <mirrorOf>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.mirrorOf)}</mirrorOf>`, ' </mirror>');
|
||||
}
|
||||
lines.push(' </mirrors>');
|
||||
}
|
||||
if (repositorySettings || includeGpgPassphraseProfile) {
|
||||
lines.push(' <profiles>');
|
||||
if (repositorySettings) {
|
||||
lines.push(' <profile>', ` <id>${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_REPOSITORIES_PROFILE_ID */ .hq}</id>`, ...generateRepositorySection(repositorySettings.repositories, repositorySettings, 'repository'), ...generateRepositorySection(repositorySettings.pluginRepositories ?? [], repositorySettings, 'pluginRepository'), ' </profile>');
|
||||
const centralRepository = {
|
||||
id: _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg,
|
||||
url: _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_URL */ .jv,
|
||||
snapshotsEnabled: false
|
||||
};
|
||||
const customCentralConfigured = repositorySettings.repositories.some(repository => repository.id === _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_CENTRAL_REPOSITORY_ID */ .xg);
|
||||
const repositories = repositorySettings.includeCentral
|
||||
? repositorySettings.prioritizeCentral
|
||||
? [centralRepository, ...repositorySettings.repositories]
|
||||
: [...repositorySettings.repositories, centralRepository]
|
||||
: customCentralConfigured
|
||||
? repositorySettings.repositories
|
||||
: [
|
||||
...repositorySettings.repositories,
|
||||
{ ...centralRepository, releasesEnabled: false }
|
||||
];
|
||||
lines.push(' <profile>', ` <id>${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MAVEN_REPOSITORIES_PROFILE_ID */ .hq}</id>`, ' <repositories>');
|
||||
for (const repository of repositories) {
|
||||
lines.push(' <repository>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(repository.id)}</id>`, ` <url>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(repository.url)}</url>`, ...(repository.releasesEnabled === undefined
|
||||
? []
|
||||
: [
|
||||
' <releases>',
|
||||
` <enabled>${repository.releasesEnabled}</enabled>`,
|
||||
' </releases>'
|
||||
]), ' <snapshots>', ` <enabled>${repository.snapshotsEnabled}</enabled>`, ' </snapshots>', ' </repository>');
|
||||
}
|
||||
lines.push(' </repositories>', ' </profile>');
|
||||
}
|
||||
if (includeGpgPassphraseProfile) {
|
||||
lines.push(' <profile>', ` <id>${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .GPG_PASSPHRASE_PROFILE_ID */ .K$}</id>`, ' <properties>', ` <gpg.passphraseEnvName>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(gpgPassphraseEnvVar)}</gpg.passphraseEnvName>`, ' </properties>', ' </profile>');
|
||||
|
||||
Vendored
+1
-7
@@ -5871,7 +5871,6 @@ function isLeafTag(obj, options) {
|
||||
// EXTERNAL MODULE: ./node_modules/fast-xml-parser/src/validator.js
|
||||
var validator = __webpack_require__(1176);
|
||||
;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
||||
/* global Uint8Array */
|
||||
|
||||
|
||||
|
||||
@@ -5892,12 +5891,7 @@ class XMLParser {
|
||||
*/
|
||||
parse(xmlData, validationOption) {
|
||||
if (typeof xmlData !== "string" && xmlData.toString) {
|
||||
if (xmlData instanceof Uint8Array &&
|
||||
!(typeof Buffer !== "undefined" && Buffer.isBuffer(xmlData))) {
|
||||
xmlData = new TextDecoder("utf-8", { ignoreBOM: true }).decode(xmlData);
|
||||
} else {
|
||||
xmlData = xmlData.toString();
|
||||
}
|
||||
xmlData = xmlData.toString();
|
||||
} else if (typeof xmlData !== "string") {
|
||||
throw new Error("XML data is accepted in String or Bytes[] form.")
|
||||
}
|
||||
|
||||
Vendored
+84
-195
@@ -7217,7 +7217,7 @@ function defaultFactory (origin, opts) {
|
||||
}
|
||||
|
||||
class Agent extends DispatcherBase {
|
||||
constructor ({ factory = defaultFactory, maxRedirections = 0, connect, tls, ...options } = {}) {
|
||||
constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
|
||||
if (typeof factory !== 'function') {
|
||||
throw new InvalidArgumentError('factory must be a function.')
|
||||
}
|
||||
@@ -7236,15 +7236,11 @@ class Agent extends DispatcherBase {
|
||||
connect = { ...connect }
|
||||
}
|
||||
|
||||
if (tls && typeof tls !== 'function') {
|
||||
tls = { ...tls }
|
||||
}
|
||||
|
||||
this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent)
|
||||
? options.interceptors.Agent
|
||||
: [createRedirectInterceptor({ maxRedirections })]
|
||||
|
||||
this[kOptions] = { ...util.deepClone(options), connect, tls }
|
||||
this[kOptions] = { ...util.deepClone(options), connect }
|
||||
this[kOptions].interceptors = options.interceptors
|
||||
? { ...options.interceptors }
|
||||
: undefined
|
||||
@@ -8277,6 +8273,8 @@ async function connectH1 (client, socket) {
|
||||
socket[kParser] = new Parser(client, socket, llhttpInstance)
|
||||
|
||||
addListener(socket, 'error', function (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
const parser = this[kParser]
|
||||
|
||||
// On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
|
||||
@@ -9206,6 +9204,8 @@ async function connectH2 (client, socket) {
|
||||
socket[kHTTP2Session] = session
|
||||
|
||||
util.addListener(socket, 'error', function (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
this[kError] = err
|
||||
|
||||
this[kClient][kOnError](err)
|
||||
@@ -9279,6 +9279,8 @@ function resumeH2 (client) {
|
||||
}
|
||||
|
||||
function onHttp2SessionError (err) {
|
||||
assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
|
||||
|
||||
this[kSocket][kError] = err
|
||||
this[kClient][kOnError](err)
|
||||
}
|
||||
@@ -9976,10 +9978,9 @@ class Client extends DispatcherBase {
|
||||
// h2
|
||||
maxConcurrentStreams,
|
||||
allowH2,
|
||||
webSocket,
|
||||
eventSource
|
||||
webSocket
|
||||
} = {}) {
|
||||
super({ webSocket, eventSource })
|
||||
super({ webSocket })
|
||||
|
||||
if (keepAlive !== undefined) {
|
||||
throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
|
||||
@@ -10500,7 +10501,6 @@ module.exports = Client
|
||||
|
||||
|
||||
|
||||
const buffer = __nccwpck_require__(4573)
|
||||
const Dispatcher = __nccwpck_require__(883)
|
||||
const {
|
||||
ClientDestroyedError,
|
||||
@@ -10513,7 +10513,6 @@ const kOnDestroyed = Symbol('onDestroyed')
|
||||
const kOnClosed = Symbol('onClosed')
|
||||
const kInterceptedDispatch = Symbol('Intercepted Dispatch')
|
||||
const kWebSocketOptions = Symbol('webSocketOptions')
|
||||
const kEventSourceOptions = Symbol('eventSourceOptions')
|
||||
|
||||
class DispatcherBase extends Dispatcher {
|
||||
constructor (opts) {
|
||||
@@ -10524,7 +10523,6 @@ class DispatcherBase extends Dispatcher {
|
||||
this[kClosed] = false
|
||||
this[kOnClosed] = []
|
||||
this[kWebSocketOptions] = opts?.webSocket ?? {}
|
||||
this[kEventSourceOptions] = opts?.eventSource ?? {}
|
||||
}
|
||||
|
||||
get webSocketOptions () {
|
||||
@@ -10534,12 +10532,6 @@ class DispatcherBase extends Dispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
get eventSourceOptions () {
|
||||
return {
|
||||
maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer.kStringMaxLength
|
||||
}
|
||||
}
|
||||
|
||||
get destroyed () {
|
||||
return this[kDestroyed]
|
||||
}
|
||||
@@ -16898,7 +16890,6 @@ module.exports = {
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
|
||||
const buffer = __nccwpck_require__(4573)
|
||||
const { Transform } = __nccwpck_require__(7075)
|
||||
const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(4811)
|
||||
|
||||
@@ -16923,19 +16914,11 @@ const COLON = 0x3A
|
||||
*/
|
||||
const SPACE = 0x20
|
||||
|
||||
const defaultMaxEventSize = buffer.kStringMaxLength
|
||||
|
||||
const DATA = Buffer.from('data')
|
||||
const EVENT = Buffer.from('event')
|
||||
const ID = Buffer.from('id')
|
||||
const RETRY = Buffer.from('retry')
|
||||
|
||||
// Each data field creates a string node, and each unconsumed input chunk keeps
|
||||
// a Buffer wrapper. The absolute ceiling protects the large default byte limit.
|
||||
const minParserItems = 1024
|
||||
const maxParserItems = 131072
|
||||
const bytesPerParserItem = 128
|
||||
|
||||
function isASCIINumberBytes (buffer, start) {
|
||||
if (start >= buffer.length) {
|
||||
return false
|
||||
@@ -16974,12 +16957,6 @@ function isFieldName (line, length, field) {
|
||||
return true
|
||||
}
|
||||
|
||||
function createMaxEventSizeExceededError () {
|
||||
const error = new Error('EventSource message size exceeded')
|
||||
error.aborted = false
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} EventSourceStreamEvent
|
||||
* @type {object}
|
||||
@@ -17028,13 +17005,6 @@ class EventSourceStream extends Transform {
|
||||
pos = 0
|
||||
lineChunkIndex = 0
|
||||
linePos = 0
|
||||
lineLength = 0
|
||||
eventSize = 0
|
||||
eventFieldSizes = { data: 0, event: 0, id: 0, retry: 0 }
|
||||
dataLineCount = 0
|
||||
maxEventSize
|
||||
maxDataLines
|
||||
maxBufferedChunks
|
||||
|
||||
event = {
|
||||
data: undefined,
|
||||
@@ -17045,7 +17015,6 @@ class EventSourceStream extends Transform {
|
||||
|
||||
/**
|
||||
* @param {object} options
|
||||
* @param {number} [options.maxEventSize]
|
||||
* @param {eventSourceSettings} options.eventSourceSettings
|
||||
* @param {Function} [options.push]
|
||||
*/
|
||||
@@ -17057,12 +17026,6 @@ class EventSourceStream extends Transform {
|
||||
super(options)
|
||||
|
||||
this.state = options.eventSourceSettings || {}
|
||||
this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize
|
||||
const parserItemLimit = this.maxEventSize > 0
|
||||
? Math.min(maxParserItems, Math.max(minParserItems, Math.floor(this.maxEventSize / bytesPerParserItem)))
|
||||
: 0
|
||||
this.maxDataLines = parserItemLimit
|
||||
this.maxBufferedChunks = parserItemLimit
|
||||
if (options.push) {
|
||||
this.push = options.push
|
||||
}
|
||||
@@ -17080,14 +17043,6 @@ class EventSourceStream extends Transform {
|
||||
return
|
||||
}
|
||||
|
||||
// A leading line ending can immediately release the currently buffered
|
||||
// line, even when it uses the final allowed chunk slot.
|
||||
if (this.maxEventSize > 0 &&
|
||||
this.chunks.length >= this.maxBufferedChunks &&
|
||||
chunk[0] !== LF && chunk[0] !== CR) {
|
||||
callback(createMaxEventSizeExceededError())
|
||||
return
|
||||
}
|
||||
this.chunks.push(chunk)
|
||||
|
||||
// Strip leading byte-order-mark if we opened the stream and started
|
||||
@@ -17166,12 +17121,7 @@ class EventSourceStream extends Transform {
|
||||
|
||||
// In any case, we can process the line as we reached an
|
||||
// end-of-line character
|
||||
try {
|
||||
this.parseLine(this.readLine(), this.event)
|
||||
} catch (error) {
|
||||
callback(error)
|
||||
return
|
||||
}
|
||||
this.parseLine(this.readLine(), this.event)
|
||||
this.consumeCurrentByte()
|
||||
// A line was processed and this could be the end of the event. We need
|
||||
// to check if the next line is empty to determine if the event is
|
||||
@@ -17180,28 +17130,15 @@ class EventSourceStream extends Transform {
|
||||
continue
|
||||
}
|
||||
|
||||
// readLine() is only called after CR or LF. Reject an unfinished line
|
||||
// before it can retain an unbounded number of decoded chunks. The seven
|
||||
// extra bytes allow the longest field prefix ("event: " or "retry: ").
|
||||
if (this.maxEventSize > 0 && ++this.lineLength > this.maxEventSize + 7) {
|
||||
callback(createMaxEventSizeExceededError())
|
||||
return
|
||||
}
|
||||
this.advanceCursor()
|
||||
}
|
||||
|
||||
callback()
|
||||
}
|
||||
|
||||
_destroy (error, callback) {
|
||||
this.chunks.length = 0
|
||||
this.clearEvent()
|
||||
super._destroy(error, callback)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Buffer} line
|
||||
* @param {EventSourceStreamEvent} event
|
||||
* @param {EventStreamEvent} event
|
||||
*/
|
||||
parseLine (line, event) {
|
||||
// If the line is empty (a blank line)
|
||||
@@ -17235,13 +17172,6 @@ class EventSourceStream extends Transform {
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, DATA)) {
|
||||
if (this.maxEventSize > 0 && this.dataLineCount >= this.maxDataLines) {
|
||||
throw createMaxEventSizeExceededError()
|
||||
}
|
||||
const valueBytes = line.length - valueStart
|
||||
const dataSize = this.eventFieldSizes.data + (event.data === undefined ? 0 : 1) + valueBytes
|
||||
this.setEventFieldSize('data', dataSize)
|
||||
|
||||
const value = line.toString('utf8', valueStart)
|
||||
|
||||
if (event.data === undefined) {
|
||||
@@ -17249,13 +17179,11 @@ class EventSourceStream extends Transform {
|
||||
} else {
|
||||
event.data += `\n${value}`
|
||||
}
|
||||
this.dataLineCount++
|
||||
return
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, RETRY)) {
|
||||
if (isASCIINumberBytes(line, valueStart)) {
|
||||
this.setEventFieldSize('retry', line.length - valueStart)
|
||||
event.retry = line.toString('utf8', valueStart)
|
||||
}
|
||||
return
|
||||
@@ -17263,29 +17191,20 @@ class EventSourceStream extends Transform {
|
||||
|
||||
if (isFieldName(line, fieldLength, ID)) {
|
||||
if (isValidLastEventIdBytes(line, valueStart)) {
|
||||
this.setEventFieldSize('id', line.length - valueStart)
|
||||
event.id = line.toString('utf8', valueStart)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (isFieldName(line, fieldLength, EVENT)) {
|
||||
if (valueStart < line.length) {
|
||||
this.setEventFieldSize('event', line.length - valueStart)
|
||||
event.event = line.toString('utf8', valueStart)
|
||||
const value = line.toString('utf8', valueStart)
|
||||
|
||||
if (value.length > 0) {
|
||||
event.event = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEventFieldSize (field, size) {
|
||||
const eventSize = this.eventSize - this.eventFieldSizes[field] + size
|
||||
if (this.maxEventSize > 0 && eventSize > this.maxEventSize) {
|
||||
throw createMaxEventSizeExceededError()
|
||||
}
|
||||
this.eventSize = eventSize
|
||||
this.eventFieldSizes[field] = size
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {EventSourceStreamEvent} event
|
||||
*/
|
||||
@@ -17316,12 +17235,6 @@ class EventSourceStream extends Transform {
|
||||
this.event.event = undefined
|
||||
this.event.id = undefined
|
||||
this.event.retry = undefined
|
||||
this.eventSize = 0
|
||||
this.dataLineCount = 0
|
||||
this.eventFieldSizes.data = 0
|
||||
this.eventFieldSizes.event = 0
|
||||
this.eventFieldSizes.id = 0
|
||||
this.eventFieldSizes.retry = 0
|
||||
}
|
||||
|
||||
hasPendingEvent () {
|
||||
@@ -17357,16 +17270,14 @@ class EventSourceStream extends Transform {
|
||||
syncLineStartToCursor () {
|
||||
this.lineChunkIndex = this.chunkIndex
|
||||
this.linePos = this.pos
|
||||
this.lineLength = 0
|
||||
this.dropConsumedChunks()
|
||||
}
|
||||
|
||||
dropConsumedChunks () {
|
||||
if (this.lineChunkIndex > 0) {
|
||||
const consumed = this.lineChunkIndex
|
||||
this.chunks.splice(0, consumed)
|
||||
this.lineChunkIndex = 0
|
||||
this.chunkIndex -= consumed
|
||||
while (this.lineChunkIndex > 0) {
|
||||
this.chunks.shift()
|
||||
this.lineChunkIndex--
|
||||
this.chunkIndex--
|
||||
}
|
||||
|
||||
if (this.chunkIndex === this.chunks.length) {
|
||||
@@ -17491,7 +17402,6 @@ const { isNetworkError } = __nccwpck_require__(9051)
|
||||
const { delay } = __nccwpck_require__(4811)
|
||||
const { kEnumerableProperty } = __nccwpck_require__(3440)
|
||||
const { environmentSettingsObject } = __nccwpck_require__(3168)
|
||||
const { getGlobalDispatcher } = __nccwpck_require__(2581)
|
||||
|
||||
let experimentalWarned = false
|
||||
|
||||
@@ -17773,7 +17683,6 @@ class EventSource extends EventTarget {
|
||||
|
||||
const eventSourceStream = new EventSourceStream({
|
||||
eventSourceSettings: this.#state,
|
||||
maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize,
|
||||
push: (event) => {
|
||||
this.dispatchEvent(createFastMessageEvent(
|
||||
event.type,
|
||||
@@ -17952,8 +17861,7 @@ webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([
|
||||
},
|
||||
{
|
||||
key: 'dispatcher', // undici only
|
||||
converter: webidl.converters.any,
|
||||
defaultValue: () => getGlobalDispatcher()
|
||||
converter: webidl.converters.any
|
||||
}
|
||||
])
|
||||
|
||||
@@ -23049,10 +22957,8 @@ async function httpNetworkFetch (
|
||||
// 19. Run these steps in parallel:
|
||||
|
||||
// 1. Run these steps, but abort when fetchParams is canceled:
|
||||
if (!fetchParams.controller.resume) {
|
||||
fetchParams.controller.on('terminated', onAborted)
|
||||
}
|
||||
|
||||
fetchParams.controller.onAborted = onAborted
|
||||
fetchParams.controller.on('terminated', onAborted)
|
||||
fetchParams.controller.resume = async () => {
|
||||
// 1. While true
|
||||
while (true) {
|
||||
@@ -23221,6 +23127,8 @@ async function httpNetworkFetch (
|
||||
}
|
||||
location = headersList.get('location', true)
|
||||
|
||||
this.body = new Readable({ read: resume })
|
||||
|
||||
const decoders = []
|
||||
|
||||
const willFollow = location && request.redirect === 'follow' &&
|
||||
@@ -23238,7 +23146,7 @@ async function httpNetworkFetch (
|
||||
// CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206).
|
||||
const maxContentEncodings = 5
|
||||
if (codings.length > maxContentEncodings) {
|
||||
this.abort(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
||||
reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -23271,8 +23179,6 @@ async function httpNetworkFetch (
|
||||
}
|
||||
}
|
||||
|
||||
this.body = new Readable({ read: resume })
|
||||
|
||||
const onError = this.onError.bind(this)
|
||||
|
||||
resolve({
|
||||
@@ -23319,6 +23225,10 @@ async function httpNetworkFetch (
|
||||
fetchParams.controller.off('terminated', this.abort)
|
||||
}
|
||||
|
||||
if (fetchParams.controller.onAborted) {
|
||||
fetchParams.controller.off('terminated', fetchParams.controller.onAborted)
|
||||
}
|
||||
|
||||
fetchParams.controller.ended = true
|
||||
|
||||
this.body.push(null)
|
||||
@@ -29793,20 +29703,6 @@ class ByteParser extends Writable {
|
||||
if (isControlFrame(this.#info.opcode)) {
|
||||
this.#loop = this.parseControlFrame(body)
|
||||
this.#state = parserStates.INFO
|
||||
|
||||
// If the automatic PONG/CLOSE reply filled the socket's write buffer,
|
||||
// stop parsing and resume on drain so a PING flood cannot grow the
|
||||
// outbound queue without bound.
|
||||
const socket = this.ws[kResponse].socket
|
||||
if (this.#loop && socket.writableNeedDrain) {
|
||||
this.#loop = false
|
||||
socket.once('drain', () => {
|
||||
if (this.destroyed) return
|
||||
this.#loop = true
|
||||
this.run(callback)
|
||||
})
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (!this.#info.compressed) {
|
||||
if (!this.writeFragments(body)) {
|
||||
@@ -31144,14 +31040,12 @@ module.exports = {
|
||||
/* harmony export */ GL: () => (/* binding */ INPUT_CACHE_JDK),
|
||||
/* harmony export */ H5: () => (/* binding */ INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL),
|
||||
/* harmony export */ I9: () => (/* binding */ INPUT_FORCE_DOWNLOAD),
|
||||
/* harmony export */ K: () => (/* binding */ INPUT_MVN_MIRRORS),
|
||||
/* harmony export */ K$: () => (/* binding */ GPG_PASSPHRASE_PROFILE_ID),
|
||||
/* harmony export */ LS: () => (/* binding */ INPUT_ARCHITECTURE),
|
||||
/* harmony export */ MM: () => (/* binding */ INPUT_MVN_SERVER_CREDENTIALS),
|
||||
/* harmony export */ OD: () => (/* binding */ INPUT_DEFAULT_GPG_PRIVATE_KEY),
|
||||
/* harmony export */ OT: () => (/* binding */ INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL),
|
||||
/* harmony export */ PG: () => (/* binding */ MACOS_JAVA_CONTENT_POSTFIX),
|
||||
/* harmony export */ Pt: () => (/* binding */ INPUT_MVN_SERVER_REPOSITORY_ORIGINS),
|
||||
/* harmony export */ QM: () => (/* binding */ INPUT_JAVA_VERSION),
|
||||
/* harmony export */ RX: () => (/* binding */ INPUT_DEFAULT_GPG_PASSPHRASE),
|
||||
/* harmony export */ TS: () => (/* binding */ INPUT_OVERWRITE_SETTINGS),
|
||||
@@ -31166,7 +31060,6 @@ module.exports = {
|
||||
/* harmony export */ af: () => (/* binding */ INPUT_JAVA_VERSION_FILE),
|
||||
/* harmony export */ db: () => (/* binding */ INPUT_GPG_PASSPHRASE_ENV_VAR),
|
||||
/* harmony export */ fd: () => (/* binding */ INPUT_SERVER_ID),
|
||||
/* harmony export */ gR: () => (/* binding */ INPUT_MVN_PLUGIN_REPOSITORIES),
|
||||
/* harmony export */ g_: () => (/* binding */ INPUT_DISTRIBUTION),
|
||||
/* harmony export */ gk: () => (/* binding */ INPUT_CACHE),
|
||||
/* harmony export */ hq: () => (/* binding */ MAVEN_REPOSITORIES_PROFILE_ID),
|
||||
@@ -31213,10 +31106,7 @@ const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
|
||||
const SIGNATURE_VERIFICATION_DOCUMENTATION_URL = 'https://github.com/actions/setup-java#download-integrity-and-signatures';
|
||||
const SIGNATURE_VERIFICATION_FAILURE_HELP = `If this is a legitimate vendor signing-key rotation, see ${SIGNATURE_VERIFICATION_DOCUMENTATION_URL} for instructions to configure the updated public key or temporarily disable signature verification.`;
|
||||
const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
|
||||
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
|
||||
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
|
||||
const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
|
||||
const INPUT_MVN_MIRRORS = 'mvn-mirrors';
|
||||
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
|
||||
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';
|
||||
const INPUT_SERVER_ID = 'server-id';
|
||||
@@ -31388,7 +31278,9 @@ function createUnsupportedPackageError(distributionName, packageType, supportedP
|
||||
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(2088);
|
||||
/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nccwpck_require__.n(semver__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _package_types_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(7835);
|
||||
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4527);
|
||||
/* harmony import */ var _package_types_js__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(7835);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31402,21 +31294,21 @@ const STANDARD_LINUX = [
|
||||
's390x'
|
||||
];
|
||||
const JAVA_PLATFORM_CAPABILITIES = {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Temurin]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Temurin]: {
|
||||
platforms: {
|
||||
linux: [...STANDARD_LINUX, { architecture: 'armv7', versionRange: '<18' }],
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64', 'x86', 'aarch64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Zulu]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Zulu]: {
|
||||
platforms: {
|
||||
linux: ['x64', 'x86', 'armv7', 'aarch64'],
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64', 'x86', 'aarch64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Liberica]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Liberica]: {
|
||||
platforms: {
|
||||
linux: ['x64', 'x86', 'armv7', 'aarch64', 'ppc64le'],
|
||||
macos: X64_ARM64,
|
||||
@@ -31424,31 +31316,31 @@ const JAVA_PLATFORM_CAPABILITIES = {
|
||||
solaris: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.LibericaNik]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.LibericaNik]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: X64_ARM64
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.JdkFile]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.JdkFile]: {
|
||||
unrestricted: true
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Microsoft]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Microsoft]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: X64_ARM64
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Semeru]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Semeru]: {
|
||||
platforms: {
|
||||
linux: ['x64', 'x86', 'ppc64le', 'ppc64', 's390x', 'aarch64'],
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64', 'aarch64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Corretto]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Corretto]: {
|
||||
platforms: {
|
||||
linux: [
|
||||
'x64',
|
||||
@@ -31460,62 +31352,62 @@ const JAVA_PLATFORM_CAPABILITIES = {
|
||||
windows: ['x64', { architecture: 'x86', versionRange: '<12' }]
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Oracle]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Oracle]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Dragonwell]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Dragonwell]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.SapMachine]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.SapMachine]: {
|
||||
platforms: {
|
||||
linux: ['x64', 'aarch64', 'ppc64le'],
|
||||
macos: X64_ARM64,
|
||||
windows: X64_ARM64
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.GraalVM]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.GraalVM]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.GraalVMCommunity]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.GraalVMCommunity]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.JetBrains]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.JetBrains]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: X64_ARM64
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.Kona]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.Kona]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.OracleOpenJdk]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.OracleOpenJdk]: {
|
||||
platforms: {
|
||||
linux: X64_ARM64,
|
||||
macos: X64_ARM64,
|
||||
windows: ['x64']
|
||||
}
|
||||
},
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_2__/* .JavaDistribution */ .zS.RedHat]: {
|
||||
[_package_types_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaDistribution */ .zS.RedHat]: {
|
||||
platforms: {
|
||||
linux: [
|
||||
'x64',
|
||||
@@ -31602,26 +31494,15 @@ function isJavaDistribution(value) {
|
||||
return Object.prototype.hasOwnProperty.call(JAVA_PLATFORM_CAPABILITIES, value);
|
||||
}
|
||||
function isVersionCompatible(version, supportedRange) {
|
||||
let normalizedVersion = version.trim().toLowerCase();
|
||||
const normalizedVersion = version.trim().toLowerCase();
|
||||
if (normalizedVersion === 'latest') {
|
||||
return true;
|
||||
}
|
||||
if (/^\d+(\.\d+){3,}$/.test(normalizedVersion)) {
|
||||
normalizedVersion = normalizeExtendedVersionToSemver(normalizedVersion);
|
||||
}
|
||||
const requestedRange = semver__WEBPACK_IMPORTED_MODULE_1___default().validRange(normalizedVersion.replace(/-ea$/, ''));
|
||||
const requestedRange = semver__WEBPACK_IMPORTED_MODULE_1___default().validRange((0,_util_js__WEBPACK_IMPORTED_MODULE_2__/* .normalizeJavaVersionToSemver */ .zZ)(normalizedVersion.replace(/-ea$/, '').replace('-ea.', '+')));
|
||||
const capabilityRange = semver__WEBPACK_IMPORTED_MODULE_1___default().validRange(supportedRange);
|
||||
if (!requestedRange || !capabilityRange) {
|
||||
return true;
|
||||
}
|
||||
function normalizeExtendedVersionToSemver(version) {
|
||||
const versionParts = version.split('.');
|
||||
const mainVersion = versionParts.slice(0, 3).join('.');
|
||||
if (versionParts.length > 3) {
|
||||
return `${mainVersion}+${versionParts.slice(3).join('.')}`;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
return semver__WEBPACK_IMPORTED_MODULE_1___default().intersects(requestedRange, capabilityRange, {
|
||||
includePrerelease: true
|
||||
});
|
||||
@@ -31676,7 +31557,6 @@ function validateToolchainIds(versions, versionFile, toolchainIds) {
|
||||
/* harmony export */ ZY: () => (/* binding */ convertVersionToSemver),
|
||||
/* harmony export */ aT: () => (/* binding */ isGhes),
|
||||
/* harmony export */ ag: () => (/* binding */ getDownloadArchiveExtension),
|
||||
/* harmony export */ kI: () => (/* binding */ isExactCorrettoVersion),
|
||||
/* harmony export */ lK: () => (/* binding */ getGitHubToken),
|
||||
/* harmony export */ lN: () => (/* binding */ isJdkCacheEnabled),
|
||||
/* harmony export */ n2: () => (/* binding */ renameWinArchive),
|
||||
@@ -31993,15 +31873,6 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||
}
|
||||
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||
const rawVersion = tentativeVersion.split('-')[0];
|
||||
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
|
||||
if ((extractedDistribution || distributionName) === 'corretto' &&
|
||||
capturedVersion === tentativeVersion &&
|
||||
isExactCorrettoVersion(tentativeVersion)) {
|
||||
return {
|
||||
version: tentativeVersion,
|
||||
distribution: extractedDistribution
|
||||
};
|
||||
}
|
||||
let version = semver__WEBPACK_IMPORTED_MODULE_3__.validRange(rawVersion)
|
||||
? tentativeVersion
|
||||
: semver__WEBPACK_IMPORTED_MODULE_3__.coerce(tentativeVersion);
|
||||
@@ -32085,10 +31956,6 @@ function mapAsdfDistribution(asdfDist) {
|
||||
function avoidOldNotation(content) {
|
||||
return content.startsWith('1.') ? content.substring(2) : content;
|
||||
}
|
||||
function isExactCorrettoVersion(version) {
|
||||
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
|
||||
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(version.replace('+', '.'));
|
||||
}
|
||||
function convertVersionToSemver(version) {
|
||||
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
|
||||
const versionArray = Array.isArray(version) ? version : version.split('.');
|
||||
@@ -32099,18 +31966,26 @@ function convertVersionToSemver(version) {
|
||||
return mainVersion;
|
||||
}
|
||||
/**
|
||||
* Java versions (JEP 322) can contain more numeric fields than SemVer allows,
|
||||
* e.g. '11.0.9.1' or Temurin respins such as '26.0.2.1+1'. Move the extra
|
||||
* fields into SemVer build metadata ('11.0.9+1', '26.0.2+1.1'). Any other
|
||||
* input (ranges, regular SemVer versions) is returned unchanged.
|
||||
* Normalize numeric Java versions, optionally prefixed with 'jdk-'. Pad
|
||||
* abbreviated build requests ('27+35' -> '27.0.0+35') to preserve exact
|
||||
* matching, and move extra JEP 322 fields into build metadata
|
||||
* ('26.0.2.1+1' -> '26.0.2+1.1'). Leave ranges unchanged.
|
||||
*/
|
||||
function normalizeJavaVersionToSemver(version) {
|
||||
const match = /^(\d+(?:\.\d+){3,})(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
const match = /^(?:jdk-)?(\d+(?:\.\d+)*)(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
if (!match) {
|
||||
return version;
|
||||
}
|
||||
const converted = convertVersionToSemver(match[1]);
|
||||
return match[2] ? `${converted}.${match[2]}` : converted;
|
||||
const versionParts = match[1].split('.');
|
||||
if (match[2]) {
|
||||
while (versionParts.length < 3) {
|
||||
versionParts.push('0');
|
||||
}
|
||||
}
|
||||
const converted = convertVersionToSemver(versionParts.join('.'));
|
||||
return match[2]
|
||||
? `${converted}${versionParts.length > 3 ? '.' : '+'}${match[2]}`
|
||||
: converted;
|
||||
}
|
||||
/**
|
||||
* Builds a validator for the bytes currently served by a URL from the response
|
||||
@@ -32373,6 +32248,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https")
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8995:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7030:
|
||||
/***/ ((module) => {
|
||||
|
||||
@@ -32387,6 +32269,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6760:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 643:
|
||||
/***/ ((module) => {
|
||||
|
||||
@@ -36893,7 +36782,7 @@ async function validateCacheInput(cache) {
|
||||
if (!cache) {
|
||||
return;
|
||||
}
|
||||
const { validatePackageManager } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
const { validatePackageManager } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
validatePackageManager(cache);
|
||||
}
|
||||
function settle(promise) {
|
||||
@@ -36972,11 +36861,11 @@ async function configureInstalledToolchains(toolchainConfigurations) {
|
||||
}
|
||||
}
|
||||
async function startCacheRestore(cache, cacheDependencyPath, cachePath) {
|
||||
const { isCacheFeatureAvailable } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(394)]).then(__nccwpck_require__.bind(__nccwpck_require__, 1394));
|
||||
const { isCacheFeatureAvailable } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(394)]).then(__nccwpck_require__.bind(__nccwpck_require__, 1394));
|
||||
if (!isCacheFeatureAvailable()) {
|
||||
return;
|
||||
}
|
||||
const { restore } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
const { restore } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
|
||||
await restore(cache, cacheDependencyPath, cachePath);
|
||||
}
|
||||
|
||||
|
||||
+11
-189
@@ -28,7 +28,6 @@
|
||||
- [Testing against different platforms](#Testing-against-different-platforms)
|
||||
- [Publishing using Apache Maven](#Publishing-using-Apache-Maven)
|
||||
- [Publishing to multiple Maven servers](#publishing-to-multiple-maven-servers)
|
||||
- [Redirecting Maven repositories with mirrors](#redirecting-maven-repositories-with-mirrors)
|
||||
- [Apache Maven with a settings path](#apache-maven-with-a-settings-path)
|
||||
- [Maven transfer progress (download logs)](#Maven-transfer-progress-download-logs)
|
||||
- [Java problem matcher (compiler annotations)](#java-problem-matcher-compiler-annotations)
|
||||
@@ -84,12 +83,6 @@ steps:
|
||||
|
||||
### Liberica
|
||||
|
||||
Exact patch releases use SDKMAN's `X.Y.Z+P.B` notation, including in `.sdkmanrc`.
|
||||
For example, `java=17.0.20+1.1-librca` selects BellSoft's `17.0.20.1+1` release.
|
||||
Alternatively, `java-version: '17.0.20.1'` selects the newest build of patch 1,
|
||||
whereas `java-version: '17.0.20+1'` selects the exact unpatched build 1.
|
||||
Floating versions such as `17` prefer newer patches before comparing build numbers.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
@@ -158,16 +151,7 @@ steps:
|
||||
```
|
||||
|
||||
### Amazon Corretto
|
||||
Amazon Corretto supports major versions (for example, `25`) and full release numbers
|
||||
(for example, `25.0.5.0.10`). Full release numbers select the versioned archive directly,
|
||||
including older releases no longer listed in the latest-version feed. SHA-256 checksums
|
||||
for exact releases come from Amazon's current download catalog or GitHub release notes.
|
||||
Historical releases without a published SHA-256 cannot be downloaded.
|
||||
|
||||
Full Corretto release numbers supplied through `java-version-file` now select that exact
|
||||
release; previously they selected the latest matching major. Update MD5-only file pins
|
||||
to a release with a published SHA-256. Partial version-file values keep their existing
|
||||
major-version behavior.
|
||||
**NOTE:** Amazon Corretto only supports the major version specification.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
@@ -175,7 +159,7 @@ steps:
|
||||
- uses: actions/setup-java@v6
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: '25.0.5.0.10'
|
||||
java-version: '25'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@@ -346,7 +330,7 @@ The package types have these meanings:
|
||||
| `liberica-nik` | `jdk`, `jdk+fx` | `java-version` selects the embedded JDK version, not the NIK/GraalVM release number. BellSoft currently publishes matching standard and JavaFX "full" bundles for JDK 11 and later, with gaps between feature releases. Any other `java-package` value is rejected. |
|
||||
| `microsoft` | `jdk` | Stable builds only. The bundled manifest contains Java 11, 16, 17, 21, and 25 releases; platform availability varies by release. |
|
||||
| `semeru` | `jdk`, `jre` | Stable OpenJ9 builds only. IBM publishes both image types for the supported release lines (currently 8, 11, 17, 21, and 25), subject to platform availability. |
|
||||
| `corretto` | `jdk`, `jre` | Accepts major versions and full Corretto release numbers. JDK availability follows Amazon's platform catalog. For the operating systems directly selected by `setup-java`, JRE downloads are limited to Java 8 on Windows; Linux and macOS use `jdk`. |
|
||||
| `corretto` | `jdk`, `jre` | Accepts major versions only. JDK availability follows Amazon's platform catalog. For the operating systems directly selected by `setup-java`, JRE downloads are limited to Java 8 on Windows; Linux and macOS use `jdk`. |
|
||||
| `oracle` | `jdk` | Stable Oracle JDK 17 and later only. |
|
||||
| `oracle-openjdk` | `jdk` | Installs the GA or early-access JDK builds currently listed or archived on `jdk.java.net`; use a `-ea` version such as `27-ea` for early access. |
|
||||
| `redhat` | `jdk`, `jre` | Stable builds only. Version availability follows the Foojay Disco catalog for Red Hat Build of OpenJDK and can lag Red Hat's downloads page. |
|
||||
@@ -901,11 +885,6 @@ Use `mvn-server-credentials` to add more than one credential entry to the genera
|
||||
|
||||
When this input is set, it replaces the single server configured by `server-id`, `server-username-env-var`, and `server-password-env-var`.
|
||||
|
||||
Use `mvn-server-repository-origins` when a Maven server credential must be allowed for an explicit repository origin. Each line has the format `server-id:repository-origin`; a server can have multiple origins.
|
||||
|
||||
> [!NOTE]
|
||||
> `mvn-server-repository-origins` only works with Maven 3.10 and later. Earlier Maven versions ignore the generated `repositoryOrigins` element and log an `Unrecognised tag: 'repositoryOrigins'` warning. GitHub-hosted runners currently ship Maven 3.9.x, so use the [Maven Wrapper](https://maven.apache.org/tools/wrapper/) or install Maven 3.10+ yourself to use this feature.
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
@@ -917,9 +896,6 @@ steps:
|
||||
mvn-server-credentials: |
|
||||
releases:RELEASES_USERNAME:RELEASES_PASSWORD
|
||||
snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD
|
||||
mvn-server-repository-origins: |
|
||||
releases:https://central.sonatype.com
|
||||
snapshots:https://central.sonatype.com
|
||||
- name: Publish with Maven
|
||||
run: mvn deploy
|
||||
env:
|
||||
@@ -937,17 +913,11 @@ This configuration produces the following server entries:
|
||||
<id>releases</id>
|
||||
<username>${env.RELEASES_USERNAME}</username>
|
||||
<password>${env.RELEASES_PASSWORD}</password>
|
||||
<repositoryOrigins>
|
||||
<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>
|
||||
</repositoryOrigins>
|
||||
</server>
|
||||
<server>
|
||||
<id>snapshots</id>
|
||||
<username>${env.SNAPSHOTS_USERNAME}</username>
|
||||
<password>${env.SNAPSHOTS_PASSWORD}</password>
|
||||
<repositoryOrigins>
|
||||
<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>
|
||||
</repositoryOrigins>
|
||||
</server>
|
||||
</servers>
|
||||
```
|
||||
@@ -1019,162 +989,14 @@ This configuration adds the following active profile to `settings.xml`:
|
||||
</activeProfiles>
|
||||
```
|
||||
|
||||
Maven Central is included first by default. The Central controls apply to both
|
||||
dependency and plugin repositories. Set
|
||||
`mvn-repositories-prioritize-central: false` to place custom repositories first
|
||||
within each configured list, or set `mvn-repositories-include-central: false` to
|
||||
disable Central for both types. The generated profile overrides the dependency
|
||||
and plugin Central repositories inherited from Maven's Super POM with releases
|
||||
and snapshots disabled, even if only one custom repository list is supplied.
|
||||
These controls have no effect when neither list contains a nonblank entry.
|
||||
|
||||
When automatic Central inclusion is off, the ID `central` may instead be
|
||||
declared explicitly in `mvn-repositories` or `mvn-plugin-repositories` to replace
|
||||
it with a user-specified repository for that type. Declaring it in one list
|
||||
does not enable Central in the other. Otherwise that ID is reserved to prevent
|
||||
duplicate entries. Other repositories declared in your project's POM are not
|
||||
disabled by these controls.
|
||||
|
||||
### Resolving Maven plugins from custom repositories
|
||||
|
||||
Maven resolves build plugins through `<pluginRepositories>`, separately from
|
||||
dependency `<repositories>`. Use `mvn-plugin-repositories` to configure plugin
|
||||
resolution with the same multiline `repository-id:repository-url:snapshots-enabled`
|
||||
format. It can be supplied without `mvn-repositories`; dependency repositories
|
||||
are not automatically used as plugin repositories.
|
||||
|
||||
For example, configure the same private repository for dependencies and plugins
|
||||
and disable inherited Maven Central for both:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/setup-java@v6
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
mvn-server-credentials: |
|
||||
private:PRIVATE_REPOSITORY_USERNAME:PRIVATE_REPOSITORY_TOKEN
|
||||
mvn-repositories: |
|
||||
private:https://maven.example.com/releases:false
|
||||
mvn-plugin-repositories: |
|
||||
private:https://maven.example.com/releases:false
|
||||
mvn-repositories-include-central: false
|
||||
- run: mvn --batch-mode verify
|
||||
env:
|
||||
PRIVATE_REPOSITORY_USERNAME: ${{ secrets.PRIVATE_REPOSITORY_USERNAME }}
|
||||
PRIVATE_REPOSITORY_TOKEN: ${{ secrets.PRIVATE_REPOSITORY_TOKEN }}
|
||||
```
|
||||
|
||||
The matching ID `private` selects the same server credentials for both types.
|
||||
IDs must be unique within each list, but can be shared across the two lists.
|
||||
Public repositories do not require a matching credential entry.
|
||||
|
||||
Alongside dependency repositories, the active `setup-java-repositories` profile
|
||||
contains:
|
||||
|
||||
```xml
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>private</id>
|
||||
<url>https://maven.example.com/releases</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>central</id>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
```
|
||||
|
||||
Omitting a Central override would leave the Super POM's plugin repository
|
||||
enabled. In particular, `mvn-repositories-include-central: false` now disables
|
||||
inherited plugin Central even for existing workflows that only configure
|
||||
`mvn-repositories`. To download plugins in such workflows, configure a plugin
|
||||
repository or explicitly declare `central` in `mvn-plugin-repositories`.
|
||||
|
||||
With Central included, it is placed before custom plugin repositories by
|
||||
default; `mvn-repositories-prioritize-central: false` places it after them.
|
||||
All repository generation respects `settings-path` and `overwrite-settings`;
|
||||
an existing settings file is left untouched when `overwrite-settings: false`.
|
||||
|
||||
### Redirecting Maven repositories with mirrors
|
||||
|
||||
Use `mvn-mirrors` to redirect matching dependency and plugin repositories,
|
||||
including Maven Central and repositories declared in project or parent POMs.
|
||||
Unlike repository profiles, mirrors replace the destination Maven contacts.
|
||||
The Central controls described above do not redirect arbitrary POM repositories.
|
||||
|
||||
Each nonblank line has the format `mirror-id:mirror-url:mirror-of`. IDs must be
|
||||
unique within this input. `mirror-url` must be an absolute URL that includes a
|
||||
scheme, such as `https://`. URL schemes, ports, IPv6 addresses, and colons in
|
||||
`mirrorOf` selectors are preserved. An explicit `mirror-of` field is required
|
||||
after the complete URL, including any port. Percent-encode colons in the URL
|
||||
path, query, or fragment as `%3A`. Otherwise, text after the last unencoded
|
||||
colon may be read as the `mirror-of` value. For example:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/setup-java@v6
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
mvn-server-credentials: |
|
||||
private:PRIVATE_REPOSITORY_USERNAME:PRIVATE_REPOSITORY_TOKEN
|
||||
mvn-mirrors: |
|
||||
private:https://maven.example.com/releases:*
|
||||
- run: mvn --batch-mode verify
|
||||
env:
|
||||
PRIVATE_REPOSITORY_USERNAME: ${{ secrets.PRIVATE_REPOSITORY_USERNAME }}
|
||||
PRIVATE_REPOSITORY_TOKEN: ${{ secrets.PRIVATE_REPOSITORY_TOKEN }}
|
||||
```
|
||||
|
||||
This adds the following directly under `<settings>`, not inside a profile:
|
||||
|
||||
```xml
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>private</id>
|
||||
<url>https://maven.example.com/releases</url>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
```
|
||||
|
||||
For authentication, the mirror ID must match a server ID configured through
|
||||
`mvn-server-credentials` or the single-server inputs. Public mirrors do not need
|
||||
matching credentials. Credentials remain environment-variable references in the
|
||||
generated settings; do not put credential values in `mvn-mirrors`.
|
||||
|
||||
Mirrors can be used alone, as above, or alongside `mvn-repositories` and
|
||||
`mvn-plugin-repositories`. They do not change those inputs or the Central
|
||||
controls. Omitting `mvn-mirrors`, or supplying only blank lines, adds no
|
||||
`<mirrors>` section or repository profile.
|
||||
|
||||
Maven interprets `mirrorOf`: `*` matches every repository, `central` matches
|
||||
only that repository ID, `external:*` matches external repositories, and
|
||||
`external:http:*` matches external HTTP repositories. Comma-separated patterns
|
||||
such as `external:*,!internal` exclude specific IDs. Selector text and mirror
|
||||
order are retained; Maven applies its own matching and precedence rules.
|
||||
For example, a public mirror needs no additional repository or credential input:
|
||||
|
||||
```yaml
|
||||
mvn-mirrors: |
|
||||
public:https://mirror.example.com:8443/maven:external:*,!internal
|
||||
```
|
||||
|
||||
Mirror generation respects `settings-path` and `overwrite-settings`. An existing
|
||||
settings file is left untouched when `overwrite-settings: false`; this input
|
||||
does not merge mirrors into that file.
|
||||
Maven Central is included first by default. Set
|
||||
`mvn-repositories-prioritize-central: false` to place custom repositories
|
||||
first, or set `mvn-repositories-include-central: false` to disable Central. The
|
||||
generated profile overrides the Central repository inherited from Maven's Super
|
||||
POM with releases and snapshots disabled. When automatic Central inclusion is
|
||||
off, the ID `central` may instead be declared explicitly in `mvn-repositories`
|
||||
to replace it with a user-specified repository; otherwise that ID is reserved
|
||||
to prevent duplicate entries.
|
||||
|
||||
### GPG
|
||||
|
||||
|
||||
Generated
+437
-271
@@ -9,34 +9,34 @@
|
||||
"version": "6.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^6.3.0",
|
||||
"@actions/cache": "^6.2.0",
|
||||
"@actions/core": "^3.0.1",
|
||||
"@actions/exec": "^3.0.0",
|
||||
"@actions/glob": "^0.7.0",
|
||||
"@actions/http-client": "^4.0.1",
|
||||
"@actions/io": "^3.0.2",
|
||||
"@actions/tool-cache": "^4.0.0",
|
||||
"fast-xml-parser": "^5.11.2",
|
||||
"fast-xml-parser": "^5.11.1",
|
||||
"semver": "^7.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@jest/globals": "^30.5.2",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/node": "^26.6.2",
|
||||
"@types/semver": "^7.8.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.70.1",
|
||||
"@typescript-eslint/parser": "^8.65.0",
|
||||
"@vercel/ncc": "^0.45.0",
|
||||
"eslint": "^10.13.0",
|
||||
"eslint": "^10.11.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jest": "^29.17.0",
|
||||
"eslint-plugin-n": "^18.5.0",
|
||||
"globals": "^17.13.0",
|
||||
"eslint-plugin-jest": "^29.16.6",
|
||||
"eslint-plugin-n": "^18.3.0",
|
||||
"globals": "^17.12.0",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.5.2",
|
||||
"lint-staged": "^17.6.0",
|
||||
"prettier": "^3.9.10",
|
||||
"ts-jest": "^29.4.15",
|
||||
"lint-staged": "^17.5.1",
|
||||
"prettier": "^3.9.9",
|
||||
"ts-jest": "^29.4.13",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -44,20 +44,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.3.0.tgz",
|
||||
"integrity": "sha512-SJKaVMqTgetQgJF0wifi5N2+2mffCLy/D4w/3sJtRanBBGECdi1/OD0wswyLVmqEmPbYB/rVJk41Qn/xEbFjAw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.2.0.tgz",
|
||||
"integrity": "sha512-Nv0xWRmbxfDbAn/70flO/F6tj2Nv4XTYMAsQHiDFSojCDfso/Zni+fRKa14ToI9hnmOW/rQcY1WYb6wsM7Pgwg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.1",
|
||||
"@actions/exec": "^3.0.0",
|
||||
"@actions/glob": "^0.7.0",
|
||||
"@actions/glob": "^0.6.1",
|
||||
"@actions/http-client": "^4.0.1",
|
||||
"@actions/io": "^3.0.2",
|
||||
"@azure/core-rest-pipeline": "~1.23.0",
|
||||
"@azure/storage-blob": "~12.31.0",
|
||||
"@azure/core-rest-pipeline": "^1.23.0",
|
||||
"@azure/storage-blob": "^12.31.0",
|
||||
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
||||
"semver": "^7.8.5"
|
||||
"semver": "^7.7.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
@@ -145,9 +145,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-client": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz",
|
||||
"integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==",
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.0.tgz",
|
||||
"integrity": "sha512-JjQWO6akOck45PH/XBrxzsQGAiKrfFl4m5iggJ0ItMIz5omRufOXWpqCPpdjKN3vKDzlSUvFjaMb7Zwf0gvAdA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
@@ -206,9 +206,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-rest-pipeline": {
|
||||
"version": "1.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.23.0.tgz",
|
||||
"integrity": "sha512-Evs1INHo+jUjwHi1T6SG6Ua/LHOQBCLuKEEE6efIpt4ZOoNonaT1kP32GoOcdNDbfqsD2445CPri3MubBy5DEQ==",
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz",
|
||||
"integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
@@ -220,7 +220,7 @@
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/core-tracing": {
|
||||
@@ -276,9 +276,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/storage-blob": {
|
||||
"version": "12.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.31.0.tgz",
|
||||
"integrity": "sha512-DBgNv10aCSxopt92DkTDD0o9xScXeBqPKGmR50FPZQaEcH4JLQ+GEOGEDv19V5BMkB7kxr+m4h6il/cCDPvmHg==",
|
||||
"version": "12.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.33.0.tgz",
|
||||
"integrity": "sha512-2SX8oP8PyblUcAFZSg39c8Ls+tFjavM6sBeV+qpw33mRzRhI/5hrFJmJ/x0H9xx5l6ECPvgSP8uPxqTeVbHNIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
@@ -292,23 +292,23 @@
|
||||
"@azure/core-util": "^1.11.0",
|
||||
"@azure/core-xml": "^1.4.5",
|
||||
"@azure/logger": "^1.1.4",
|
||||
"@azure/storage-common": "^12.3.0",
|
||||
"@azure/storage-common": "^12.4.1",
|
||||
"events": "^3.0.0",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/storage-common": {
|
||||
"version": "12.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.5.0.tgz",
|
||||
"integrity": "sha512-bttzuhQiCIwrkzjPDA+AtAR7dg19L/CC6ztcqJ5LfvWpXuys9mHp0UQ0udYnoUvv9SCT9KTR5kqFvFr0e6k0lQ==",
|
||||
"version": "12.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.4.1.tgz",
|
||||
"integrity": "sha512-t14unw/WofGDUi7TKJrsyXyPsN+NLgRm7hMaq0llxNmTIzt7f257+6LE6FKIJPh88zLj6M7LPvzve0fEYg/L3A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
"@azure/core-auth": "^1.9.0",
|
||||
"@azure/core-http-compat": "^2.4.0",
|
||||
"@azure/core-http-compat": "^2.2.0",
|
||||
"@azure/core-rest-pipeline": "^1.24.0",
|
||||
"@azure/core-tracing": "^1.2.0",
|
||||
"@azure/core-util": "^1.11.0",
|
||||
@@ -317,25 +317,7 @@
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/storage-common/node_modules/@azure/core-rest-pipeline": {
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz",
|
||||
"integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@azure/abort-controller": "^2.1.2",
|
||||
"@azure/core-auth": "^1.10.0",
|
||||
"@azure/core-tracing": "^1.3.0",
|
||||
"@azure/core-util": "^1.13.0",
|
||||
"@azure/logger": "^1.3.0",
|
||||
"@typespec/ts-http-runtime": "^0.3.4",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@@ -1641,9 +1623,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@nodable/entities": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.1.0.tgz",
|
||||
"integrity": "sha512-LsS/DjHr+uDM647Gru/cA8+J3a3HfhttwCKLyuoyN7yXTFCxKBtSgMQBvrW9yNPa2/zDRUNuGPaH5QUFoa4arQ==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.0.0.tgz",
|
||||
"integrity": "sha512-8L9xFeTYKhm49xfIypoe2W5wV1m/3Z58kT+7kR9A8OyFxcPduI4VmxaUMQyKYrRjUoLLSXv6EKKID5Tvj9cUVw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -2117,9 +2099,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.6.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
|
||||
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
|
||||
"version": "26.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz",
|
||||
"integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2158,17 +2140,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.0.tgz",
|
||||
"integrity": "sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==",
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.70.1.tgz",
|
||||
"integrity": "sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/type-utils": "8.72.0",
|
||||
"@typescript-eslint/utils": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"@typescript-eslint/scope-manager": "8.70.1",
|
||||
"@typescript-eslint/type-utils": "8.70.1",
|
||||
"@typescript-eslint/utils": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -2181,103 +2163,21 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.72.0",
|
||||
"@typescript-eslint/parser": "^8.70.1",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.0.tgz",
|
||||
"integrity": "sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==",
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.70.1.tgz",
|
||||
"integrity": "sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.0.tgz",
|
||||
"integrity": "sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.72.0",
|
||||
"@typescript-eslint/types": "^8.72.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.0.tgz",
|
||||
"integrity": "sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.0.tgz",
|
||||
"integrity": "sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.0.tgz",
|
||||
"integrity": "sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0",
|
||||
"@typescript-eslint/utils": "8.72.0",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/typescript-estree": "8.70.1",
|
||||
"@typescript-eslint/utils": "8.70.1",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -2293,31 +2193,17 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.0.tgz",
|
||||
"integrity": "sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.0.tgz",
|
||||
"integrity": "sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==",
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
|
||||
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.72.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/visitor-keys": "8.72.0",
|
||||
"@typescript-eslint/project-service": "8.70.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
@@ -2335,17 +2221,56 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.0.tgz",
|
||||
"integrity": "sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==",
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
|
||||
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.70.1",
|
||||
"@typescript-eslint/types": "^8.70.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
|
||||
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz",
|
||||
"integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.0",
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/typescript-estree": "8.72.0"
|
||||
"@typescript-eslint/scope-manager": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/typescript-estree": "8.70.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2359,14 +2284,205 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.72.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.0.tgz",
|
||||
"integrity": "sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==",
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
|
||||
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.0",
|
||||
"@typescript-eslint/project-service": "8.70.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
|
||||
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.70.1",
|
||||
"@typescript-eslint/types": "^8.70.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
|
||||
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.70.1.tgz",
|
||||
"integrity": "sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/typescript-estree": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
|
||||
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.70.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
|
||||
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.70.1",
|
||||
"@typescript-eslint/types": "^8.70.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
|
||||
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.70.1.tgz",
|
||||
"integrity": "sha512-Pa0EeSeAusQc1WbjQMac+YfenewYTBu0KjgYvkUKwhXaHUKbFog23Dm/rp0DX/6tyYOQ3Xl1a+3EcFNZynGHCw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.1.tgz",
|
||||
"integrity": "sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.70.1.tgz",
|
||||
"integrity": "sha512-Vwj9lUIW5Xq3wQ9w6gv3R86g1hMK8f2zNOdGTAgeXUMMXFK78G9ruCjjqutHMNJc0+CH7LYRnHeUB9IT8wFmcw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2391,9 +2507,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typespec/ts-http-runtime": {
|
||||
"version": "0.3.9",
|
||||
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.9.tgz",
|
||||
"integrity": "sha512-edSdeAqkdxBVzA1yL1LrLCml1YjyCVvPMtMqJpbF+6K609tHe8V6sQUzFQSGcYNhcuhOceZtjvN32+mpIth30A==",
|
||||
"version": "0.3.7",
|
||||
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.7.tgz",
|
||||
"integrity": "sha512-JVUD8X2tfDMWjcjLs4yVxxVrS8yR5vnh386GAXT9Qj79nBxxXSaHFQZg5FweLmT8HlPQ3kii6noUB+Z9RN7DvQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"http-proxy-agent": "^7.0.0",
|
||||
@@ -3425,9 +3541,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "10.13.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.13.0.tgz",
|
||||
"integrity": "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==",
|
||||
"version": "10.11.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.11.0.tgz",
|
||||
"integrity": "sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
@@ -3538,9 +3654,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest": {
|
||||
"version": "29.17.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz",
|
||||
"integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==",
|
||||
"version": "29.16.6",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.6.tgz",
|
||||
"integrity": "sha512-q8TVr0rlNvUD0XnafGWkwtPeX+tTl2llP86EDl3sJtwWrQA/JT9SIu2hLLZbhhX6fT5SDE4O0gIKyZUujKnkYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3567,10 +3683,101 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz",
|
||||
"integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/typescript-estree": "8.70.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
|
||||
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.70.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.70.1",
|
||||
"@typescript-eslint/types": "8.70.1",
|
||||
"@typescript-eslint/visitor-keys": "8.70.1",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
|
||||
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.70.1",
|
||||
"@typescript-eslint/types": "^8.70.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.70.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
|
||||
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-n": {
|
||||
"version": "18.5.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.5.0.tgz",
|
||||
"integrity": "sha512-M7uF6MTN/An+AXqvyIbXq7npJIZOkd5eKo8iMMvWrcDVNyZVdA6TF2lw01aKQfCEidRfpnR78GhAjZorlXNHiw==",
|
||||
"version": "18.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.3.0.tgz",
|
||||
"integrity": "sha512-cPVguuDe6DrIPb/qUXHf8P89MaVTUmiYWwpt5gX5AILsvRIiZAxMFXcFR6QHYBksqKJpjfUBlL/RleCJUWcD7w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3581,7 +3788,6 @@
|
||||
"globals": "^15.11.0",
|
||||
"globrex": "^0.1.2",
|
||||
"ignore": "^5.3.2",
|
||||
"js-yaml": "^5.4.1",
|
||||
"semver": "^7.6.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3604,23 +3810,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-n/node_modules/argparse": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz",
|
||||
"integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "PSF-2.0"
|
||||
},
|
||||
"node_modules/eslint-plugin-n/node_modules/globals": {
|
||||
"version": "15.15.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
|
||||
@@ -3644,29 +3833,6 @@
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-n/node_modules/js-yaml": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz",
|
||||
"integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^3.0.3"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "9.1.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz",
|
||||
@@ -3919,9 +4085,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fast-xml-parser": {
|
||||
"version": "5.11.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.11.2.tgz",
|
||||
"integrity": "sha512-R9iDuNrQYeQut46cn2r2wHKn4HYzVDvDm5J1wW+koZewykv0yuO2HChTYeZtrULyHIDM9cj9TUXloCsueCQUog==",
|
||||
"version": "5.11.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.11.1.tgz",
|
||||
"integrity": "sha512-TBw6K/fxoQGGjCmZDw9w/ZwP3uDcnTM4YH/g+PFRWr8sbe5idXtxNN6vITh4+1ruCZaho6uBFurElsA7F0zzgw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -3930,7 +4096,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodable/entities": "^3.0.1",
|
||||
"@nodable/entities": "^3.0.0",
|
||||
"fast-xml-builder": "^1.2.0",
|
||||
"is-unsafe": "^2.0.0",
|
||||
"path-expression-matcher": "^1.6.2",
|
||||
@@ -4127,9 +4293,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "17.13.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz",
|
||||
"integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==",
|
||||
"version": "17.12.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-17.12.0.tgz",
|
||||
"integrity": "sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -4154,13 +4320,13 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.10",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.10.tgz",
|
||||
"integrity": "sha512-P5VJMVM7qgBn6vjXMw8WG9uVI+ncf2pi72j4de4yz5ZULLj2RGqLYaKOYGsgyrViQ0tePOVlN1tDCCXXtFqXKg==",
|
||||
"version": "4.7.9",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz",
|
||||
"integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.8",
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.2",
|
||||
"source-map": "^0.6.1",
|
||||
"wordwrap": "^1.0.0"
|
||||
@@ -5145,9 +5311,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lint-staged": {
|
||||
"version": "17.6.0",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.6.0.tgz",
|
||||
"integrity": "sha512-nOhBfYkZEwkFtNzD5pK9s9LkcWoxJ+whLzEnhqi9nl7zTB5n7tg8+9iYgMGx2Wm3VlLu8cbNj0RACzY+nWi5iQ==",
|
||||
"version": "17.5.1",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.5.1.tgz",
|
||||
"integrity": "sha512-7EDuco1xnBMeVpvAbeMq1U5KXwJGLmY8q6l+Ye78r36C4mPc+Vg1Z2SK8gHyRTyvPro90A0q5/FAZ+Au23d6QQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -5165,7 +5331,7 @@
|
||||
"url": "https://opencollective.com/lint-staged"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"yaml": "^2.9.1"
|
||||
"yaml": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
@@ -5633,9 +5799,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.9.10",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
|
||||
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
|
||||
"version": "3.9.9",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.9.tgz",
|
||||
"integrity": "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -6064,15 +6230,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ts-jest": {
|
||||
"version": "29.4.15",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.15.tgz",
|
||||
"integrity": "sha512-s2qmEUYFRqbjz1wv0EmccNPVOb45HOFpFuhzQJLKShYVisuTbCFPIIAIV2EuK5rIxb4BejLDbH7dnBZfYjybUQ==",
|
||||
"version": "29.4.13",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.13.tgz",
|
||||
"integrity": "sha512-rUQG+Ar95cNQf//KvsSjvabLpCTbwk+vKGWkAgiKFugqVwmOpGR7n7xa3S68/AB21Wn0KNhIAVxmxrUsz0L1AQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bs-logger": "^0.2.6",
|
||||
"fast-json-stable-stringify": "^2.1.0",
|
||||
"handlebars": "^4.7.10",
|
||||
"handlebars": "^4.7.9",
|
||||
"json5": "^2.2.3",
|
||||
"lodash.memoize": "^4.1.2",
|
||||
"make-error": "^1.3.6",
|
||||
@@ -6209,9 +6375,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.29.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",
|
||||
"integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",
|
||||
"version": "6.29.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz",
|
||||
"integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
@@ -6416,9 +6582,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
|
||||
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
||||
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"optional": true,
|
||||
|
||||
+11
-11
@@ -42,34 +42,34 @@
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^6.3.0",
|
||||
"@actions/cache": "^6.2.0",
|
||||
"@actions/core": "^3.0.1",
|
||||
"@actions/exec": "^3.0.0",
|
||||
"@actions/glob": "^0.7.0",
|
||||
"@actions/http-client": "^4.0.1",
|
||||
"@actions/io": "^3.0.2",
|
||||
"@actions/tool-cache": "^4.0.0",
|
||||
"fast-xml-parser": "^5.11.2",
|
||||
"fast-xml-parser": "^5.11.1",
|
||||
"semver": "^7.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@jest/globals": "^30.5.2",
|
||||
"@types/node": "^26.6.5",
|
||||
"@types/node": "^26.6.2",
|
||||
"@types/semver": "^7.8.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.70.1",
|
||||
"@typescript-eslint/parser": "^8.65.0",
|
||||
"@vercel/ncc": "^0.45.0",
|
||||
"eslint": "^10.13.0",
|
||||
"eslint": "^10.11.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jest": "^29.17.0",
|
||||
"eslint-plugin-n": "^18.5.0",
|
||||
"globals": "^17.13.0",
|
||||
"eslint-plugin-jest": "^29.16.6",
|
||||
"eslint-plugin-n": "^18.3.0",
|
||||
"globals": "^17.12.0",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.5.2",
|
||||
"lint-staged": "^17.6.0",
|
||||
"prettier": "^3.9.10",
|
||||
"ts-jest": "^29.4.15",
|
||||
"lint-staged": "^17.5.1",
|
||||
"prettier": "^3.9.9",
|
||||
"ts-jest": "^29.4.13",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"bugs": {
|
||||
|
||||
+71
-273
@@ -13,7 +13,6 @@ export interface MavenServerCredentials {
|
||||
id: string;
|
||||
usernameEnvVar: string;
|
||||
passwordEnvVar: string;
|
||||
repositoryOrigins?: string[];
|
||||
}
|
||||
|
||||
export interface MavenRepository {
|
||||
@@ -25,25 +24,13 @@ export interface MavenRepository {
|
||||
|
||||
export interface MavenRepositorySettings {
|
||||
repositories: MavenRepository[];
|
||||
pluginRepositories?: MavenRepository[];
|
||||
includeCentral: boolean;
|
||||
prioritizeCentral: boolean;
|
||||
}
|
||||
|
||||
export interface MavenMirror {
|
||||
id: string;
|
||||
url: string;
|
||||
mirrorOf: string;
|
||||
}
|
||||
|
||||
const MAVEN_REPOSITORY_ORIGIN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+\/?$/;
|
||||
|
||||
export async function configureAuthentication() {
|
||||
const servers = getMavenServerSettings();
|
||||
const repositorySettings = getMavenRepositorySettings();
|
||||
const mirrors = parseMavenMirrors(
|
||||
core.getMultilineInput(constants.INPUT_MVN_MIRRORS)
|
||||
);
|
||||
const settingsDirectory =
|
||||
core.getInput(constants.INPUT_SETTINGS_PATH) ||
|
||||
path.join(os.homedir(), constants.M2_DIR);
|
||||
@@ -69,8 +56,7 @@ export async function configureAuthentication() {
|
||||
settingsDirectory,
|
||||
overwriteSettings,
|
||||
gpgPassphraseEnvVar,
|
||||
repositorySettings,
|
||||
mirrors
|
||||
repositorySettings
|
||||
);
|
||||
|
||||
if (gpgPrivateKey) {
|
||||
@@ -109,28 +95,25 @@ export function getMavenServerSettings(): MavenServerCredentials[] {
|
||||
constants.INPUT_MVN_SERVER_CREDENTIALS
|
||||
);
|
||||
|
||||
const servers = entries.some(entry => entry.trim())
|
||||
? parseMavenServerCredentials(entries)
|
||||
: [
|
||||
{
|
||||
id: core.getInput(constants.INPUT_SERVER_ID),
|
||||
usernameEnvVar: getInputWithDeprecatedAlias(
|
||||
constants.INPUT_SERVER_USERNAME_ENV_VAR,
|
||||
constants.INPUT_SERVER_USERNAME_DEPRECATED,
|
||||
constants.INPUT_DEFAULT_SERVER_USERNAME
|
||||
),
|
||||
passwordEnvVar: getInputWithDeprecatedAlias(
|
||||
constants.INPUT_SERVER_PASSWORD_ENV_VAR,
|
||||
constants.INPUT_SERVER_PASSWORD_DEPRECATED,
|
||||
constants.INPUT_DEFAULT_SERVER_PASSWORD
|
||||
)
|
||||
}
|
||||
];
|
||||
if (entries.some(entry => entry.trim())) {
|
||||
return parseMavenServerCredentials(entries);
|
||||
}
|
||||
|
||||
return addMavenServerRepositoryOrigins(
|
||||
servers,
|
||||
core.getMultilineInput(constants.INPUT_MVN_SERVER_REPOSITORY_ORIGINS)
|
||||
);
|
||||
return [
|
||||
{
|
||||
id: core.getInput(constants.INPUT_SERVER_ID),
|
||||
usernameEnvVar: getInputWithDeprecatedAlias(
|
||||
constants.INPUT_SERVER_USERNAME_ENV_VAR,
|
||||
constants.INPUT_SERVER_USERNAME_DEPRECATED,
|
||||
constants.INPUT_DEFAULT_SERVER_USERNAME
|
||||
),
|
||||
passwordEnvVar: getInputWithDeprecatedAlias(
|
||||
constants.INPUT_SERVER_PASSWORD_ENV_VAR,
|
||||
constants.INPUT_SERVER_PASSWORD_DEPRECATED,
|
||||
constants.INPUT_DEFAULT_SERVER_PASSWORD
|
||||
)
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// only exported for testing purposes
|
||||
@@ -173,96 +156,11 @@ export function parseMavenServerCredentials(
|
||||
return servers;
|
||||
}
|
||||
|
||||
// only exported for testing purposes
|
||||
export function addMavenServerRepositoryOrigins(
|
||||
servers: MavenServerCredentials[],
|
||||
entries: string[]
|
||||
): MavenServerCredentials[] {
|
||||
const serverIds = new Set(servers.map(server => server.id));
|
||||
const originsByServer = new Map<string, string[]>();
|
||||
|
||||
entries.forEach((entry, index) => {
|
||||
if (!entry.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const separator = entry.indexOf(':');
|
||||
if (separator <= 0 || separator === entry.length - 1) {
|
||||
throw new Error(
|
||||
`Invalid mvn-server-repository-origins entry at line ${index + 1}. Expected format: server-id:repository-origin`
|
||||
);
|
||||
}
|
||||
|
||||
const id = entry.slice(0, separator).trim();
|
||||
const value = entry.slice(separator + 1).trim();
|
||||
if (!id || !value) {
|
||||
throw new Error(
|
||||
`Invalid mvn-server-repository-origins entry at line ${index + 1}. Server ID and repository origin are required`
|
||||
);
|
||||
}
|
||||
if (!serverIds.has(id)) {
|
||||
throw new Error(
|
||||
`Unknown server-id '${id}' in mvn-server-repository-origins at line ${index + 1}`
|
||||
);
|
||||
}
|
||||
|
||||
let url: URL;
|
||||
try {
|
||||
if (!MAVEN_REPOSITORY_ORIGIN.test(value)) {
|
||||
throw new Error();
|
||||
}
|
||||
url = new URL(value);
|
||||
} catch {
|
||||
throw new Error(
|
||||
`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`
|
||||
);
|
||||
}
|
||||
if (
|
||||
!url.host ||
|
||||
url.username ||
|
||||
url.password ||
|
||||
(url.pathname !== '' && url.pathname !== '/') ||
|
||||
url.search ||
|
||||
url.hash
|
||||
) {
|
||||
throw new Error(
|
||||
`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`
|
||||
);
|
||||
}
|
||||
|
||||
const explicitPort = /:(\d+)\/?$/.exec(value)?.[1];
|
||||
const port = explicitPort ? Number.parseInt(explicitPort, 10) : undefined;
|
||||
const includePort =
|
||||
port !== undefined &&
|
||||
!(
|
||||
(url.protocol === 'http:' && port === 80) ||
|
||||
(url.protocol === 'https:' && port === 443)
|
||||
);
|
||||
const origin = `${url.protocol}//${url.hostname}${includePort ? `:${port}` : ''}`;
|
||||
const origins = originsByServer.get(id) || [];
|
||||
if (!origins.includes(origin)) {
|
||||
origins.push(origin);
|
||||
originsByServer.set(id, origins);
|
||||
}
|
||||
});
|
||||
|
||||
return servers.map(server => {
|
||||
const repositoryOrigins = originsByServer.get(server.id);
|
||||
return repositoryOrigins ? {...server, repositoryOrigins} : server;
|
||||
});
|
||||
}
|
||||
|
||||
// only exported for testing purposes
|
||||
export function getMavenRepositorySettings():
|
||||
MavenRepositorySettings | undefined {
|
||||
const entries = core.getMultilineInput(constants.INPUT_MVN_REPOSITORIES);
|
||||
const pluginEntries = core.getMultilineInput(
|
||||
constants.INPUT_MVN_PLUGIN_REPOSITORIES
|
||||
);
|
||||
if (
|
||||
!entries.some(entry => entry.trim()) &&
|
||||
!pluginEntries.some(entry => entry.trim())
|
||||
) {
|
||||
if (!entries.some(entry => entry.trim())) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -272,11 +170,6 @@ export function getMavenRepositorySettings():
|
||||
);
|
||||
return {
|
||||
repositories: parseMavenRepositories(entries, includeCentral),
|
||||
pluginRepositories: parseMavenRepositories(
|
||||
pluginEntries,
|
||||
includeCentral,
|
||||
constants.INPUT_MVN_PLUGIN_REPOSITORIES
|
||||
),
|
||||
includeCentral,
|
||||
prioritizeCentral: getBooleanInput(
|
||||
constants.INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL,
|
||||
@@ -288,8 +181,7 @@ export function getMavenRepositorySettings():
|
||||
// only exported for testing purposes
|
||||
export function parseMavenRepositories(
|
||||
entries: string[],
|
||||
includeCentral: boolean,
|
||||
inputName = constants.INPUT_MVN_REPOSITORIES
|
||||
includeCentral: boolean
|
||||
): MavenRepository[] {
|
||||
const repositories: MavenRepository[] = [];
|
||||
const repositoryIds = new Set<string>();
|
||||
@@ -303,7 +195,7 @@ export function parseMavenRepositories(
|
||||
const lastSeparator = entry.lastIndexOf(':');
|
||||
if (firstSeparator <= 0 || lastSeparator <= firstSeparator) {
|
||||
throw new Error(
|
||||
`Invalid ${inputName} entry at line ${index + 1}. Expected format: repository-id:repository-url:snapshots-enabled`
|
||||
`Invalid mvn-repositories entry at line ${index + 1}. Expected format: repository-id:repository-url:snapshots-enabled`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -315,16 +207,18 @@ export function parseMavenRepositories(
|
||||
.toLowerCase();
|
||||
if (!id || !url || !snapshotsValue) {
|
||||
throw new Error(
|
||||
`Invalid ${inputName} entry at line ${index + 1}. repository-id, repository URL, and snapshots-enabled are required`
|
||||
`Invalid mvn-repositories entry at line ${index + 1}. repository-id, repository URL, and snapshots-enabled are required`
|
||||
);
|
||||
}
|
||||
if (snapshotsValue !== 'true' && snapshotsValue !== 'false') {
|
||||
throw new Error(
|
||||
`Invalid snapshots-enabled value '${snapshotsValue}' in ${inputName} entry at line ${index + 1}. Expected true or false`
|
||||
`Invalid snapshots-enabled value '${snapshotsValue}' in mvn-repositories entry at line ${index + 1}. Expected true or false`
|
||||
);
|
||||
}
|
||||
if (repositoryIds.has(id)) {
|
||||
throw new Error(`Duplicate repository-id '${id}' in ${inputName} input`);
|
||||
throw new Error(
|
||||
`Duplicate repository-id '${id}' in mvn-repositories input`
|
||||
);
|
||||
}
|
||||
if (includeCentral && id === constants.MAVEN_CENTRAL_REPOSITORY_ID) {
|
||||
throw new Error(
|
||||
@@ -343,112 +237,12 @@ export function parseMavenRepositories(
|
||||
return repositories;
|
||||
}
|
||||
|
||||
// only exported for testing purposes
|
||||
export function parseMavenMirrors(entries: string[]): MavenMirror[] {
|
||||
const mirrors: MavenMirror[] = [];
|
||||
const mirrorIds = new Set<string>();
|
||||
|
||||
entries.forEach((entry, index) => {
|
||||
if (!entry.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const separator = entry.indexOf(':');
|
||||
const remainder = entry.slice(separator + 1).trim();
|
||||
// Protect scheme/authority colons (including IPv6 and ports) before
|
||||
// finding the selector, which may itself contain external:http:*.
|
||||
const urlPrefix =
|
||||
/^[A-Za-z][A-Za-z0-9+.-]*:(?:\/\/(?:[^/?#@\s]*@)?(?:\[[^\]]+\]|[^:/?#\s]+)(?::\d+(?=[/?#:\s]|$))?)?/.exec(
|
||||
remainder
|
||||
)?.[0] ?? '';
|
||||
const fields =
|
||||
/^(.*?):((?:\s*!?external:(?:http:)?\*\s*|[^:,]*)(?:,(?:\s*!?external:(?:http:)?\*\s*|[^:,]*))*)$/.exec(
|
||||
remainder.slice(urlPrefix.length)
|
||||
);
|
||||
if (separator < 0 || !fields) {
|
||||
throw new Error(
|
||||
`Invalid mvn-mirrors entry at line ${index + 1}. Expected format: mirror-id:mirror-url:mirror-of`
|
||||
);
|
||||
}
|
||||
|
||||
const id = entry.slice(0, separator).trim();
|
||||
const url = `${urlPrefix}${fields[1]}`.trim();
|
||||
const mirrorOf = fields[2].trim();
|
||||
if (!id || !url || !mirrorOf) {
|
||||
throw new Error(
|
||||
`Invalid mvn-mirrors entry at line ${index + 1}. mirror-id, mirror URL, and mirror-of are required`
|
||||
);
|
||||
}
|
||||
if (mirrorIds.has(id)) {
|
||||
throw new Error(
|
||||
`Duplicate mirror-id '${id}' in mvn-mirrors input at line ${index + 1}`
|
||||
);
|
||||
}
|
||||
|
||||
mirrorIds.add(id);
|
||||
mirrors.push({id, url, mirrorOf});
|
||||
});
|
||||
|
||||
return mirrors;
|
||||
}
|
||||
|
||||
function generateRepositorySection(
|
||||
customRepositories: MavenRepository[],
|
||||
settings: MavenRepositorySettings,
|
||||
element: 'repository' | 'pluginRepository'
|
||||
): string[] {
|
||||
if (!customRepositories.length && settings.includeCentral) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const centralRepository: MavenRepository = {
|
||||
id: constants.MAVEN_CENTRAL_REPOSITORY_ID,
|
||||
url: constants.MAVEN_CENTRAL_REPOSITORY_URL,
|
||||
snapshotsEnabled: false
|
||||
};
|
||||
const customCentralConfigured = customRepositories.some(
|
||||
repository => repository.id === constants.MAVEN_CENTRAL_REPOSITORY_ID
|
||||
);
|
||||
const repositories = settings.includeCentral
|
||||
? settings.prioritizeCentral
|
||||
? [centralRepository, ...customRepositories]
|
||||
: [...customRepositories, centralRepository]
|
||||
: customCentralConfigured
|
||||
? customRepositories
|
||||
: [...customRepositories, {...centralRepository, releasesEnabled: false}];
|
||||
const container =
|
||||
element === 'repository' ? 'repositories' : 'pluginRepositories';
|
||||
const lines = [` <${container}>`];
|
||||
|
||||
for (const repository of repositories) {
|
||||
lines.push(
|
||||
` <${element}>`,
|
||||
` <id>${escapeXmlText(repository.id)}</id>`,
|
||||
` <url>${escapeXmlText(repository.url)}</url>`,
|
||||
...(repository.releasesEnabled === undefined
|
||||
? []
|
||||
: [
|
||||
' <releases>',
|
||||
` <enabled>${repository.releasesEnabled}</enabled>`,
|
||||
' </releases>'
|
||||
]),
|
||||
' <snapshots>',
|
||||
` <enabled>${repository.snapshotsEnabled}</enabled>`,
|
||||
' </snapshots>',
|
||||
` </${element}>`
|
||||
);
|
||||
}
|
||||
lines.push(` </${container}>`);
|
||||
return lines;
|
||||
}
|
||||
|
||||
export async function createAuthenticationSettings(
|
||||
servers: MavenServerCredentials[],
|
||||
settingsDirectory: string,
|
||||
overwriteSettings: boolean,
|
||||
gpgPassphraseEnvVar: string | undefined = undefined,
|
||||
repositorySettings: MavenRepositorySettings | undefined = undefined,
|
||||
mirrors: MavenMirror[] = []
|
||||
repositorySettings: MavenRepositorySettings | undefined = undefined
|
||||
) {
|
||||
core.info(
|
||||
`Creating ${constants.MVN_SETTINGS_FILE} with server-id: ${servers.map(server => server.id).join(', ')}`
|
||||
@@ -458,7 +252,7 @@ export async function createAuthenticationSettings(
|
||||
await io.mkdirP(settingsDirectory);
|
||||
await write(
|
||||
settingsDirectory,
|
||||
generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors),
|
||||
generate(servers, gpgPassphraseEnvVar, repositorySettings),
|
||||
overwriteSettings
|
||||
);
|
||||
}
|
||||
@@ -467,8 +261,7 @@ export async function createAuthenticationSettings(
|
||||
export function generate(
|
||||
servers: MavenServerCredentials[],
|
||||
gpgPassphraseEnvVar?: string | undefined,
|
||||
repositorySettings?: MavenRepositorySettings | undefined,
|
||||
mirrors: MavenMirror[] = []
|
||||
repositorySettings?: MavenRepositorySettings | undefined
|
||||
) {
|
||||
// The maven-gpg-plugin reads the passphrase from the environment variable
|
||||
// named by the `gpg.passphraseEnvName` property (default MAVEN_GPG_PASSPHRASE).
|
||||
@@ -493,53 +286,58 @@ export function generate(
|
||||
' <server>',
|
||||
` <id>${escapeXmlText(server.id)}</id>`,
|
||||
` <username>${escapeXmlText(`\${env.${server.usernameEnvVar}}`)}</username>`,
|
||||
` <password>${escapeXmlText(`\${env.${server.passwordEnvVar}}`)}</password>`
|
||||
` <password>${escapeXmlText(`\${env.${server.passwordEnvVar}}`)}</password>`,
|
||||
' </server>'
|
||||
);
|
||||
if (server.repositoryOrigins) {
|
||||
lines.push(' <repositoryOrigins>');
|
||||
for (const origin of server.repositoryOrigins) {
|
||||
lines.push(
|
||||
` <repositoryOrigin>${escapeXmlText(origin)}</repositoryOrigin>`
|
||||
);
|
||||
}
|
||||
lines.push(' </repositoryOrigins>');
|
||||
}
|
||||
lines.push(' </server>');
|
||||
}
|
||||
lines.push(' </servers>');
|
||||
|
||||
if (mirrors.length) {
|
||||
lines.push(' <mirrors>');
|
||||
for (const mirror of mirrors) {
|
||||
lines.push(
|
||||
' <mirror>',
|
||||
` <id>${escapeXmlText(mirror.id)}</id>`,
|
||||
` <url>${escapeXmlText(mirror.url)}</url>`,
|
||||
` <mirrorOf>${escapeXmlText(mirror.mirrorOf)}</mirrorOf>`,
|
||||
' </mirror>'
|
||||
);
|
||||
}
|
||||
lines.push(' </mirrors>');
|
||||
}
|
||||
|
||||
if (repositorySettings || includeGpgPassphraseProfile) {
|
||||
lines.push(' <profiles>');
|
||||
if (repositorySettings) {
|
||||
const centralRepository: MavenRepository = {
|
||||
id: constants.MAVEN_CENTRAL_REPOSITORY_ID,
|
||||
url: constants.MAVEN_CENTRAL_REPOSITORY_URL,
|
||||
snapshotsEnabled: false
|
||||
};
|
||||
const customCentralConfigured = repositorySettings.repositories.some(
|
||||
repository => repository.id === constants.MAVEN_CENTRAL_REPOSITORY_ID
|
||||
);
|
||||
const repositories = repositorySettings.includeCentral
|
||||
? repositorySettings.prioritizeCentral
|
||||
? [centralRepository, ...repositorySettings.repositories]
|
||||
: [...repositorySettings.repositories, centralRepository]
|
||||
: customCentralConfigured
|
||||
? repositorySettings.repositories
|
||||
: [
|
||||
...repositorySettings.repositories,
|
||||
{...centralRepository, releasesEnabled: false}
|
||||
];
|
||||
|
||||
lines.push(
|
||||
' <profile>',
|
||||
` <id>${constants.MAVEN_REPOSITORIES_PROFILE_ID}</id>`,
|
||||
...generateRepositorySection(
|
||||
repositorySettings.repositories,
|
||||
repositorySettings,
|
||||
'repository'
|
||||
),
|
||||
...generateRepositorySection(
|
||||
repositorySettings.pluginRepositories ?? [],
|
||||
repositorySettings,
|
||||
'pluginRepository'
|
||||
),
|
||||
' </profile>'
|
||||
' <repositories>'
|
||||
);
|
||||
for (const repository of repositories) {
|
||||
lines.push(
|
||||
' <repository>',
|
||||
` <id>${escapeXmlText(repository.id)}</id>`,
|
||||
` <url>${escapeXmlText(repository.url)}</url>`,
|
||||
...(repository.releasesEnabled === undefined
|
||||
? []
|
||||
: [
|
||||
' <releases>',
|
||||
` <enabled>${repository.releasesEnabled}</enabled>`,
|
||||
' </releases>'
|
||||
]),
|
||||
' <snapshots>',
|
||||
` <enabled>${repository.snapshotsEnabled}</enabled>`,
|
||||
' </snapshots>',
|
||||
' </repository>'
|
||||
);
|
||||
}
|
||||
lines.push(' </repositories>', ' </profile>');
|
||||
}
|
||||
if (includeGpgPassphraseProfile) {
|
||||
lines.push(
|
||||
|
||||
@@ -16,11 +16,7 @@ export const SIGNATURE_VERIFICATION_DOCUMENTATION_URL =
|
||||
'https://github.com/actions/setup-java#download-integrity-and-signatures';
|
||||
export const SIGNATURE_VERIFICATION_FAILURE_HELP = `If this is a legitimate vendor signing-key rotation, see ${SIGNATURE_VERIFICATION_DOCUMENTATION_URL} for instructions to configure the updated public key or temporarily disable signature verification.`;
|
||||
export const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
|
||||
export const INPUT_MVN_SERVER_REPOSITORY_ORIGINS =
|
||||
'mvn-server-repository-origins';
|
||||
export const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
|
||||
export const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
|
||||
export const INPUT_MVN_MIRRORS = 'mvn-mirrors';
|
||||
export const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL =
|
||||
'mvn-repositories-include-central';
|
||||
export const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL =
|
||||
|
||||
@@ -241,7 +241,7 @@ export abstract class JavaBase {
|
||||
if (javaRelease.floating) {
|
||||
if (
|
||||
!semver.valid(foundJava.version) ||
|
||||
!this.isVersionSatisfied(this.version, foundJava.version)
|
||||
!isVersionSatisfies(this.version, foundJava.version)
|
||||
) {
|
||||
throw new Error(
|
||||
`The downloaded ${this.distribution} artifact reported Java ${foundJava.version}, which does not satisfy '${this.version}'.`
|
||||
@@ -401,7 +401,7 @@ export abstract class JavaBase {
|
||||
}
|
||||
if (
|
||||
!semver.valid(restored.release.version) ||
|
||||
!this.isVersionSatisfied(this.version, restored.release.version)
|
||||
!isVersionSatisfies(this.version, restored.release.version)
|
||||
) {
|
||||
core.debug(
|
||||
`Ignoring the cached concrete version '${restored.release.version}' for ${this.distribution} ${this.version}.`
|
||||
@@ -622,10 +622,10 @@ export abstract class JavaBase {
|
||||
.filter(item => item.stable === this.stable);
|
||||
|
||||
const satisfiedVersions = availableVersions
|
||||
.filter(item => this.isVersionSatisfied(this.version, item.version))
|
||||
.filter(item => isVersionSatisfies(this.version, item.version))
|
||||
.filter(item => item.path)
|
||||
.sort((a, b) => {
|
||||
return -this.compareVersions(a.version, b.version);
|
||||
return -semver.compareBuild(a.version, b.version);
|
||||
});
|
||||
if (!satisfiedVersions || satisfiedVersions.length === 0) {
|
||||
return null;
|
||||
@@ -637,14 +637,6 @@ export abstract class JavaBase {
|
||||
};
|
||||
}
|
||||
|
||||
protected isVersionSatisfied(range: string, version: string): boolean {
|
||||
return isVersionSatisfies(range, version);
|
||||
}
|
||||
|
||||
protected compareVersions(a: string, b: string): number {
|
||||
return semver.compareBuild(a, b);
|
||||
}
|
||||
|
||||
protected normalizeVersion(version: string) {
|
||||
let stable = true;
|
||||
const latest = false;
|
||||
@@ -681,10 +673,8 @@ export abstract class JavaBase {
|
||||
stable = false;
|
||||
}
|
||||
|
||||
// Java uses a versioning scheme (JEP 322) that can contain more numeric
|
||||
// fields than SemVer allows, e.g. '18.0.1.1' or '11.0.9.1'. Convert such
|
||||
// exact versions to SemVer build notation ('18.0.1+1', or '26.0.2+1.1'
|
||||
// for '26.0.2.1+1') so they are accepted. Ranges are left untouched.
|
||||
// Normalize Java release tags and JEP 322 versions without losing exact
|
||||
// build constraints ('jdk-27+35' -> '27.0.0+35'). Leave ranges unchanged.
|
||||
version = normalizeJavaVersionToSemver(version);
|
||||
|
||||
if (!semver.validRange(version)) {
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import * as core from '@actions/core';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
import {
|
||||
cacheJdkDir,
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders,
|
||||
isExactCorrettoVersion,
|
||||
convertVersionToSemver,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
@@ -27,19 +24,8 @@ const CORRETTO_VERSIONS_URL =
|
||||
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
|
||||
|
||||
export class CorrettoDistribution extends JavaBase {
|
||||
private readonly requestedVersion: string;
|
||||
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Corretto', {
|
||||
...installerOptions,
|
||||
// Java 8 releases use zero-padded fields, e.g. 8.472.08.1.
|
||||
version: isExactCorrettoVersion(installerOptions.version)
|
||||
? installerOptions.version.replace(/(^|\.)0+(?=\d)/g, '$1')
|
||||
: installerOptions.version
|
||||
});
|
||||
this.requestedVersion = installerOptions.version
|
||||
.replace('+', '.')
|
||||
.replace(/^8\.(\d+)\.(\d)\./, '8.$1.0$2.');
|
||||
super('Corretto', installerOptions);
|
||||
}
|
||||
|
||||
protected async downloadTool(
|
||||
@@ -77,9 +63,6 @@ export class CorrettoDistribution extends JavaBase {
|
||||
if (!this.stable) {
|
||||
throw new Error('Early access versions are not supported');
|
||||
}
|
||||
if (isExactCorrettoVersion(this.requestedVersion)) {
|
||||
return this.findExactRelease();
|
||||
}
|
||||
const availableVersions = await this.getAvailableVersions();
|
||||
|
||||
// The `latest` alias is normalized to the SemVer wildcard, but Corretto
|
||||
@@ -100,9 +83,7 @@ export class CorrettoDistribution extends JavaBase {
|
||||
}
|
||||
|
||||
if (version.includes('.')) {
|
||||
throw new Error(
|
||||
'Specify a major version or a full Corretto release, such as 25.0.5.0.10'
|
||||
);
|
||||
throw new Error('Only major versions are supported');
|
||||
}
|
||||
const matchingVersions = availableVersions
|
||||
.filter(item => item.version == version)
|
||||
@@ -129,91 +110,6 @@ export class CorrettoDistribution extends JavaBase {
|
||||
return resolvedVersion;
|
||||
}
|
||||
|
||||
private async findExactRelease(): Promise<JavaDownloadRelease> {
|
||||
const version = this.requestedVersion;
|
||||
const major = version.split('.')[0];
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.architecture;
|
||||
if (platform !== 'windows' && this.packageType !== 'jdk') {
|
||||
throw new Error('Corretto JRE archives are only available for Windows');
|
||||
}
|
||||
const os =
|
||||
platform === 'macos'
|
||||
? 'macosx'
|
||||
: platform === 'alpine'
|
||||
? 'alpine-linux'
|
||||
: platform;
|
||||
const suffix =
|
||||
platform === 'windows' ? `-${this.packageType}.zip` : '.tar.gz';
|
||||
const url = `https://corretto.aws/downloads/resources/${version}/amazon-corretto-${version}-${os}-${arch}${suffix}`;
|
||||
|
||||
// Versioned archives have no checksum sidecar; Amazon publishes their SHA-256s in the release notes.
|
||||
const source = `https://api.github.com/repos/corretto/corretto-${major}/releases/tags/${version}`;
|
||||
const findCatalogRelease = async (): Promise<
|
||||
JavaDownloadRelease | undefined
|
||||
> => {
|
||||
const archive = (await this.getAvailableVersions()).find(
|
||||
item => item.downloadLink === url
|
||||
);
|
||||
if (!archive) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
version: this.version,
|
||||
url,
|
||||
checksum: {
|
||||
algorithm: 'sha256',
|
||||
value: archive.checksum_sha256,
|
||||
source: CORRETTO_VERSIONS_URL
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
let response;
|
||||
try {
|
||||
response = await this.http.getJson<{body: string | null}>(source, {
|
||||
...getGitHubHttpHeaders(),
|
||||
accept: 'application/vnd.github+json'
|
||||
});
|
||||
} catch (error) {
|
||||
const catalogRelease = await findCatalogRelease();
|
||||
if (catalogRelease) {
|
||||
return catalogRelease;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const row = response.result?.body
|
||||
?.split(/\r?\n/)
|
||||
.find(line => line.includes(`](${url})`));
|
||||
const checksum = row?.match(/`([a-fA-F0-9]{64})`/)?.[1];
|
||||
if (checksum) {
|
||||
return {
|
||||
version: this.version,
|
||||
url,
|
||||
checksum: {algorithm: 'sha256', value: checksum, source}
|
||||
};
|
||||
}
|
||||
|
||||
// The current catalog also covers releases missing from GitHub, such as Corretto 15 and 16.
|
||||
const catalogRelease = await findCatalogRelease();
|
||||
if (catalogRelease) {
|
||||
return catalogRelease;
|
||||
}
|
||||
if (response.statusCode === HttpCodes.NotFound) {
|
||||
throw new Error(
|
||||
`Corretto release ${version} was not found in Amazon's GitHub releases or current download catalog`
|
||||
);
|
||||
}
|
||||
if (!row) {
|
||||
throw new Error(
|
||||
`No ${platform}/${arch} ${this.packageType} archive is listed for Corretto ${version}`
|
||||
);
|
||||
}
|
||||
throw new Error(
|
||||
`No SHA-256 checksum is published for Corretto ${version} (${platform}, ${arch}, ${this.packageType})`
|
||||
);
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<ICorrettoAvailableVersions[]> {
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.distributionArchitecture();
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
cacheJdkDir,
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
import * as core from '@actions/core';
|
||||
@@ -65,8 +66,8 @@ export class LibericaDistributions extends JavaBase {
|
||||
}));
|
||||
|
||||
const satisfiedVersion = availableVersions
|
||||
.filter(item => this.isVersionSatisfied(range, item.version))
|
||||
.sort((a, b) => -this.compareVersions(a.version, b.version))[0];
|
||||
.filter(item => isVersionSatisfies(range, item.version))
|
||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
||||
|
||||
if (!satisfiedVersion) {
|
||||
const availableVersionStrings = availableVersions.map(
|
||||
@@ -78,65 +79,6 @@ export class LibericaDistributions extends JavaBase {
|
||||
return satisfiedVersion;
|
||||
}
|
||||
|
||||
protected normalizeVersion(version: string) {
|
||||
const normalized = super.normalizeVersion(version);
|
||||
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
|
||||
// Keep patch-only requests distinct from exact SDKMAN build requests.
|
||||
normalized.version = version.replace(/-ea$/, '');
|
||||
}
|
||||
return normalized;
|
||||
}
|
||||
|
||||
protected isVersionSatisfied(range: string, version: string): boolean {
|
||||
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
|
||||
if (patchRequest) {
|
||||
const candidate = semver.parse(version);
|
||||
if (!candidate || !semver.eq(patchRequest[1], candidate)) {
|
||||
return false;
|
||||
}
|
||||
const patch =
|
||||
candidate.build.length > 1
|
||||
? candidate.build.slice(0, -1).join('.')
|
||||
: '0';
|
||||
return patch === patchRequest[2].slice(1);
|
||||
}
|
||||
return super.isVersionSatisfied(range, version);
|
||||
}
|
||||
|
||||
protected compareVersions(a: string, b: string): number {
|
||||
const mainComparison = semver.compare(a, b);
|
||||
if (mainComparison !== 0) {
|
||||
return mainComparison;
|
||||
}
|
||||
|
||||
const getPatchAndBuild = (version: string) => {
|
||||
const build = new semver.SemVer(version).build;
|
||||
return build.length > 1
|
||||
? {patch: build.slice(0, -1), build: build[build.length - 1]}
|
||||
: {patch: [], build: build[0] ?? '0'};
|
||||
};
|
||||
const first = getPatchAndBuild(a);
|
||||
const second = getPatchAndBuild(b);
|
||||
const compareNumericIdentifiers = (left: string, right: string) =>
|
||||
semver.compareBuild(`0.0.0+${left}`, `0.0.0+${right}`);
|
||||
|
||||
for (
|
||||
let index = 0;
|
||||
index < Math.max(first.patch.length, second.patch.length);
|
||||
index++
|
||||
) {
|
||||
const patchComparison = compareNumericIdentifiers(
|
||||
first.patch[index] ?? '0',
|
||||
second.patch[index] ?? '0'
|
||||
);
|
||||
if (patchComparison !== 0) {
|
||||
return patchComparison;
|
||||
}
|
||||
}
|
||||
|
||||
return compareNumericIdentifiers(first.build, second.build);
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<LibericaVersion[]> {
|
||||
if (core.isDebug()) {
|
||||
console.time('Retrieving available versions for Liberica took'); // eslint-disable-line no-console
|
||||
@@ -229,14 +171,6 @@ export class LibericaDistributions extends JavaBase {
|
||||
const mainVersion = [featureVersion, interimVersion, updateVersion].join(
|
||||
'.'
|
||||
);
|
||||
const patchVersion = version.version
|
||||
.split('+')[0]
|
||||
.split('.')
|
||||
.slice(3)
|
||||
.join('.');
|
||||
if (patchVersion) {
|
||||
return `${mainVersion}+${patchVersion}.${buildVersion}`;
|
||||
}
|
||||
if (buildVersion != 0) {
|
||||
return `${mainVersion}+${buildVersion}`;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import semver from 'semver';
|
||||
import {normalizeJavaVersionToSemver} from '../util.js';
|
||||
import {JavaDistribution} from './package-types.js';
|
||||
|
||||
export type JavaPlatform = 'linux' | 'macos' | 'windows' | 'solaris';
|
||||
@@ -289,31 +290,20 @@ function isJavaDistribution(value: string): value is JavaDistribution {
|
||||
}
|
||||
|
||||
function isVersionCompatible(version: string, supportedRange: string): boolean {
|
||||
let normalizedVersion = version.trim().toLowerCase();
|
||||
const normalizedVersion = version.trim().toLowerCase();
|
||||
if (normalizedVersion === 'latest') {
|
||||
return true;
|
||||
}
|
||||
if (/^\d+(\.\d+){3,}$/.test(normalizedVersion)) {
|
||||
normalizedVersion = normalizeExtendedVersionToSemver(normalizedVersion);
|
||||
}
|
||||
|
||||
const requestedRange = semver.validRange(
|
||||
normalizedVersion.replace(/-ea$/, '')
|
||||
normalizeJavaVersionToSemver(
|
||||
normalizedVersion.replace(/-ea$/, '').replace('-ea.', '+')
|
||||
)
|
||||
);
|
||||
const capabilityRange = semver.validRange(supportedRange);
|
||||
if (!requestedRange || !capabilityRange) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function normalizeExtendedVersionToSemver(version: string): string {
|
||||
const versionParts = version.split('.');
|
||||
const mainVersion = versionParts.slice(0, 3).join('.');
|
||||
if (versionParts.length > 3) {
|
||||
return `${mainVersion}+${versionParts.slice(3).join('.')}`;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
return semver.intersects(requestedRange, capabilityRange, {
|
||||
includePrerelease: true
|
||||
});
|
||||
|
||||
+17
-26
@@ -397,18 +397,6 @@ export function getVersionFromFileContent(
|
||||
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||
const rawVersion = tentativeVersion.split('-')[0];
|
||||
|
||||
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
|
||||
if (
|
||||
(extractedDistribution || distributionName) === 'corretto' &&
|
||||
capturedVersion === tentativeVersion &&
|
||||
isExactCorrettoVersion(tentativeVersion)
|
||||
) {
|
||||
return {
|
||||
version: tentativeVersion,
|
||||
distribution: extractedDistribution
|
||||
};
|
||||
}
|
||||
|
||||
let version = semver.validRange(rawVersion)
|
||||
? tentativeVersion
|
||||
: semver.coerce(tentativeVersion);
|
||||
@@ -512,13 +500,6 @@ function avoidOldNotation(content: string): string {
|
||||
return content.startsWith('1.') ? content.substring(2) : content;
|
||||
}
|
||||
|
||||
export function isExactCorrettoVersion(version: string): boolean {
|
||||
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
|
||||
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(
|
||||
version.replace('+', '.')
|
||||
);
|
||||
}
|
||||
|
||||
export function convertVersionToSemver(version: number[] | string) {
|
||||
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
|
||||
const versionArray = Array.isArray(version) ? version : version.split('.');
|
||||
@@ -530,18 +511,28 @@ export function convertVersionToSemver(version: number[] | string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Java versions (JEP 322) can contain more numeric fields than SemVer allows,
|
||||
* e.g. '11.0.9.1' or Temurin respins such as '26.0.2.1+1'. Move the extra
|
||||
* fields into SemVer build metadata ('11.0.9+1', '26.0.2+1.1'). Any other
|
||||
* input (ranges, regular SemVer versions) is returned unchanged.
|
||||
* Normalize numeric Java versions, optionally prefixed with 'jdk-'. Pad
|
||||
* abbreviated build requests ('27+35' -> '27.0.0+35') to preserve exact
|
||||
* matching, and move extra JEP 322 fields into build metadata
|
||||
* ('26.0.2.1+1' -> '26.0.2+1.1'). Leave ranges unchanged.
|
||||
*/
|
||||
export function normalizeJavaVersionToSemver(version: string): string {
|
||||
const match = /^(\d+(?:\.\d+){3,})(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
const match = /^(?:jdk-)?(\d+(?:\.\d+)*)(?:\+([0-9A-Za-z.-]+))?$/.exec(
|
||||
version
|
||||
);
|
||||
if (!match) {
|
||||
return version;
|
||||
}
|
||||
const converted = convertVersionToSemver(match[1]);
|
||||
return match[2] ? `${converted}.${match[2]}` : converted;
|
||||
const versionParts = match[1].split('.');
|
||||
if (match[2]) {
|
||||
while (versionParts.length < 3) {
|
||||
versionParts.push('0');
|
||||
}
|
||||
}
|
||||
const converted = convertVersionToSemver(versionParts.join('.'));
|
||||
return match[2]
|
||||
? `${converted}${versionParts.length > 3 ? '.' : '+'}${match[2]}`
|
||||
: converted;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user