@@ -92315,6 +92315,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
92315
92315
exports.GradleStateCache = exports.META_FILE_DIR = void 0;
92316
92316
const core = __importStar(__nccwpck_require__(2186));
92317
92317
const exec = __importStar(__nccwpck_require__(1514));
92318
+ const glob = __importStar(__nccwpck_require__(8090));
92318
92319
const path_1 = __importDefault(__nccwpck_require__(1017));
92319
92320
const fs_1 = __importDefault(__nccwpck_require__(7147));
92320
92321
const params = __importStar(__nccwpck_require__(3885));
@@ -92369,6 +92370,7 @@ class GradleStateCache {
92369
92370
return __awaiter(this, void 0, void 0, function* () {
92370
92371
yield this.debugReportGradleUserHomeSize('as restored from cache');
92371
92372
yield new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).restore(listener);
92373
+ yield new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener);
92372
92374
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
92373
92375
});
92374
92376
}
@@ -92405,20 +92407,30 @@ class GradleStateCache {
92405
92407
beforeSave(listener) {
92406
92408
return __awaiter(this, void 0, void 0, function* () {
92407
92409
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
92408
- this.deleteExcludedPaths();
92410
+ yield this.deleteExcludedPaths();
92409
92411
yield Promise.all([
92410
- new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener)
92412
+ new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener),
92413
+ new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
92411
92414
]);
92412
92415
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
92413
92416
});
92414
92417
}
92415
92418
deleteExcludedPaths() {
92416
- const rawPaths = params.getCacheExcludes();
92417
- const resolvedPaths = rawPaths.map(x => path_1.default.resolve(this.gradleUserHome, x));
92418
- for (const p of resolvedPaths) {
92419
- (0, cache_utils_1.cacheDebug)(`Deleting excluded path: ${p}`);
92420
- (0, cache_utils_1.tryDelete)(p);
92421
- }
92419
+ return __awaiter(this, void 0, void 0, function* () {
92420
+ const rawPaths = params.getCacheExcludes();
92421
+ rawPaths.push('caches/*/cc-keystore');
92422
+ const resolvedPaths = rawPaths.map(x => path_1.default.resolve(this.gradleUserHome, x));
92423
+ for (const p of resolvedPaths) {
92424
+ (0, cache_utils_1.cacheDebug)(`Removing excluded path: ${p}`);
92425
+ const globber = yield glob.create(p, {
92426
+ implicitDescendants: false
92427
+ });
92428
+ for (const toDelete of yield globber.glob()) {
92429
+ (0, cache_utils_1.cacheDebug)(`Removing excluded file: ${toDelete}`);
92430
+ yield (0, cache_utils_1.tryDelete)(toDelete);
92431
+ }
92432
+ }
92433
+ });
92422
92434
}
92423
92435
getCachePath() {
92424
92436
const rawPaths = params.getCacheIncludes();
@@ -92879,15 +92891,43 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
92879
92891
restore: { get: () => super.restore }
92880
92892
});
92881
92893
return __awaiter(this, void 0, void 0, function* () {
92882
- if (listener.fullyRestored) {
92883
- return _super.restore.call(this, listener);
92894
+ if (!listener.fullyRestored) {
92895
+ core.info('Not restoring configuration-cache state, as Gradle User Home was not fully restored');
92896
+ for (const cacheEntry of this.loadExtractedCacheEntries()) {
92897
+ listener.entry(cacheEntry.pattern).markNotRestored('Gradle User Home not fully restored');
92898
+ }
92899
+ return;
92884
92900
}
92885
- core.info('Not restoring configuration-cache state, as Gradle User Home was not fully restored');
92886
- for (const cacheEntry of this.loadExtractedCacheEntries()) {
92887
- listener.entry(cacheEntry.pattern).markRequested('NOT_RESTORED');
92901
+ const encryptionKey = this.getEncryptionKey();
92902
+ if (!encryptionKey) {
92903
+ core.info('Not restoring configuration-cache state, as no encryption key was provided');
92904
+ for (const cacheEntry of this.loadExtractedCacheEntries()) {
92905
+ listener.entry(cacheEntry.pattern).markNotRestored('No encryption key provided');
92906
+ }
92907
+ return;
92888
92908
}
92909
+ core.exportVariable('GRADLE_ENCRYPTION_KEY', encryptionKey);
92910
+ return yield _super.restore.call(this, listener);
92889
92911
});
92890
92912
}
92913
+ extract(listener) {
92914
+ const _super = Object.create(null, {
92915
+ extract: { get: () => super.extract }
92916
+ });
92917
+ return __awaiter(this, void 0, void 0, function* () {
92918
+ if (!this.getEncryptionKey()) {
92919
+ core.info('Not saving configuration-cache state, as no encryption key was provided');
92920
+ for (const cacheEntry of this.loadExtractedCacheEntries()) {
92921
+ listener.entry(cacheEntry.pattern).markNotSaved('No encryption key provided');
92922
+ }
92923
+ }
92924
+ yield _super.extract.call(this, listener);
92925
+ });
92926
+ }
92927
+ getEncryptionKey() {
92928
+ const encryptionKey = params.getCacheEncryptionKey();
92929
+ return encryptionKey.length > 0 ? encryptionKey : undefined;
92930
+ }
92891
92931
getExtractedCacheEntryDefinitions() {
92892
92932
return this.getProjectRoots().map(projectRoot => {
92893
92933
const configCachePath = path_1.default.resolve(projectRoot, '.gradle/configuration-cache');
@@ -93167,7 +93207,7 @@ const crypto = __importStar(__nccwpck_require__(6113));
93167
93207
const path = __importStar(__nccwpck_require__(1017));
93168
93208
const fs = __importStar(__nccwpck_require__(7147));
93169
93209
const params = __importStar(__nccwpck_require__(3885));
93170
- const CACHE_PROTOCOL_VERSION = 'v8 -';
93210
+ const CACHE_PROTOCOL_VERSION = 'v9 -';
93171
93211
const CACHE_KEY_PREFIX_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX';
93172
93212
const CACHE_KEY_OS_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT';
93173
93213
const CACHE_KEY_JOB_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_JOB';
@@ -93994,7 +94034,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
93994
94034
return result;
93995
94035
};
93996
94036
Object.defineProperty(exports, "__esModule", ({ value: true }));
93997
- exports.DependencyGraphOption = exports.parseNumericInput = exports.getArtifactRetentionDays = exports.getDependencyGraphOption = exports.isDependencyGraphEnabled = exports.isJobSummaryEnabled = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getGradleExecutable = exports.getGradleVersion = exports.getBuildRootDirectory = exports.getCacheExcludes = exports.getCacheIncludes = exports.isCacheCleanupEnabled = exports.isCacheDebuggingEnabled = exports.isCacheStrictMatch = exports.isCacheOverwriteExisting = exports.isCacheWriteOnly = exports.isCacheReadOnly = exports.isCacheDisabled = void 0;
94037
+ exports.DependencyGraphOption = exports.parseNumericInput = exports.getArtifactRetentionDays = exports.getDependencyGraphOption = exports.isDependencyGraphEnabled = exports.isJobSummaryEnabled = exports.getGithubToken = exports.getJobMatrix = exports.getArguments = exports.getGradleExecutable = exports.getGradleVersion = exports.getBuildRootDirectory = exports.getCacheExcludes = exports.getCacheIncludes = exports.getCacheEncryptionKey = exports. isCacheCleanupEnabled = exports.isCacheDebuggingEnabled = exports.isCacheStrictMatch = exports.isCacheOverwriteExisting = exports.isCacheWriteOnly = exports.isCacheReadOnly = exports.isCacheDisabled = void 0;
93998
94038
const core = __importStar(__nccwpck_require__(2186));
93999
94039
const string_argv_1 = __nccwpck_require__(9663);
94000
94040
function isCacheDisabled() {
@@ -94025,6 +94065,10 @@ function isCacheCleanupEnabled() {
94025
94065
return getBooleanInput('gradle-home-cache-cleanup');
94026
94066
}
94027
94067
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
94068
+ function getCacheEncryptionKey() {
94069
+ return core.getInput('cache-encryption-key');
94070
+ }
94071
+ exports.getCacheEncryptionKey = getCacheEncryptionKey;
94028
94072
function getCacheIncludes() {
94029
94073
return core.getMultilineInput('gradle-home-cache-includes');
94030
94074
}
@@ -94670,7 +94714,7 @@ function complete() {
94670
94714
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
94671
94715
return;
94672
94716
}
94673
- core.info('In final post-action step, saving state and writing summary ');
94717
+ core.info('In post-action step');
94674
94718
const buildResults = (0, build_results_1.loadBuildResults)();
94675
94719
const gradleUserHome = core.getState(GRADLE_USER_HOME);
94676
94720
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
@@ -94683,6 +94727,7 @@ function complete() {
94683
94727
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
94684
94728
}
94685
94729
yield dependencyGraph.complete(params.getDependencyGraphOption());
94730
+ core.info('Completed post-action step');
94686
94731
});
94687
94732
}
94688
94733
exports.complete = complete;
0 commit comments