Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 85de0aa

Browse files
committed
Build outputs
1 parent 6d7eb2b commit 85de0aa

File tree

4 files changed

+124
-34
lines changed

4 files changed

+124
-34
lines changed

dist/main/index.js

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92315,6 +92315,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
9231592315
exports.GradleStateCache = exports.META_FILE_DIR = void 0;
9231692316
const core = __importStar(__nccwpck_require__(2186));
9231792317
const exec = __importStar(__nccwpck_require__(1514));
92318+
const glob = __importStar(__nccwpck_require__(8090));
9231892319
const path_1 = __importDefault(__nccwpck_require__(1017));
9231992320
const fs_1 = __importDefault(__nccwpck_require__(7147));
9232092321
const params = __importStar(__nccwpck_require__(3885));
@@ -92369,6 +92370,7 @@ class GradleStateCache {
9236992370
return __awaiter(this, void 0, void 0, function* () {
9237092371
yield this.debugReportGradleUserHomeSize('as restored from cache');
9237192372
yield new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).restore(listener);
92373+
yield new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener);
9237292374
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
9237392375
});
9237492376
}
@@ -92405,20 +92407,30 @@ class GradleStateCache {
9240592407
beforeSave(listener) {
9240692408
return __awaiter(this, void 0, void 0, function* () {
9240792409
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
92408-
this.deleteExcludedPaths();
92410+
yield this.deleteExcludedPaths();
9240992411
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)
9241192414
]);
9241292415
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
9241392416
});
9241492417
}
9241592418
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+
});
9242292434
}
9242392435
getCachePath() {
9242492436
const rawPaths = params.getCacheIncludes();
@@ -92879,15 +92891,43 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
9287992891
restore: { get: () => super.restore }
9288092892
});
9288192893
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;
9288492900
}
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;
9288892908
}
92909+
core.exportVariable('GRADLE_ENCRYPTION_KEY', encryptionKey);
92910+
return yield _super.restore.call(this, listener);
9288992911
});
9289092912
}
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+
}
9289192931
getExtractedCacheEntryDefinitions() {
9289292932
return this.getProjectRoots().map(projectRoot => {
9289392933
const configCachePath = path_1.default.resolve(projectRoot, '.gradle/configuration-cache');
@@ -93167,7 +93207,7 @@ const crypto = __importStar(__nccwpck_require__(6113));
9316793207
const path = __importStar(__nccwpck_require__(1017));
9316893208
const fs = __importStar(__nccwpck_require__(7147));
9316993209
const params = __importStar(__nccwpck_require__(3885));
93170-
const CACHE_PROTOCOL_VERSION = 'v8-';
93210+
const CACHE_PROTOCOL_VERSION = 'v9-';
9317193211
const CACHE_KEY_PREFIX_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX';
9317293212
const CACHE_KEY_OS_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT';
9317393213
const CACHE_KEY_JOB_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_JOB';
@@ -93994,7 +94034,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
9399494034
return result;
9399594035
};
9399694036
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;
9399894038
const core = __importStar(__nccwpck_require__(2186));
9399994039
const string_argv_1 = __nccwpck_require__(9663);
9400094040
function isCacheDisabled() {
@@ -94025,6 +94065,10 @@ function isCacheCleanupEnabled() {
9402594065
return getBooleanInput('gradle-home-cache-cleanup');
9402694066
}
9402794067
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
94068+
function getCacheEncryptionKey() {
94069+
return core.getInput('cache-encryption-key');
94070+
}
94071+
exports.getCacheEncryptionKey = getCacheEncryptionKey;
9402894072
function getCacheIncludes() {
9402994073
return core.getMultilineInput('gradle-home-cache-includes');
9403094074
}
@@ -94670,7 +94714,7 @@ function complete() {
9467094714
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
9467194715
return;
9467294716
}
94673-
core.info('In final post-action step, saving state and writing summary');
94717+
core.info('In post-action step');
9467494718
const buildResults = (0, build_results_1.loadBuildResults)();
9467594719
const gradleUserHome = core.getState(GRADLE_USER_HOME);
9467694720
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
@@ -94683,6 +94727,7 @@ function complete() {
9468394727
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
9468494728
}
9468594729
yield dependencyGraph.complete(params.getDependencyGraphOption());
94730+
core.info('Completed post-action step');
9468694731
});
9468794732
}
9468894733
exports.complete = complete;

dist/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92315,6 +92315,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
9231592315
exports.GradleStateCache = exports.META_FILE_DIR = void 0;
9231692316
const core = __importStar(__nccwpck_require__(2186));
9231792317
const exec = __importStar(__nccwpck_require__(1514));
92318+
const glob = __importStar(__nccwpck_require__(8090));
9231892319
const path_1 = __importDefault(__nccwpck_require__(1017));
9231992320
const fs_1 = __importDefault(__nccwpck_require__(7147));
9232092321
const params = __importStar(__nccwpck_require__(3885));
@@ -92369,6 +92370,7 @@ class GradleStateCache {
9236992370
return __awaiter(this, void 0, void 0, function* () {
9237092371
yield this.debugReportGradleUserHomeSize('as restored from cache');
9237192372
yield new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).restore(listener);
92373+
yield new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener);
9237292374
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
9237392375
});
9237492376
}
@@ -92405,20 +92407,30 @@ class GradleStateCache {
9240592407
beforeSave(listener) {
9240692408
return __awaiter(this, void 0, void 0, function* () {
9240792409
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
92408-
this.deleteExcludedPaths();
92410+
yield this.deleteExcludedPaths();
9240992411
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)
9241192414
]);
9241292415
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
9241392416
});
9241492417
}
9241592418
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+
});
9242292434
}
9242392435
getCachePath() {
9242492436
const rawPaths = params.getCacheIncludes();
@@ -92879,15 +92891,43 @@ class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
9287992891
restore: { get: () => super.restore }
9288092892
});
9288192893
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;
9288492900
}
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;
9288892908
}
92909+
core.exportVariable('GRADLE_ENCRYPTION_KEY', encryptionKey);
92910+
return yield _super.restore.call(this, listener);
9288992911
});
9289092912
}
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+
}
9289192931
getExtractedCacheEntryDefinitions() {
9289292932
return this.getProjectRoots().map(projectRoot => {
9289392933
const configCachePath = path_1.default.resolve(projectRoot, '.gradle/configuration-cache');
@@ -93167,7 +93207,7 @@ const crypto = __importStar(__nccwpck_require__(6113));
9316793207
const path = __importStar(__nccwpck_require__(1017));
9316893208
const fs = __importStar(__nccwpck_require__(7147));
9316993209
const params = __importStar(__nccwpck_require__(3885));
93170-
const CACHE_PROTOCOL_VERSION = 'v8-';
93210+
const CACHE_PROTOCOL_VERSION = 'v9-';
9317193211
const CACHE_KEY_PREFIX_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX';
9317293212
const CACHE_KEY_OS_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT';
9317393213
const CACHE_KEY_JOB_VAR = 'GRADLE_BUILD_ACTION_CACHE_KEY_JOB';
@@ -93862,7 +93902,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
9386293902
return result;
9386393903
};
9386493904
Object.defineProperty(exports, "__esModule", ({ value: true }));
93865-
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;
93905+
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;
9386693906
const core = __importStar(__nccwpck_require__(2186));
9386793907
const string_argv_1 = __nccwpck_require__(9663);
9386893908
function isCacheDisabled() {
@@ -93893,6 +93933,10 @@ function isCacheCleanupEnabled() {
9389393933
return getBooleanInput('gradle-home-cache-cleanup');
9389493934
}
9389593935
exports.isCacheCleanupEnabled = isCacheCleanupEnabled;
93936+
function getCacheEncryptionKey() {
93937+
return core.getInput('cache-encryption-key');
93938+
}
93939+
exports.getCacheEncryptionKey = getCacheEncryptionKey;
9389693940
function getCacheIncludes() {
9389793941
return core.getMultilineInput('gradle-home-cache-includes');
9389893942
}
@@ -94302,7 +94346,7 @@ function complete() {
9430294346
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
9430394347
return;
9430494348
}
94305-
core.info('In final post-action step, saving state and writing summary');
94349+
core.info('In post-action step');
9430694350
const buildResults = (0, build_results_1.loadBuildResults)();
9430794351
const gradleUserHome = core.getState(GRADLE_USER_HOME);
9430894352
const cacheListener = cache_reporting_1.CacheListener.rehydrate(core.getState(CACHE_LISTENER));
@@ -94315,6 +94359,7 @@ function complete() {
9431594359
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
9431694360
}
9431794361
yield dependencyGraph.complete(params.getDependencyGraphOption());
94362+
core.info('Completed post-action step');
9431894363
});
9431994364
}
9432094365
exports.complete = complete;

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)