mirror of
https://gitea.com/actions/setup-java.git
synced 2026-10-02 21:25:25 +08:00
Accept 4-part versions with build metadata (X.Y.Z.P+B -> X.Y.Z+P.B) and match exact Temurin requests against OpenJDK-derived version keys, since the Adoptium API semver folds the patch into the build number (26.0.2+101) and adds LTS metadata (25.0.4+7.0.LTS). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Vendored
+15
-1
@@ -30848,7 +30848,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, convertVersionToSemver, 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);
|
||||
@@ -31247,6 +31247,20 @@ 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.
|
||||
*/
|
||||
function normalizeJavaVersionToSemver(version) {
|
||||
const match = /^(\d+(?:\.\d+){3,})(?:\+([0-9A-Za-z.-]+))?$/.exec(version);
|
||||
if (!match) {
|
||||
return version;
|
||||
}
|
||||
const converted = convertVersionToSemver(match[1]);
|
||||
return match[2] ? `${converted}.${match[2]}` : converted;
|
||||
}
|
||||
/**
|
||||
* Builds a validator for the bytes currently served by a URL from the response
|
||||
* headers of a HEAD request. A vendor's `/latest/` URL never changes, so this
|
||||
|
||||
Reference in New Issue
Block a user