mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-13 00:01:36 +02:00
chore: build dist release-please-action (#440)
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
This commit is contained in:
committed by
GitHub
parent
e997222369
commit
098d26660c
100
dist/index.js
vendored
100
dist/index.js
vendored
@@ -173,6 +173,9 @@ function outputReleases (releases) {
|
|||||||
// Historically tagName was output as tag_name, keep this
|
// Historically tagName was output as tag_name, keep this
|
||||||
// consistent to avoid breaking change:
|
// consistent to avoid breaking change:
|
||||||
if (key === 'tagName') key = 'tag_name'
|
if (key === 'tagName') key = 'tag_name'
|
||||||
|
if (key === 'uploadUrl') key = 'upload_url'
|
||||||
|
if (key === 'notes') key = 'body'
|
||||||
|
if (key === 'url') key = 'html_url'
|
||||||
if (path === '.') {
|
if (path === '.') {
|
||||||
core.setOutput(key, val)
|
core.setOutput(key, val)
|
||||||
} else {
|
} else {
|
||||||
@@ -14431,7 +14434,7 @@ var isPlainObject = __nccwpck_require__(63287);
|
|||||||
var nodeFetch = _interopDefault(__nccwpck_require__(80467));
|
var nodeFetch = _interopDefault(__nccwpck_require__(80467));
|
||||||
var requestError = __nccwpck_require__(10537);
|
var requestError = __nccwpck_require__(10537);
|
||||||
|
|
||||||
const VERSION = "5.6.2";
|
const VERSION = "5.6.3";
|
||||||
|
|
||||||
function getBufferResponse(response) {
|
function getBufferResponse(response) {
|
||||||
return response.arrayBuffer();
|
return response.arrayBuffer();
|
||||||
@@ -71697,9 +71700,13 @@ class GitHub {
|
|||||||
name: resp.data.name || undefined,
|
name: resp.data.name || undefined,
|
||||||
tagName: resp.data.tag_name,
|
tagName: resp.data.tag_name,
|
||||||
sha: resp.data.target_commitish,
|
sha: resp.data.target_commitish,
|
||||||
notes: resp.data.body_text,
|
notes: resp.data.body_text ||
|
||||||
|
resp.data.body ||
|
||||||
|
resp.data.body_html ||
|
||||||
|
undefined,
|
||||||
url: resp.data.html_url,
|
url: resp.data.html_url,
|
||||||
draft: resp.data.draft,
|
draft: resp.data.draft,
|
||||||
|
uploadUrl: resp.data.upload_url,
|
||||||
};
|
};
|
||||||
}, e => {
|
}, e => {
|
||||||
if (e instanceof request_error_1.RequestError) {
|
if (e instanceof request_error_1.RequestError) {
|
||||||
@@ -74412,14 +74419,24 @@ class BaseStrategy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const component = await this.getComponent();
|
const component = await this.getComponent();
|
||||||
logger_1.logger.info('component:', component);
|
let releaseData;
|
||||||
const releaseData = pullRequestBody.releaseData.length === 1 &&
|
if (pullRequestBody.releaseData.length === 1 &&
|
||||||
!pullRequestBody.releaseData[0].component
|
!pullRequestBody.releaseData[0].component) {
|
||||||
? pullRequestBody.releaseData[0]
|
// standalone release PR, ensure the components match
|
||||||
: pullRequestBody.releaseData.find(releaseData => {
|
if (this.normalizeComponent(branchName.component) !==
|
||||||
|
this.normalizeComponent(component)) {
|
||||||
|
logger_1.logger.warn(`PR component: ${branchName.component} does not match configured component: ${component}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
releaseData = pullRequestBody.releaseData[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// manifest release with multiple components
|
||||||
|
releaseData = pullRequestBody.releaseData.find(releaseData => {
|
||||||
return (this.normalizeComponent(releaseData.component) ===
|
return (this.normalizeComponent(releaseData.component) ===
|
||||||
this.normalizeComponent(component));
|
this.normalizeComponent(component));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
const notes = releaseData === null || releaseData === void 0 ? void 0 : releaseData.notes;
|
const notes = releaseData === null || releaseData === void 0 ? void 0 : releaseData.notes;
|
||||||
if (notes === undefined) {
|
if (notes === undefined) {
|
||||||
logger_1.logger.warn('Failed to find release notes');
|
logger_1.logger.warn('Failed to find release notes');
|
||||||
@@ -74622,19 +74639,7 @@ const changelog_1 = __nccwpck_require__(3325);
|
|||||||
const version_1 = __nccwpck_require__(17348);
|
const version_1 = __nccwpck_require__(17348);
|
||||||
const version_go_1 = __nccwpck_require__(54988);
|
const version_go_1 = __nccwpck_require__(54988);
|
||||||
const logger_1 = __nccwpck_require__(68809);
|
const logger_1 = __nccwpck_require__(68809);
|
||||||
// Commits containing a scope prefixed with an item in this array will be
|
const path_1 = __nccwpck_require__(85622);
|
||||||
// ignored when generating a release PR for the parent module.
|
|
||||||
const IGNORED_SUB_MODULES = new Set([
|
|
||||||
'bigtable',
|
|
||||||
'bigquery',
|
|
||||||
'datastore',
|
|
||||||
'firestore',
|
|
||||||
'logging',
|
|
||||||
'pubsub',
|
|
||||||
'pubsublite',
|
|
||||||
'spanner',
|
|
||||||
'storage',
|
|
||||||
]);
|
|
||||||
const REGEN_PR_REGEX = /.*auto-regenerate.*/;
|
const REGEN_PR_REGEX = /.*auto-regenerate.*/;
|
||||||
const REGEN_ISSUE_REGEX = /(?<prefix>.*)\(#(?<pr>.*)\)(\n|$)/;
|
const REGEN_ISSUE_REGEX = /(?<prefix>.*)\(#(?<pr>.*)\)(\n|$)/;
|
||||||
class GoYoshi extends base_1.BaseStrategy {
|
class GoYoshi extends base_1.BaseStrategy {
|
||||||
@@ -74667,6 +74672,7 @@ class GoYoshi extends base_1.BaseStrategy {
|
|||||||
let regenCommit;
|
let regenCommit;
|
||||||
const component = await this.getComponent();
|
const component = await this.getComponent();
|
||||||
logger_1.logger.debug('Filtering commits');
|
logger_1.logger.debug('Filtering commits');
|
||||||
|
const ignoredSubmodules = await this.getIgnoredSubModules();
|
||||||
return commits.filter(commit => {
|
return commits.filter(commit => {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
// Only have a single entry of the nightly regen listed in the changelog.
|
// Only have a single entry of the nightly regen listed in the changelog.
|
||||||
@@ -74722,7 +74728,7 @@ class GoYoshi extends base_1.BaseStrategy {
|
|||||||
else {
|
else {
|
||||||
// This is the main module release, so ignore sub modules that
|
// This is the main module release, so ignore sub modules that
|
||||||
// are released independently
|
// are released independently
|
||||||
for (const submodule of IGNORED_SUB_MODULES) {
|
for (const submodule of ignoredSubmodules) {
|
||||||
if (commitMatchesScope(commit.scope, submodule)) {
|
if (commitMatchesScope(commit.scope, submodule)) {
|
||||||
logger_1.logger.debug(`Skipping ignored commit scope: ${commit.scope}`);
|
logger_1.logger.debug(`Skipping ignored commit scope: ${commit.scope}`);
|
||||||
return false;
|
return false;
|
||||||
@@ -74733,6 +74739,22 @@ class GoYoshi extends base_1.BaseStrategy {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async getIgnoredSubModules() {
|
||||||
|
// ignored submodules only applies to the root component of
|
||||||
|
// googleapis/google-cloud-go
|
||||||
|
if (this.repository.owner !== 'googleapis' ||
|
||||||
|
this.repository.repo !== 'google-cloud-go' ||
|
||||||
|
this.includeComponentInTag) {
|
||||||
|
return new Set();
|
||||||
|
}
|
||||||
|
logger_1.logger.info('Looking for go.mod files');
|
||||||
|
const paths = (await this.github.findFilesByFilenameAndRef('go.mod', this.targetBranch))
|
||||||
|
.filter(path => !path.includes('internal') && path !== 'go.mod')
|
||||||
|
.map(path => path_1.dirname(path));
|
||||||
|
logger_1.logger.info(`Found ${paths.length} submodules`);
|
||||||
|
logger_1.logger.debug(JSON.stringify(paths));
|
||||||
|
return new Set(paths);
|
||||||
|
}
|
||||||
// "closes" is a little presumptuous, let's just indicate that the
|
// "closes" is a little presumptuous, let's just indicate that the
|
||||||
// PR references these other commits:
|
// PR references these other commits:
|
||||||
async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
|
async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
|
||||||
@@ -78533,7 +78555,7 @@ class PullRequestBody {
|
|||||||
return this.releaseData
|
return this.releaseData
|
||||||
.map(release => {
|
.map(release => {
|
||||||
var _a;
|
var _a;
|
||||||
return `<details><summary>${release.component}: ${(_a = release.version) === null || _a === void 0 ? void 0 : _a.toString()}</summary>\n\n${release.notes}\n</details>`;
|
return `<details><summary>${release.component ? `${release.component}: ` : ''}${(_a = release.version) === null || _a === void 0 ? void 0 : _a.toString()}</summary>\n\n${release.notes}\n</details>`;
|
||||||
})
|
})
|
||||||
.join('\n\n');
|
.join('\n\n');
|
||||||
}
|
}
|
||||||
@@ -78572,6 +78594,7 @@ function splitBody(body) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
const SUMMARY_PATTERN = /^(?<component>.*[^:]):? (?<version>\d+\.\d+\.\d+.*)$/;
|
const SUMMARY_PATTERN = /^(?<component>.*[^:]):? (?<version>\d+\.\d+\.\d+.*)$/;
|
||||||
|
const COMPONENTLESS_SUMMARY_PATTERN = /^(?<version>\d+\.\d+\.\d+.*)$/;
|
||||||
function extractMultipleReleases(notes) {
|
function extractMultipleReleases(notes) {
|
||||||
const data = [];
|
const data = [];
|
||||||
const root = node_html_parser_1.parse(notes);
|
const root = node_html_parser_1.parse(notes);
|
||||||
@@ -78579,17 +78602,28 @@ function extractMultipleReleases(notes) {
|
|||||||
const summaryNode = detail.getElementsByTagName('summary')[0];
|
const summaryNode = detail.getElementsByTagName('summary')[0];
|
||||||
const summary = summaryNode === null || summaryNode === void 0 ? void 0 : summaryNode.textContent;
|
const summary = summaryNode === null || summaryNode === void 0 ? void 0 : summaryNode.textContent;
|
||||||
const match = summary.match(SUMMARY_PATTERN);
|
const match = summary.match(SUMMARY_PATTERN);
|
||||||
if (!(match === null || match === void 0 ? void 0 : match.groups)) {
|
if (match === null || match === void 0 ? void 0 : match.groups) {
|
||||||
logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
|
detail.removeChild(summaryNode);
|
||||||
continue;
|
const notes = detail.textContent.trim();
|
||||||
|
data.push({
|
||||||
|
component: match.groups.component,
|
||||||
|
version: version_1.Version.parse(match.groups.version),
|
||||||
|
notes,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const componentlessMatch = summary.match(COMPONENTLESS_SUMMARY_PATTERN);
|
||||||
|
if (!(componentlessMatch === null || componentlessMatch === void 0 ? void 0 : componentlessMatch.groups)) {
|
||||||
|
logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
detail.removeChild(summaryNode);
|
||||||
|
const notes = detail.textContent.trim();
|
||||||
|
data.push({
|
||||||
|
version: version_1.Version.parse(componentlessMatch.groups.version),
|
||||||
|
notes,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
detail.removeChild(summaryNode);
|
|
||||||
const notes = detail.textContent.trim();
|
|
||||||
data.push({
|
|
||||||
component: match.groups.component,
|
|
||||||
version: version_1.Version.parse(match.groups.version),
|
|
||||||
notes,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -96801,7 +96835,7 @@ module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = {"i8":"13.4.8"};
|
module.exports = {"i8":"13.4.10"};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user