mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-07-01 23:23:15 +08:00
save report json as metadata
This commit is contained in:
parent
48b13fa8f1
commit
e0f3e8c4a3
27
dist/cleanup/index.js
generated
vendored
27
dist/cleanup/index.js
generated
vendored
@ -74035,12 +74035,6 @@ function ignoreErrors(promise) {
|
|||||||
}
|
}
|
||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
if (error instanceof Error)
|
|
||||||
core.setFailed(error.message);
|
|
||||||
}
|
|
||||||
yield ignoreErrors((0, reports_1.generateReports)());
|
yield ignoreErrors((0, reports_1.generateReports)());
|
||||||
yield ignoreErrors(saveCache());
|
yield ignoreErrors(saveCache());
|
||||||
});
|
});
|
||||||
@ -74458,6 +74452,7 @@ function generateReports() {
|
|||||||
}
|
}
|
||||||
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
||||||
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
||||||
|
(0, utils_1.createTree)(JSON.stringify(buildOutput));
|
||||||
const report = createReport(buildOutput);
|
const report = createReport(buildOutput);
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
core.summary.addRaw(report);
|
core.summary.addRaw(report);
|
||||||
@ -74763,7 +74758,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
exports.createTree = exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||||
const c = __importStar(__nccwpck_require__(2764));
|
const c = __importStar(__nccwpck_require__(2764));
|
||||||
const core = __importStar(__nccwpck_require__(2258));
|
const core = __importStar(__nccwpck_require__(2258));
|
||||||
const github = __importStar(__nccwpck_require__(7168));
|
const github = __importStar(__nccwpck_require__(7168));
|
||||||
@ -74953,6 +74948,24 @@ function saveReportJson(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.saveReportJson = saveReportJson;
|
exports.saveReportJson = saveReportJson;
|
||||||
|
function createTree(json) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
console.log(`creating tree at jessiscript/re_build_tracking`);
|
||||||
|
const octokit = github.getOctokit(getGitHubToken());
|
||||||
|
const context = github.context;
|
||||||
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`, Object.assign(Object.assign({}, context.repo), { tree: [
|
||||||
|
{
|
||||||
|
path: "report.json",
|
||||||
|
mode: "100644",
|
||||||
|
type: "blob",
|
||||||
|
content: json,
|
||||||
|
},
|
||||||
|
] }));
|
||||||
|
console.log(response);
|
||||||
|
return response.data.sha;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.createTree = createTree;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
21
dist/main/index.js
generated
vendored
21
dist/main/index.js
generated
vendored
@ -74551,6 +74551,7 @@ function generateReports() {
|
|||||||
}
|
}
|
||||||
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
const buildOutput = JSON.parse(fs.readFileSync(BUILD_OUTPUT_JSON_PATH, 'utf8'));
|
||||||
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
(0, utils_1.saveReportJson)(JSON.stringify(buildOutput));
|
||||||
|
(0, utils_1.createTree)(JSON.stringify(buildOutput));
|
||||||
const report = createReport(buildOutput);
|
const report = createReport(buildOutput);
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
core.summary.addRaw(report);
|
core.summary.addRaw(report);
|
||||||
@ -75754,7 +75755,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
exports.createTree = exports.saveReportJson = exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getMatchingTags = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||||
const c = __importStar(__nccwpck_require__(2764));
|
const c = __importStar(__nccwpck_require__(2764));
|
||||||
const core = __importStar(__nccwpck_require__(2258));
|
const core = __importStar(__nccwpck_require__(2258));
|
||||||
const github = __importStar(__nccwpck_require__(7168));
|
const github = __importStar(__nccwpck_require__(7168));
|
||||||
@ -75944,6 +75945,24 @@ function saveReportJson(content) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.saveReportJson = saveReportJson;
|
exports.saveReportJson = saveReportJson;
|
||||||
|
function createTree(json) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
console.log(`creating tree at jessiscript/re_build_tracking`);
|
||||||
|
const octokit = github.getOctokit(getGitHubToken());
|
||||||
|
const context = github.context;
|
||||||
|
const response = yield octokit.request(`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`, Object.assign(Object.assign({}, context.repo), { tree: [
|
||||||
|
{
|
||||||
|
path: "report.json",
|
||||||
|
mode: "100644",
|
||||||
|
type: "blob",
|
||||||
|
content: json,
|
||||||
|
},
|
||||||
|
] }));
|
||||||
|
console.log(response);
|
||||||
|
return response.data.sha;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.createTree = createTree;
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import {join} from 'path'
|
import {join} from 'path'
|
||||||
import {tmpdir} from 'os'
|
import {tmpdir} from 'os'
|
||||||
import {createPRComment, isPREvent, saveReportJson, toSemVer} from '../utils'
|
import {createPRComment, createTree, isPREvent, saveReportJson, toSemVer} from '../utils'
|
||||||
import {gte} from 'semver'
|
import {gte} from 'semver'
|
||||||
import {Base64} from 'js-base64';
|
import {Base64} from 'js-base64';
|
||||||
import { Octokit } from '@octokit/rest';
|
import { Octokit } from '@octokit/rest';
|
||||||
@ -135,6 +135,7 @@ export async function generateReports(): Promise<void> {
|
|||||||
)
|
)
|
||||||
|
|
||||||
saveReportJson(JSON.stringify(buildOutput))
|
saveReportJson(JSON.stringify(buildOutput))
|
||||||
|
createTree(JSON.stringify(buildOutput))
|
||||||
|
|
||||||
const report = createReport(buildOutput)
|
const report = createReport(buildOutput)
|
||||||
if (areJobReportsEnabled()) {
|
if (areJobReportsEnabled()) {
|
||||||
|
26
src/utils.ts
26
src/utils.ts
@ -176,8 +176,8 @@ export async function createPRComment(content: string): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function saveReportJson(content: string): Promise<void> {
|
export async function saveReportJson(content: string): Promise<void> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
auth: getGitHubToken(),
|
auth: getGitHubToken(),
|
||||||
@ -212,3 +212,27 @@ export async function saveReportJson(content: string): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function createTree(json: string): Promise<string> {
|
||||||
|
console.log(`creating tree at jessiscript/re_build_tracking`);
|
||||||
|
const octokit = github.getOctokit(getGitHubToken());
|
||||||
|
|
||||||
|
const context = github.context
|
||||||
|
const response = await octokit.request(
|
||||||
|
`POST /repos/${context.repo.owner}/${context.repo.repo}/git/trees`,
|
||||||
|
{
|
||||||
|
...context.repo,
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
path: "report.json",
|
||||||
|
mode: "100644",
|
||||||
|
type: "blob",
|
||||||
|
content: json,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(response);
|
||||||
|
return response.data.sha;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user