5
0
mirror of https://gitea.com/actions/setup-java.git synced 2026-08-05 02:31:18 +00:00

Add JDK caching

Cache resolved JDK tool-cache entries by exact platform and release identity, with a default-on cache-jdk input and explicit opt-out.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-08-04 19:02:19 -04:00
parent 60b1ab8234
commit ee3e6d82d3
21 changed files with 1695 additions and 804 deletions
+9 -2
View File
@@ -30770,6 +30770,7 @@ module.exports = {
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
/* harmony export */ At: () => (/* binding */ INPUT_CACHE_DEPENDENCY_PATH),
/* harmony export */ E8: () => (/* binding */ INPUT_SET_DEFAULT),
/* harmony export */ GL: () => (/* binding */ INPUT_CACHE_JDK),
/* harmony export */ I9: () => (/* binding */ INPUT_FORCE_DOWNLOAD),
/* harmony export */ K$: () => (/* binding */ GPG_PASSPHRASE_PROFILE_ID),
/* harmony export */ LS: () => (/* binding */ INPUT_ARCHITECTURE),
@@ -30849,6 +30850,7 @@ const MAVEN_GPG_PASSPHRASE_DEFAULT_ENV = 'MAVEN_GPG_PASSPHRASE';
// Id of the settings.xml profile used to set `gpg.passphraseEnvName`.
const GPG_PASSPHRASE_PROFILE_ID = 'setup-java-gpg';
const INPUT_CACHE = 'cache';
const INPUT_CACHE_JDK = 'cache-jdk';
const INPUT_CACHE_DEPENDENCY_PATH = 'cache-dependency-path';
const INPUT_CACHE_PATH = 'cache-path';
const INPUT_CACHE_READ_ONLY = 'cache-read-only';
@@ -31890,6 +31892,7 @@ __nccwpck_require__.d(__webpack_exports__, {
dN: () => (/* binding */ exportVariable),
V4: () => (/* binding */ getInput),
q3: () => (/* binding */ getMultilineInput),
Gu: () => (/* binding */ getState),
pq: () => (/* binding */ info),
_o: () => (/* binding */ isDebug),
LZ: () => (/* binding */ saveState),
@@ -31900,7 +31903,7 @@ __nccwpck_require__.d(__webpack_exports__, {
$e: () => (/* binding */ warning)
});
// UNUSED EXPORTS: ExitCode, getBooleanInput, getIDToken, getState, group, markdownSummary, notice, platform, setCommandEcho, summary, toPlatformPath, toPosixPath, toWin32Path
// UNUSED EXPORTS: ExitCode, getBooleanInput, getIDToken, group, markdownSummary, notice, platform, setCommandEcho, summary, toPlatformPath, toPosixPath, toWin32Path
// EXTERNAL MODULE: external "os"
var external_os_ = __nccwpck_require__(857);
@@ -36119,6 +36122,7 @@ async function run() {
const packageType = setup_java_core/* getInput */.V4(constants/* INPUT_JAVA_PACKAGE */.p1);
const jdkFile = getJdkFileInput();
const cache = setup_java_core/* getInput */.V4(constants/* INPUT_CACHE */.gk);
const cacheJdk = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_CACHE_JDK */.GL, true);
const cacheDependencyPath = setup_java_core/* getInput */.V4(constants/* INPUT_CACHE_DEPENDENCY_PATH */.At);
const cachePath = setup_java_core/* getMultilineInput */.q3(constants/* INPUT_CACHE_PATH */.uW);
const checkLatest = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_CHECK_LATEST */.YM, false);
@@ -36157,6 +36161,7 @@ async function run() {
packageType,
checkLatest,
forceDownload,
cacheJdk,
setDefault,
verifySignature,
verifySignaturePublicKey,
@@ -36179,6 +36184,7 @@ async function run() {
packageType,
checkLatest,
forceDownload,
cacheJdk,
setDefault,
verifySignature,
verifySignaturePublicKey,
@@ -36231,12 +36237,13 @@ function getJdkFileInput() {
return jdkFile || deprecatedJdkFile;
}
async function installVersion(version, options, toolchainId = 0) {
const { distributionName, jdkFile, architecture, packageType, checkLatest, forceDownload, setDefault, verifySignature, verifySignaturePublicKey, toolchainIds } = options;
const { distributionName, jdkFile, architecture, packageType, checkLatest, forceDownload, cacheJdk, setDefault, verifySignature, verifySignaturePublicKey, toolchainIds } = options;
const installerOptions = {
architecture,
packageType,
checkLatest,
forceDownload,
cacheJdk,
setDefault,
verifySignature,
verifySignaturePublicKey,