mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-13 10:51:38 +02:00
committed by
GitHub
parent
48ef955346
commit
f2231b744d
77
dist/index.js
vendored
77
dist/index.js
vendored
@@ -79912,7 +79912,10 @@ function buildPlugin(options) {
|
|||||||
if (typeof options.type === 'object') {
|
if (typeof options.type === 'object') {
|
||||||
const builder = pluginFactories[options.type.type];
|
const builder = pluginFactories[options.type.type];
|
||||||
if (builder) {
|
if (builder) {
|
||||||
return builder(options);
|
return builder({
|
||||||
|
...options.type,
|
||||||
|
...options,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
||||||
}
|
}
|
||||||
@@ -80841,16 +80844,16 @@ class GitHub {
|
|||||||
return {
|
return {
|
||||||
pageInfo: response.repository.pullRequests.pageInfo,
|
pageInfo: response.repository.pullRequests.pageInfo,
|
||||||
data: pullRequests.map(pullRequest => {
|
data: pullRequests.map(pullRequest => {
|
||||||
var _a;
|
var _a, _b, _c;
|
||||||
return {
|
return {
|
||||||
sha: (_a = pullRequest.mergeCommit) === null || _a === void 0 ? void 0 : _a.oid,
|
sha: (_a = pullRequest.mergeCommit) === null || _a === void 0 ? void 0 : _a.oid,
|
||||||
number: pullRequest.number,
|
number: pullRequest.number,
|
||||||
baseBranchName: pullRequest.baseRefName,
|
baseBranchName: pullRequest.baseRefName,
|
||||||
headBranchName: pullRequest.headRefName,
|
headBranchName: pullRequest.headRefName,
|
||||||
labels: (pullRequest.labels.nodes || []).map(l => l.name),
|
labels: (((_b = pullRequest.labels) === null || _b === void 0 ? void 0 : _b.nodes) || []).map(l => l.name),
|
||||||
title: pullRequest.title,
|
title: pullRequest.title,
|
||||||
body: pullRequest.body + '',
|
body: pullRequest.body + '',
|
||||||
files: pullRequest.files.nodes.map(node => node.path),
|
files: (((_c = pullRequest.files) === null || _c === void 0 ? void 0 : _c.nodes) || []).map(node => node.path),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
@@ -81523,6 +81526,7 @@ class Manifest {
|
|||||||
plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
|
plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
|
||||||
}
|
}
|
||||||
for (const plugin of plugins) {
|
for (const plugin of plugins) {
|
||||||
|
logger_1.logger.debug(`running plugin: ${plugin.constructor.name}`);
|
||||||
newReleasePullRequests = await plugin.run(newReleasePullRequests);
|
newReleasePullRequests = await plugin.run(newReleasePullRequests);
|
||||||
}
|
}
|
||||||
return newReleasePullRequests.map(pullRequestWithConfig => pullRequestWithConfig.pullRequest);
|
return newReleasePullRequests.map(pullRequestWithConfig => pullRequestWithConfig.pullRequest);
|
||||||
@@ -81865,6 +81869,7 @@ exports.Manifest = Manifest;
|
|||||||
* @returns {ReleaserConfig}
|
* @returns {ReleaserConfig}
|
||||||
*/
|
*/
|
||||||
function extractReleaserConfig(config) {
|
function extractReleaserConfig(config) {
|
||||||
|
var _a, _b;
|
||||||
return {
|
return {
|
||||||
releaseType: config['release-type'],
|
releaseType: config['release-type'],
|
||||||
bumpMinorPreMajor: config['bump-minor-pre-major'],
|
bumpMinorPreMajor: config['bump-minor-pre-major'],
|
||||||
@@ -81887,6 +81892,9 @@ function extractReleaserConfig(config) {
|
|||||||
pullRequestTitlePattern: config['pull-request-title-pattern'],
|
pullRequestTitlePattern: config['pull-request-title-pattern'],
|
||||||
tagSeparator: config['tag-separator'],
|
tagSeparator: config['tag-separator'],
|
||||||
separatePullRequests: config['separate-pull-requests'],
|
separatePullRequests: config['separate-pull-requests'],
|
||||||
|
labels: (_a = config['label']) === null || _a === void 0 ? void 0 : _a.split(','),
|
||||||
|
releaseLabels: (_b = config['release-label']) === null || _b === void 0 ? void 0 : _b.split(','),
|
||||||
|
skipSnapshot: config['skip-snapshot'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -81921,9 +81929,9 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
|
|||||||
separatePullRequests: config['separate-pull-requests'],
|
separatePullRequests: config['separate-pull-requests'],
|
||||||
groupPullRequestTitlePattern: config['group-pull-request-title-pattern'],
|
groupPullRequestTitlePattern: config['group-pull-request-title-pattern'],
|
||||||
plugins: config['plugins'],
|
plugins: config['plugins'],
|
||||||
labels: configLabel === undefined ? undefined : [configLabel],
|
labels: configLabel === null || configLabel === void 0 ? void 0 : configLabel.split(','),
|
||||||
releaseLabels: configReleaseLabel === undefined ? undefined : [configReleaseLabel],
|
releaseLabels: configReleaseLabel === null || configReleaseLabel === void 0 ? void 0 : configReleaseLabel.split(','),
|
||||||
snapshotLabels: configSnapshotLabel === undefined ? undefined : [configSnapshotLabel],
|
snapshotLabels: configSnapshotLabel === null || configSnapshotLabel === void 0 ? void 0 : configSnapshotLabel.split(','),
|
||||||
releaseSearchDepth: config['release-search-depth'],
|
releaseSearchDepth: config['release-search-depth'],
|
||||||
commitSearchDepth: config['commit-search-depth'],
|
commitSearchDepth: config['commit-search-depth'],
|
||||||
sequentialCalls: config['sequential-calls'],
|
sequentialCalls: config['sequential-calls'],
|
||||||
@@ -82091,7 +82099,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|||||||
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
||||||
}
|
}
|
||||||
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
||||||
return {
|
return {
|
||||||
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
||||||
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
||||||
@@ -82113,6 +82121,7 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|||||||
tagSeparator: (_u = pathConfig.tagSeparator) !== null && _u !== void 0 ? _u : defaultConfig.tagSeparator,
|
tagSeparator: (_u = pathConfig.tagSeparator) !== null && _u !== void 0 ? _u : defaultConfig.tagSeparator,
|
||||||
pullRequestTitlePattern: (_v = pathConfig.pullRequestTitlePattern) !== null && _v !== void 0 ? _v : defaultConfig.pullRequestTitlePattern,
|
pullRequestTitlePattern: (_v = pathConfig.pullRequestTitlePattern) !== null && _v !== void 0 ? _v : defaultConfig.pullRequestTitlePattern,
|
||||||
separatePullRequests: (_w = pathConfig.separatePullRequests) !== null && _w !== void 0 ? _w : defaultConfig.separatePullRequests,
|
separatePullRequests: (_w = pathConfig.separatePullRequests) !== null && _w !== void 0 ? _w : defaultConfig.separatePullRequests,
|
||||||
|
skipSnapshot: (_x = pathConfig.skipSnapshot) !== null && _x !== void 0 ? _x : defaultConfig.skipSnapshot,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -82390,10 +82399,16 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
postProcessCandidates(candidates, updatedVersions) {
|
postProcessCandidates(candidates, updatedVersions) {
|
||||||
const rootCandidate = candidates.find(c => c.path === manifest_1.ROOT_PROJECT_PATH);
|
let rootCandidate = candidates.find(c => c.path === manifest_1.ROOT_PROJECT_PATH);
|
||||||
if (!rootCandidate) {
|
if (!rootCandidate) {
|
||||||
throw Error('Unable to find root candidate pull request');
|
logger_1.logger.warn('Unable to find root candidate pull request');
|
||||||
|
rootCandidate = candidates.find(c => c.config.releaseType === 'rust');
|
||||||
}
|
}
|
||||||
|
if (!rootCandidate) {
|
||||||
|
logger_1.logger.warn('Unable to find a rust candidate pull request');
|
||||||
|
return candidates;
|
||||||
|
}
|
||||||
|
// Update the root Cargo.lock if it exists
|
||||||
rootCandidate.pullRequest.updates.push({
|
rootCandidate.pullRequest.updates.push({
|
||||||
path: 'Cargo.lock',
|
path: 'Cargo.lock',
|
||||||
createIfMissing: false,
|
createIfMissing: false,
|
||||||
@@ -82522,10 +82537,12 @@ const merge_1 = __nccwpck_require__(90514);
|
|||||||
* Release notes are broken up using `<summary>`/`<details>` blocks.
|
* Release notes are broken up using `<summary>`/`<details>` blocks.
|
||||||
*/
|
*/
|
||||||
class LinkedVersions extends plugin_1.ManifestPlugin {
|
class LinkedVersions extends plugin_1.ManifestPlugin {
|
||||||
constructor(github, targetBranch, repositoryConfig, groupName, components) {
|
constructor(github, targetBranch, repositoryConfig, groupName, components, options = {}) {
|
||||||
|
var _a;
|
||||||
super(github, targetBranch, repositoryConfig);
|
super(github, targetBranch, repositoryConfig);
|
||||||
this.groupName = groupName;
|
this.groupName = groupName;
|
||||||
this.components = new Set(components);
|
this.components = new Set(components);
|
||||||
|
this.merge = (_a = options.merge) !== null && _a !== void 0 ? _a : true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Pre-configure strategies.
|
* Pre-configure strategies.
|
||||||
@@ -82596,6 +82613,9 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|||||||
* @returns {CandidateReleasePullRequest[]} Updated pull requests
|
* @returns {CandidateReleasePullRequest[]} Updated pull requests
|
||||||
*/
|
*/
|
||||||
async run(candidates) {
|
async run(candidates) {
|
||||||
|
if (!this.merge) {
|
||||||
|
return candidates;
|
||||||
|
}
|
||||||
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
||||||
if (!candidate.pullRequest.version) {
|
if (!candidate.pullRequest.version) {
|
||||||
logger_1.logger.warn('pull request missing version', candidate);
|
logger_1.logger.warn('pull request missing version', candidate);
|
||||||
@@ -83304,10 +83324,11 @@ const release_please_manifest_1 = __nccwpck_require__(9817);
|
|||||||
*/
|
*/
|
||||||
class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
||||||
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
||||||
var _a, _b;
|
var _a, _b, _c;
|
||||||
super(github, targetBranch, repositoryConfig);
|
super(github, targetBranch, repositoryConfig);
|
||||||
this.manifestPath = (_a = options.manifestPath) !== null && _a !== void 0 ? _a : manifest_1.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
this.manifestPath = (_a = options.manifestPath) !== null && _a !== void 0 ? _a : manifest_1.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
||||||
this.updateAllPackages = (_b = options.updateAllPackages) !== null && _b !== void 0 ? _b : false;
|
this.updateAllPackages = (_b = options.updateAllPackages) !== null && _b !== void 0 ? _b : false;
|
||||||
|
this.merge = (_c = options.merge) !== null && _c !== void 0 ? _c : true;
|
||||||
}
|
}
|
||||||
async run(candidates) {
|
async run(candidates) {
|
||||||
logger_1.logger.info('Running workspace plugin');
|
logger_1.logger.info('Running workspace plugin');
|
||||||
@@ -83372,10 +83393,11 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|||||||
newCandidates.push(newCandidate);
|
newCandidates.push(newCandidate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.merge) {
|
||||||
logger_1.logger.info(`Merging ${newCandidates.length} in-scope candidates`);
|
logger_1.logger.info(`Merging ${newCandidates.length} in-scope candidates`);
|
||||||
const mergePlugin = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig);
|
const mergePlugin = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig);
|
||||||
newCandidates = await mergePlugin.run(newCandidates);
|
newCandidates = await mergePlugin.run(newCandidates);
|
||||||
if (newCandidates.length === 1) {
|
}
|
||||||
const newUpdates = newCandidates[0].pullRequest.updates;
|
const newUpdates = newCandidates[0].pullRequest.updates;
|
||||||
newUpdates.push({
|
newUpdates.push({
|
||||||
path: this.manifestPath,
|
path: this.manifestPath,
|
||||||
@@ -83385,10 +83407,6 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|||||||
versionsMap: updatedPathVersions,
|
versionsMap: updatedPathVersions,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else {
|
|
||||||
logger_1.logger.warn(`Expected 1 merged candidate, got ${newCandidates.length}`);
|
|
||||||
}
|
|
||||||
logger_1.logger.info(`Post-processing ${newCandidates.length} in-scope candidates`);
|
logger_1.logger.info(`Post-processing ${newCandidates.length} in-scope candidates`);
|
||||||
newCandidates = this.postProcessCandidates(newCandidates, updatedVersions);
|
newCandidates = this.postProcessCandidates(newCandidates, updatedVersions);
|
||||||
return [...outOfScopeCandidates, ...newCandidates];
|
return [...outOfScopeCandidates, ...newCandidates];
|
||||||
@@ -84656,7 +84674,7 @@ const CHANGELOG_SECTIONS = [
|
|||||||
*/
|
*/
|
||||||
class Java extends base_1.BaseStrategy {
|
class Java extends base_1.BaseStrategy {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
var _a;
|
var _a, _b;
|
||||||
options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
|
options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
|
||||||
// wrap the configured versioning strategy with snapshotting
|
// wrap the configured versioning strategy with snapshotting
|
||||||
const parentVersioningStrategy = options.versioningStrategy || new default_1.DefaultVersioningStrategy();
|
const parentVersioningStrategy = options.versioningStrategy || new default_1.DefaultVersioningStrategy();
|
||||||
@@ -84664,6 +84682,7 @@ class Java extends base_1.BaseStrategy {
|
|||||||
super(options);
|
super(options);
|
||||||
this.snapshotVersioning = new java_add_snapshot_1.JavaAddSnapshot(parentVersioningStrategy);
|
this.snapshotVersioning = new java_add_snapshot_1.JavaAddSnapshot(parentVersioningStrategy);
|
||||||
this.snapshotLabels = options.snapshotLabels || manifest_1.DEFAULT_SNAPSHOT_LABELS;
|
this.snapshotLabels = options.snapshotLabels || manifest_1.DEFAULT_SNAPSHOT_LABELS;
|
||||||
|
this.skipSnapshot = (_b = options.skipSnapshot) !== null && _b !== void 0 ? _b : false;
|
||||||
}
|
}
|
||||||
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
||||||
if (await this.needsSnapshot(commits, latestRelease)) {
|
if (await this.needsSnapshot(commits, latestRelease)) {
|
||||||
@@ -84716,6 +84735,9 @@ class Java extends base_1.BaseStrategy {
|
|||||||
}
|
}
|
||||||
async needsSnapshot(commits, latestRelease) {
|
async needsSnapshot(commits, latestRelease) {
|
||||||
var _a;
|
var _a;
|
||||||
|
if (this.skipSnapshot) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const component = await this.getComponent();
|
const component = await this.getComponent();
|
||||||
logger_1.logger.debug('component:', component);
|
logger_1.logger.debug('component:', component);
|
||||||
const version = (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.version;
|
const version = (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.version;
|
||||||
@@ -87600,11 +87622,18 @@ class RootComposerUpdatePackages extends default_1.DefaultUpdater {
|
|||||||
}
|
}
|
||||||
const parsed = JSON.parse(content);
|
const parsed = JSON.parse(content);
|
||||||
if (this.versionsMap) {
|
if (this.versionsMap) {
|
||||||
// eslint-disable-next-line prefer-const
|
for (const [key, version] of this.versionsMap.entries()) {
|
||||||
for (let [key, version] of this.versionsMap.entries()) {
|
const toVersion = version.toString() || '1.0.0';
|
||||||
version = version || '1.0.0';
|
let fromVersion;
|
||||||
logger_1.logger.info(`updating ${key} from ${parsed.replace[key]} to ${version}`);
|
if (parsed.replace) {
|
||||||
parsed.replace[key] = version.toString();
|
fromVersion = parsed.replace[key];
|
||||||
|
parsed.replace[key] = toVersion;
|
||||||
|
}
|
||||||
|
if (parsed[key]) {
|
||||||
|
fromVersion !== null && fromVersion !== void 0 ? fromVersion : (fromVersion = parsed[key]);
|
||||||
|
parsed[key] = toVersion;
|
||||||
|
}
|
||||||
|
logger_1.logger.info(`updating ${key} from ${fromVersion} to ${toVersion}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
||||||
@@ -114309,7 +114338,7 @@ module.exports = {};
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = {"i8":"13.19.6"};
|
module.exports = {"i8":"13.20.0"};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user