mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-25 14:26:19 +08:00
Build outputs
This commit is contained in:
parent
8f3c97e3f1
commit
d79b3ba8ae
164
dist/main/index.js
vendored
164
dist/main/index.js
vendored
@ -64964,65 +64964,16 @@ class GradleStateCache {
|
|||||||
initializeGradleUserHome(gradleUserHome, initScriptsDir) {
|
initializeGradleUserHome(gradleUserHome, initScriptsDir) {
|
||||||
const propertiesFile = path_1.default.resolve(gradleUserHome, 'gradle.properties');
|
const propertiesFile = path_1.default.resolve(gradleUserHome, 'gradle.properties');
|
||||||
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
|
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
|
||||||
const buildScanCapture = path_1.default.resolve(initScriptsDir, 'build-scan-capture.init.gradle');
|
const initScriptFilenames = ['build-result-capture.init.gradle', 'project-root-capture.init.gradle'];
|
||||||
fs_1.default.writeFileSync(buildScanCapture, `import org.gradle.util.GradleVersion
|
for (const initScriptFilename of initScriptFilenames) {
|
||||||
|
const initScriptContent = this.readResourceAsString(initScriptFilename);
|
||||||
// Only run against root build. Do not run against included builds.
|
const initScriptPath = path_1.default.resolve(initScriptsDir, initScriptFilename);
|
||||||
def isTopLevelBuild = gradle.getParent() == null
|
fs_1.default.writeFileSync(initScriptPath, initScriptContent);
|
||||||
if (isTopLevelBuild) {
|
|
||||||
def version = GradleVersion.current().baseVersion
|
|
||||||
def atLeastGradle4 = version >= GradleVersion.version("4.0")
|
|
||||||
def atLeastGradle6 = version >= GradleVersion.version("6.0")
|
|
||||||
|
|
||||||
if (atLeastGradle6) {
|
|
||||||
settingsEvaluated { settings ->
|
|
||||||
if (settings.pluginManager.hasPlugin("com.gradle.enterprise")) {
|
|
||||||
registerCallbacks(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject.name)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (atLeastGradle4) {
|
readResourceAsString(resource) {
|
||||||
projectsEvaluated { gradle ->
|
const absolutePath = path_1.default.resolve(__dirname, '..', '..', 'src', 'resources', resource);
|
||||||
if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) {
|
return fs_1.default.readFileSync(absolutePath, 'utf8');
|
||||||
registerCallbacks(gradle.rootProject.extensions["buildScan"], gradle.rootProject.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def registerCallbacks(buildScanExtension, rootProjectName) {
|
|
||||||
buildScanExtension.with {
|
|
||||||
def buildFailed = false
|
|
||||||
buildFinished { result ->
|
|
||||||
buildFailed = (result.failure != null)
|
|
||||||
}
|
|
||||||
|
|
||||||
buildScanPublished { buildScan ->
|
|
||||||
// Send commands directly to GitHub Actions via STDOUT.
|
|
||||||
def gradleCommand = rootProjectName + " " + gradle.startParameter.taskNames.join(" ")
|
|
||||||
|
|
||||||
def githubSummaryFile = new File(System.getenv("GITHUB_STEP_SUMMARY"))
|
|
||||||
if (buildFailed) {
|
|
||||||
githubSummaryFile << ":x: Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-FAILED-red?logo=Gradle)](\${buildScan.buildScanUri})"
|
|
||||||
} else {
|
|
||||||
githubSummaryFile << ":white_check_mark: Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-SUCCESS-brightgreen?logo=Gradle)](\${buildScan.buildScanUri})"
|
|
||||||
}
|
|
||||||
println("::set-output name=build-scan-url::\${buildScan.buildScanUri}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}`);
|
|
||||||
const projectRootCapture = path_1.default.resolve(initScriptsDir, 'project-root-capture.init.gradle');
|
|
||||||
fs_1.default.writeFileSync(projectRootCapture, `
|
|
||||||
// Only run against root build. Do not run against included builds.
|
|
||||||
def isTopLevelBuild = gradle.getParent() == null
|
|
||||||
if (isTopLevelBuild) {
|
|
||||||
settingsEvaluated { settings ->
|
|
||||||
def projectRootEntry = settings.rootDir.absolutePath + "\\n"
|
|
||||||
def projectRootList = new File(settings.gradle.gradleUserHomeDir, "${exports.PROJECT_ROOTS_FILE}")
|
|
||||||
if (!projectRootList.exists() || !projectRootList.text.contains(projectRootEntry)) {
|
|
||||||
projectRootList << projectRootEntry
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}`);
|
|
||||||
}
|
}
|
||||||
debugReportGradleUserHomeSize(label) {
|
debugReportGradleUserHomeSize(label) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -65748,7 +65699,6 @@ const cache_utils_1 = __nccwpck_require__(1678);
|
|||||||
const cache_reporting_1 = __nccwpck_require__(6674);
|
const cache_reporting_1 = __nccwpck_require__(6674);
|
||||||
const cache_base_1 = __nccwpck_require__(7591);
|
const cache_base_1 = __nccwpck_require__(7591);
|
||||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
|
||||||
const CACHE_LISTENER = 'CACHE_LISTENER';
|
const CACHE_LISTENER = 'CACHE_LISTENER';
|
||||||
function restore(gradleUserHome) {
|
function restore(gradleUserHome) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -65770,7 +65720,6 @@ function restore(gradleUserHome) {
|
|||||||
}
|
}
|
||||||
gradleStateCache.init();
|
gradleStateCache.init();
|
||||||
core.saveState(CACHE_RESTORED_VAR, true);
|
core.saveState(CACHE_RESTORED_VAR, true);
|
||||||
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
|
||||||
if ((0, cache_utils_1.isCacheWriteOnly)()) {
|
if ((0, cache_utils_1.isCacheWriteOnly)()) {
|
||||||
core.info('Cache is write-only: will not restore from cache.');
|
core.info('Cache is write-only: will not restore from cache.');
|
||||||
return;
|
return;
|
||||||
@ -65783,7 +65732,7 @@ function restore(gradleUserHome) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.restore = restore;
|
exports.restore = restore;
|
||||||
function save() {
|
function save(gradleUserHome) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!shouldSaveCaches()) {
|
if (!shouldSaveCaches()) {
|
||||||
return;
|
return;
|
||||||
@ -65795,7 +65744,6 @@ function save() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
||||||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
|
||||||
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
||||||
}));
|
}));
|
||||||
(0, cache_reporting_1.logCachingReport)(cacheListener);
|
(0, cache_reporting_1.logCachingReport)(cacheListener);
|
||||||
@ -65989,9 +65937,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||||||
exports.run = void 0;
|
exports.run = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const path = __importStar(__nccwpck_require__(1017));
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
const os = __importStar(__nccwpck_require__(2037));
|
|
||||||
const string_argv_1 = __nccwpck_require__(9453);
|
const string_argv_1 = __nccwpck_require__(9453);
|
||||||
const caches = __importStar(__nccwpck_require__(3800));
|
const setupGradle = __importStar(__nccwpck_require__(8652));
|
||||||
const execution = __importStar(__nccwpck_require__(3584));
|
const execution = __importStar(__nccwpck_require__(3584));
|
||||||
const provision = __importStar(__nccwpck_require__(2501));
|
const provision = __importStar(__nccwpck_require__(2501));
|
||||||
function run() {
|
function run() {
|
||||||
@ -65999,8 +65946,7 @@ function run() {
|
|||||||
try {
|
try {
|
||||||
const workspaceDirectory = process.env[`GITHUB_WORKSPACE`] || '';
|
const workspaceDirectory = process.env[`GITHUB_WORKSPACE`] || '';
|
||||||
const buildRootDirectory = resolveBuildRootDirectory(workspaceDirectory);
|
const buildRootDirectory = resolveBuildRootDirectory(workspaceDirectory);
|
||||||
const gradleUserHome = determineGradleUserHome(buildRootDirectory);
|
yield setupGradle.setup(buildRootDirectory);
|
||||||
yield caches.restore(gradleUserHome);
|
|
||||||
const executable = yield provisionGradle(workspaceDirectory);
|
const executable = yield provisionGradle(workspaceDirectory);
|
||||||
if (executable !== undefined) {
|
if (executable !== undefined) {
|
||||||
core.addPath(path.dirname(executable));
|
core.addPath(path.dirname(executable));
|
||||||
@ -66038,13 +65984,6 @@ function resolveBuildRootDirectory(baseDirectory) {
|
|||||||
const resolvedBuildRootDirectory = buildRootDirectory === '' ? path.resolve(baseDirectory) : path.resolve(baseDirectory, buildRootDirectory);
|
const resolvedBuildRootDirectory = buildRootDirectory === '' ? path.resolve(baseDirectory) : path.resolve(baseDirectory, buildRootDirectory);
|
||||||
return resolvedBuildRootDirectory;
|
return resolvedBuildRootDirectory;
|
||||||
}
|
}
|
||||||
function determineGradleUserHome(rootDir) {
|
|
||||||
const customGradleUserHome = process.env['GRADLE_USER_HOME'];
|
|
||||||
if (customGradleUserHome) {
|
|
||||||
return path.resolve(rootDir, customGradleUserHome);
|
|
||||||
}
|
|
||||||
return path.resolve(os.homedir(), '.gradle');
|
|
||||||
}
|
|
||||||
function parseCommandLineArguments() {
|
function parseCommandLineArguments() {
|
||||||
const input = core.getInput('arguments');
|
const input = core.getInput('arguments');
|
||||||
return (0, string_argv_1.parseArgsStringToArgv)(input);
|
return (0, string_argv_1.parseArgsStringToArgv)(input);
|
||||||
@ -66255,6 +66194,87 @@ function httpGetString(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8652:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.complete = exports.setup = void 0;
|
||||||
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
|
const os = __importStar(__nccwpck_require__(2037));
|
||||||
|
const caches = __importStar(__nccwpck_require__(3800));
|
||||||
|
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
|
||||||
|
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
||||||
|
function setup(buildRootDirectory) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const gradleUserHome = determineGradleUserHome(buildRootDirectory);
|
||||||
|
if (process.env[GRADLE_SETUP_VAR]) {
|
||||||
|
core.info('Gradle setup only performed on first gradle-build-action step in workflow.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
core.exportVariable(GRADLE_SETUP_VAR, true);
|
||||||
|
core.saveState(GRADLE_SETUP_VAR, true);
|
||||||
|
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
||||||
|
yield caches.restore(gradleUserHome);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.setup = setup;
|
||||||
|
function complete() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!core.getState(GRADLE_SETUP_VAR)) {
|
||||||
|
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||||
|
yield caches.save(gradleUserHome);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.complete = complete;
|
||||||
|
function determineGradleUserHome(rootDir) {
|
||||||
|
const customGradleUserHome = process.env['GRADLE_USER_HOME'];
|
||||||
|
if (customGradleUserHome) {
|
||||||
|
return path.resolve(rootDir, customGradleUserHome);
|
||||||
|
}
|
||||||
|
return path.resolve(os.homedir(), '.gradle');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 2877:
|
/***/ 2877:
|
||||||
|
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
157
dist/post/index.js
vendored
157
dist/post/index.js
vendored
@ -64015,65 +64015,16 @@ class GradleStateCache {
|
|||||||
initializeGradleUserHome(gradleUserHome, initScriptsDir) {
|
initializeGradleUserHome(gradleUserHome, initScriptsDir) {
|
||||||
const propertiesFile = path_1.default.resolve(gradleUserHome, 'gradle.properties');
|
const propertiesFile = path_1.default.resolve(gradleUserHome, 'gradle.properties');
|
||||||
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
|
fs_1.default.appendFileSync(propertiesFile, 'org.gradle.daemon=false');
|
||||||
const buildScanCapture = path_1.default.resolve(initScriptsDir, 'build-scan-capture.init.gradle');
|
const initScriptFilenames = ['build-result-capture.init.gradle', 'project-root-capture.init.gradle'];
|
||||||
fs_1.default.writeFileSync(buildScanCapture, `import org.gradle.util.GradleVersion
|
for (const initScriptFilename of initScriptFilenames) {
|
||||||
|
const initScriptContent = this.readResourceAsString(initScriptFilename);
|
||||||
// Only run against root build. Do not run against included builds.
|
const initScriptPath = path_1.default.resolve(initScriptsDir, initScriptFilename);
|
||||||
def isTopLevelBuild = gradle.getParent() == null
|
fs_1.default.writeFileSync(initScriptPath, initScriptContent);
|
||||||
if (isTopLevelBuild) {
|
|
||||||
def version = GradleVersion.current().baseVersion
|
|
||||||
def atLeastGradle4 = version >= GradleVersion.version("4.0")
|
|
||||||
def atLeastGradle6 = version >= GradleVersion.version("6.0")
|
|
||||||
|
|
||||||
if (atLeastGradle6) {
|
|
||||||
settingsEvaluated { settings ->
|
|
||||||
if (settings.pluginManager.hasPlugin("com.gradle.enterprise")) {
|
|
||||||
registerCallbacks(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject.name)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (atLeastGradle4) {
|
readResourceAsString(resource) {
|
||||||
projectsEvaluated { gradle ->
|
const absolutePath = path_1.default.resolve(__dirname, '..', '..', 'src', 'resources', resource);
|
||||||
if (gradle.rootProject.pluginManager.hasPlugin("com.gradle.build-scan")) {
|
return fs_1.default.readFileSync(absolutePath, 'utf8');
|
||||||
registerCallbacks(gradle.rootProject.extensions["buildScan"], gradle.rootProject.name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def registerCallbacks(buildScanExtension, rootProjectName) {
|
|
||||||
buildScanExtension.with {
|
|
||||||
def buildFailed = false
|
|
||||||
buildFinished { result ->
|
|
||||||
buildFailed = (result.failure != null)
|
|
||||||
}
|
|
||||||
|
|
||||||
buildScanPublished { buildScan ->
|
|
||||||
// Send commands directly to GitHub Actions via STDOUT.
|
|
||||||
def gradleCommand = rootProjectName + " " + gradle.startParameter.taskNames.join(" ")
|
|
||||||
|
|
||||||
def githubSummaryFile = new File(System.getenv("GITHUB_STEP_SUMMARY"))
|
|
||||||
if (buildFailed) {
|
|
||||||
githubSummaryFile << ":x: Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-FAILED-red?logo=Gradle)](\${buildScan.buildScanUri})"
|
|
||||||
} else {
|
|
||||||
githubSummaryFile << ":white_check_mark: Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-SUCCESS-brightgreen?logo=Gradle)](\${buildScan.buildScanUri})"
|
|
||||||
}
|
|
||||||
println("::set-output name=build-scan-url::\${buildScan.buildScanUri}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}`);
|
|
||||||
const projectRootCapture = path_1.default.resolve(initScriptsDir, 'project-root-capture.init.gradle');
|
|
||||||
fs_1.default.writeFileSync(projectRootCapture, `
|
|
||||||
// Only run against root build. Do not run against included builds.
|
|
||||||
def isTopLevelBuild = gradle.getParent() == null
|
|
||||||
if (isTopLevelBuild) {
|
|
||||||
settingsEvaluated { settings ->
|
|
||||||
def projectRootEntry = settings.rootDir.absolutePath + "\\n"
|
|
||||||
def projectRootList = new File(settings.gradle.gradleUserHomeDir, "${exports.PROJECT_ROOTS_FILE}")
|
|
||||||
if (!projectRootList.exists() || !projectRootList.text.contains(projectRootEntry)) {
|
|
||||||
projectRootList << projectRootEntry
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}`);
|
|
||||||
}
|
}
|
||||||
debugReportGradleUserHomeSize(label) {
|
debugReportGradleUserHomeSize(label) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -64799,7 +64750,6 @@ const cache_utils_1 = __nccwpck_require__(1678);
|
|||||||
const cache_reporting_1 = __nccwpck_require__(6674);
|
const cache_reporting_1 = __nccwpck_require__(6674);
|
||||||
const cache_base_1 = __nccwpck_require__(7591);
|
const cache_base_1 = __nccwpck_require__(7591);
|
||||||
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
const CACHE_RESTORED_VAR = 'GRADLE_BUILD_ACTION_CACHE_RESTORED';
|
||||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
|
||||||
const CACHE_LISTENER = 'CACHE_LISTENER';
|
const CACHE_LISTENER = 'CACHE_LISTENER';
|
||||||
function restore(gradleUserHome) {
|
function restore(gradleUserHome) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
@ -64821,7 +64771,6 @@ function restore(gradleUserHome) {
|
|||||||
}
|
}
|
||||||
gradleStateCache.init();
|
gradleStateCache.init();
|
||||||
core.saveState(CACHE_RESTORED_VAR, true);
|
core.saveState(CACHE_RESTORED_VAR, true);
|
||||||
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
|
||||||
if ((0, cache_utils_1.isCacheWriteOnly)()) {
|
if ((0, cache_utils_1.isCacheWriteOnly)()) {
|
||||||
core.info('Cache is write-only: will not restore from cache.');
|
core.info('Cache is write-only: will not restore from cache.');
|
||||||
return;
|
return;
|
||||||
@ -64834,7 +64783,7 @@ function restore(gradleUserHome) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.restore = restore;
|
exports.restore = restore;
|
||||||
function save() {
|
function save(gradleUserHome) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!shouldSaveCaches()) {
|
if (!shouldSaveCaches()) {
|
||||||
return;
|
return;
|
||||||
@ -64846,7 +64795,6 @@ function save() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
||||||
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
|
||||||
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
||||||
}));
|
}));
|
||||||
(0, cache_reporting_1.logCachingReport)(cacheListener);
|
(0, cache_reporting_1.logCachingReport)(cacheListener);
|
||||||
@ -64908,12 +64856,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.run = void 0;
|
exports.run = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const caches = __importStar(__nccwpck_require__(3800));
|
const setupGradle = __importStar(__nccwpck_require__(8652));
|
||||||
process.on('uncaughtException', e => handleFailure(e));
|
process.on('uncaughtException', e => handleFailure(e));
|
||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
yield caches.save();
|
yield setupGradle.complete();
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
handleFailure(error);
|
handleFailure(error);
|
||||||
@ -64922,7 +64870,7 @@ function run() {
|
|||||||
}
|
}
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
function handleFailure(error) {
|
function handleFailure(error) {
|
||||||
core.warning(`Unhandled error saving cache - job will continue: ${error}`);
|
core.warning(`Unhandled error in Gradle post-action - job will continue: ${error}`);
|
||||||
if (error instanceof Error && error.stack) {
|
if (error instanceof Error && error.stack) {
|
||||||
core.info(error.stack);
|
core.info(error.stack);
|
||||||
}
|
}
|
||||||
@ -64930,6 +64878,87 @@ function handleFailure(error) {
|
|||||||
run();
|
run();
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 8652:
|
||||||
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
|
}
|
||||||
|
Object.defineProperty(o, k2, desc);
|
||||||
|
}) : (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
o[k2] = m[k];
|
||||||
|
}));
|
||||||
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||||
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||||
|
}) : function(o, v) {
|
||||||
|
o["default"] = v;
|
||||||
|
});
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.complete = exports.setup = void 0;
|
||||||
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
|
const os = __importStar(__nccwpck_require__(2037));
|
||||||
|
const caches = __importStar(__nccwpck_require__(3800));
|
||||||
|
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED';
|
||||||
|
const GRADLE_USER_HOME = 'GRADLE_USER_HOME';
|
||||||
|
function setup(buildRootDirectory) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const gradleUserHome = determineGradleUserHome(buildRootDirectory);
|
||||||
|
if (process.env[GRADLE_SETUP_VAR]) {
|
||||||
|
core.info('Gradle setup only performed on first gradle-build-action step in workflow.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
core.exportVariable(GRADLE_SETUP_VAR, true);
|
||||||
|
core.saveState(GRADLE_SETUP_VAR, true);
|
||||||
|
core.saveState(GRADLE_USER_HOME, gradleUserHome);
|
||||||
|
yield caches.restore(gradleUserHome);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.setup = setup;
|
||||||
|
function complete() {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (!core.getState(GRADLE_SETUP_VAR)) {
|
||||||
|
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const gradleUserHome = core.getState(GRADLE_USER_HOME);
|
||||||
|
yield caches.save(gradleUserHome);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.complete = complete;
|
||||||
|
function determineGradleUserHome(rootDir) {
|
||||||
|
const customGradleUserHome = process.env['GRADLE_USER_HOME'];
|
||||||
|
if (customGradleUserHome) {
|
||||||
|
return path.resolve(rootDir, customGradleUserHome);
|
||||||
|
}
|
||||||
|
return path.resolve(os.homedir(), '.gradle');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 2877:
|
/***/ 2877:
|
||||||
|
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user