mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 09:02:50 +00:00
Build outputs
This commit is contained in:
parent
c3bdce8205
commit
bfa3c0508e
4 changed files with 96 additions and 48 deletions
70
dist/main/index.js
vendored
70
dist/main/index.js
vendored
|
@ -70674,29 +70674,37 @@ const artifact = __importStar(__nccwpck_require__(2605));
|
||||||
const github = __importStar(__nccwpck_require__(5438));
|
const github = __importStar(__nccwpck_require__(5438));
|
||||||
const glob = __importStar(__nccwpck_require__(8090));
|
const glob = __importStar(__nccwpck_require__(8090));
|
||||||
const toolCache = __importStar(__nccwpck_require__(7784));
|
const toolCache = __importStar(__nccwpck_require__(7784));
|
||||||
|
const request_error_1 = __nccwpck_require__(537);
|
||||||
const path = __importStar(__nccwpck_require__(1017));
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||||
const layout = __importStar(__nccwpck_require__(8182));
|
const layout = __importStar(__nccwpck_require__(8182));
|
||||||
const input_params_1 = __nccwpck_require__(3885);
|
const input_params_1 = __nccwpck_require__(3885);
|
||||||
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph';
|
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph';
|
||||||
function setup(option) {
|
function setup(option) {
|
||||||
if (option === input_params_1.DependencyGraphOption.Disabled || option === input_params_1.DependencyGraphOption.DownloadAndSubmit) {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
return;
|
if (option === input_params_1.DependencyGraphOption.Disabled) {
|
||||||
}
|
return;
|
||||||
core.info('Enabling dependency graph generation');
|
}
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true');
|
if (option === input_params_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator());
|
yield downloadAndSubmitDependencyGraphs();
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId);
|
return;
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
|
}
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
|
core.info('Enabling dependency graph generation');
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', layout.workspaceDirectory());
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true');
|
||||||
core.exportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports'));
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator());
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId);
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', layout.workspaceDirectory());
|
||||||
|
core.exportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.setup = setup;
|
exports.setup = setup;
|
||||||
function complete(option) {
|
function complete(option) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case input_params_1.DependencyGraphOption.Disabled:
|
case input_params_1.DependencyGraphOption.Disabled:
|
||||||
|
case input_params_1.DependencyGraphOption.DownloadAndSubmit:
|
||||||
return;
|
return;
|
||||||
case input_params_1.DependencyGraphOption.Generate:
|
case input_params_1.DependencyGraphOption.Generate:
|
||||||
yield uploadDependencyGraphs();
|
yield uploadDependencyGraphs();
|
||||||
|
@ -70704,8 +70712,6 @@ function complete(option) {
|
||||||
case input_params_1.DependencyGraphOption.GenerateAndSubmit:
|
case input_params_1.DependencyGraphOption.GenerateAndSubmit:
|
||||||
yield submitDependencyGraphs(yield uploadDependencyGraphs());
|
yield submitDependencyGraphs(yield uploadDependencyGraphs());
|
||||||
return;
|
return;
|
||||||
case input_params_1.DependencyGraphOption.DownloadAndSubmit:
|
|
||||||
yield downloadAndSubmitDependencyGraphs();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -70729,18 +70735,36 @@ function downloadAndSubmitDependencyGraphs() {
|
||||||
}
|
}
|
||||||
function submitDependencyGraphs(dependencyGraphFiles) {
|
function submitDependencyGraphs(dependencyGraphFiles) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = getOctokit();
|
|
||||||
for (const jsonFile of dependencyGraphFiles) {
|
for (const jsonFile of dependencyGraphFiles) {
|
||||||
const jsonContent = fs_1.default.readFileSync(jsonFile, 'utf8');
|
try {
|
||||||
const jsonObject = JSON.parse(jsonContent);
|
yield submitDependencyGraphFile(jsonFile);
|
||||||
jsonObject.owner = github.context.repo.owner;
|
}
|
||||||
jsonObject.repo = github.context.repo.repo;
|
catch (error) {
|
||||||
const response = yield octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject);
|
if (error instanceof request_error_1.RequestError) {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
|
core.warning(`Failed to submit dependency graph ${relativeJsonFile}.\n` +
|
||||||
|
"Please ensure that the 'contents: write' permission is available for the workflow job.\n" +
|
||||||
|
"Note that this permission is never available for a 'pull_request' trigger from a repository fork.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function submitDependencyGraphFile(jsonFile) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const octokit = getOctokit();
|
||||||
|
const jsonContent = fs_1.default.readFileSync(jsonFile, 'utf8');
|
||||||
|
const jsonObject = JSON.parse(jsonContent);
|
||||||
|
jsonObject.owner = github.context.repo.owner;
|
||||||
|
jsonObject.repo = github.context.repo.repo;
|
||||||
|
const response = yield octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject);
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
|
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
function retrieveDependencyGraphs(workspaceDirectory) {
|
function retrieveDependencyGraphs(workspaceDirectory) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (github.context.payload.workflow_run) {
|
if (github.context.payload.workflow_run) {
|
||||||
|
@ -71657,7 +71681,7 @@ function setup() {
|
||||||
const cacheListener = new cache_reporting_1.CacheListener();
|
const cacheListener = new cache_reporting_1.CacheListener();
|
||||||
yield caches.restore(gradleUserHome, cacheListener);
|
yield caches.restore(gradleUserHome, cacheListener);
|
||||||
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
||||||
dependencyGraph.setup(params.getDependencyGraphOption());
|
yield dependencyGraph.setup(params.getDependencyGraphOption());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.setup = setup;
|
exports.setup = setup;
|
||||||
|
@ -71679,7 +71703,7 @@ function complete() {
|
||||||
else {
|
else {
|
||||||
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
|
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
|
||||||
}
|
}
|
||||||
dependencyGraph.complete(params.getDependencyGraphOption());
|
yield dependencyGraph.complete(params.getDependencyGraphOption());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.complete = complete;
|
exports.complete = complete;
|
||||||
|
|
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
70
dist/post/index.js
vendored
70
dist/post/index.js
vendored
|
@ -70674,29 +70674,37 @@ const artifact = __importStar(__nccwpck_require__(2605));
|
||||||
const github = __importStar(__nccwpck_require__(5438));
|
const github = __importStar(__nccwpck_require__(5438));
|
||||||
const glob = __importStar(__nccwpck_require__(8090));
|
const glob = __importStar(__nccwpck_require__(8090));
|
||||||
const toolCache = __importStar(__nccwpck_require__(7784));
|
const toolCache = __importStar(__nccwpck_require__(7784));
|
||||||
|
const request_error_1 = __nccwpck_require__(537);
|
||||||
const path = __importStar(__nccwpck_require__(1017));
|
const path = __importStar(__nccwpck_require__(1017));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
||||||
const layout = __importStar(__nccwpck_require__(8182));
|
const layout = __importStar(__nccwpck_require__(8182));
|
||||||
const input_params_1 = __nccwpck_require__(3885);
|
const input_params_1 = __nccwpck_require__(3885);
|
||||||
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph';
|
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph';
|
||||||
function setup(option) {
|
function setup(option) {
|
||||||
if (option === input_params_1.DependencyGraphOption.Disabled || option === input_params_1.DependencyGraphOption.DownloadAndSubmit) {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
return;
|
if (option === input_params_1.DependencyGraphOption.Disabled) {
|
||||||
}
|
return;
|
||||||
core.info('Enabling dependency graph generation');
|
}
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true');
|
if (option === input_params_1.DependencyGraphOption.DownloadAndSubmit) {
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator());
|
yield downloadAndSubmitDependencyGraphs();
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId);
|
return;
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
|
}
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
|
core.info('Enabling dependency graph generation');
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', layout.workspaceDirectory());
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true');
|
||||||
core.exportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports'));
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator());
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId);
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref);
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext());
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', layout.workspaceDirectory());
|
||||||
|
core.exportVariable('DEPENDENCY_GRAPH_REPORT_DIR', path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.setup = setup;
|
exports.setup = setup;
|
||||||
function complete(option) {
|
function complete(option) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case input_params_1.DependencyGraphOption.Disabled:
|
case input_params_1.DependencyGraphOption.Disabled:
|
||||||
|
case input_params_1.DependencyGraphOption.DownloadAndSubmit:
|
||||||
return;
|
return;
|
||||||
case input_params_1.DependencyGraphOption.Generate:
|
case input_params_1.DependencyGraphOption.Generate:
|
||||||
yield uploadDependencyGraphs();
|
yield uploadDependencyGraphs();
|
||||||
|
@ -70704,8 +70712,6 @@ function complete(option) {
|
||||||
case input_params_1.DependencyGraphOption.GenerateAndSubmit:
|
case input_params_1.DependencyGraphOption.GenerateAndSubmit:
|
||||||
yield submitDependencyGraphs(yield uploadDependencyGraphs());
|
yield submitDependencyGraphs(yield uploadDependencyGraphs());
|
||||||
return;
|
return;
|
||||||
case input_params_1.DependencyGraphOption.DownloadAndSubmit:
|
|
||||||
yield downloadAndSubmitDependencyGraphs();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -70729,18 +70735,36 @@ function downloadAndSubmitDependencyGraphs() {
|
||||||
}
|
}
|
||||||
function submitDependencyGraphs(dependencyGraphFiles) {
|
function submitDependencyGraphs(dependencyGraphFiles) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = getOctokit();
|
|
||||||
for (const jsonFile of dependencyGraphFiles) {
|
for (const jsonFile of dependencyGraphFiles) {
|
||||||
const jsonContent = fs_1.default.readFileSync(jsonFile, 'utf8');
|
try {
|
||||||
const jsonObject = JSON.parse(jsonContent);
|
yield submitDependencyGraphFile(jsonFile);
|
||||||
jsonObject.owner = github.context.repo.owner;
|
}
|
||||||
jsonObject.repo = github.context.repo.repo;
|
catch (error) {
|
||||||
const response = yield octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject);
|
if (error instanceof request_error_1.RequestError) {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
|
core.warning(`Failed to submit dependency graph ${relativeJsonFile}.\n` +
|
||||||
|
"Please ensure that the 'contents: write' permission is available for the workflow job.\n" +
|
||||||
|
"Note that this permission is never available for a 'pull_request' trigger from a repository fork.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function submitDependencyGraphFile(jsonFile) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const octokit = getOctokit();
|
||||||
|
const jsonContent = fs_1.default.readFileSync(jsonFile, 'utf8');
|
||||||
|
const jsonObject = JSON.parse(jsonContent);
|
||||||
|
jsonObject.owner = github.context.repo.owner;
|
||||||
|
jsonObject.repo = github.context.repo.repo;
|
||||||
|
const response = yield octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject);
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile);
|
||||||
|
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
function retrieveDependencyGraphs(workspaceDirectory) {
|
function retrieveDependencyGraphs(workspaceDirectory) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (github.context.payload.workflow_run) {
|
if (github.context.payload.workflow_run) {
|
||||||
|
@ -71289,7 +71313,7 @@ function setup() {
|
||||||
const cacheListener = new cache_reporting_1.CacheListener();
|
const cacheListener = new cache_reporting_1.CacheListener();
|
||||||
yield caches.restore(gradleUserHome, cacheListener);
|
yield caches.restore(gradleUserHome, cacheListener);
|
||||||
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
core.saveState(CACHE_LISTENER, cacheListener.stringify());
|
||||||
dependencyGraph.setup(params.getDependencyGraphOption());
|
yield dependencyGraph.setup(params.getDependencyGraphOption());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.setup = setup;
|
exports.setup = setup;
|
||||||
|
@ -71311,7 +71335,7 @@ function complete() {
|
||||||
else {
|
else {
|
||||||
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
|
(0, job_summary_1.logJobSummary)(buildResults, cacheListener);
|
||||||
}
|
}
|
||||||
dependencyGraph.complete(params.getDependencyGraphOption());
|
yield dependencyGraph.complete(params.getDependencyGraphOption());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.complete = complete;
|
exports.complete = complete;
|
||||||
|
|
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…
Reference in a new issue