mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-12 16:31:35 +02:00
chore: build dist release-please-action (#489)
This commit is contained in:
committed by
GitHub
parent
fe3f4f7d68
commit
e3b39f9e95
74
dist/index.js
vendored
74
dist/index.js
vendored
@@ -81022,9 +81022,9 @@ class Manifest {
|
|||||||
github,
|
github,
|
||||||
...config,
|
...config,
|
||||||
});
|
});
|
||||||
const component = await strategy.getComponent();
|
const component = await strategy.getBranchComponent();
|
||||||
const releasedVersions = {};
|
const releasedVersions = {};
|
||||||
const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), config.includeComponentInTag ? component : '', config.pullRequestTitlePattern);
|
const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), component, config.pullRequestTitlePattern);
|
||||||
if (latestVersion) {
|
if (latestVersion) {
|
||||||
releasedVersions[path] = latestVersion;
|
releasedVersions[path] = latestVersion;
|
||||||
}
|
}
|
||||||
@@ -81481,20 +81481,16 @@ class Manifest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async createReleasesForPullRequest(releases, pullRequest) {
|
async createReleasesForPullRequest(releases, pullRequest) {
|
||||||
// create the release
|
logger_1.logger.info(`Creating ${releases.length} releases for pull #${pullRequest.number}`);
|
||||||
const promises = [];
|
|
||||||
for (const release of releases) {
|
|
||||||
promises.push(this.createRelease(release));
|
|
||||||
}
|
|
||||||
const duplicateReleases = [];
|
const duplicateReleases = [];
|
||||||
const githubReleases = [];
|
const githubReleases = [];
|
||||||
for (const promise of promises) {
|
for (const release of releases) {
|
||||||
try {
|
try {
|
||||||
githubReleases.push(await promise);
|
githubReleases.push(await this.createRelease(release));
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (err instanceof errors_1.DuplicateReleaseError) {
|
if (err instanceof errors_1.DuplicateReleaseError) {
|
||||||
logger_1.logger.warn(`Duplicate release tag: ${err.tag}`);
|
logger_1.logger.warn(`Duplicate release tag: ${release.tag.toString()}`);
|
||||||
duplicateReleases.push(err);
|
duplicateReleases.push(err);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -81502,14 +81498,28 @@ class Manifest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (duplicateReleases.length > 0 && githubReleases.length === 0) {
|
if (duplicateReleases.length > 0) {
|
||||||
throw duplicateReleases[0];
|
if (duplicateReleases.length + githubReleases.length ===
|
||||||
|
releases.length) {
|
||||||
|
// we've either tagged all releases or they were duplicates:
|
||||||
|
// adjust tags on pullRequest
|
||||||
|
await Promise.all([
|
||||||
|
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
||||||
|
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if (githubReleases.length === 0) {
|
||||||
|
// If all releases were duplicate, throw a duplicate error
|
||||||
|
throw duplicateReleases[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// adjust tags on pullRequest
|
||||||
|
await Promise.all([
|
||||||
|
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
||||||
|
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
// adjust tags on pullRequest
|
|
||||||
await Promise.all([
|
|
||||||
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
|
||||||
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
|
||||||
]);
|
|
||||||
return githubReleases;
|
return githubReleases;
|
||||||
}
|
}
|
||||||
async createRelease(release) {
|
async createRelease(release) {
|
||||||
@@ -87680,6 +87690,12 @@ class ComponentBranchName extends BranchName {
|
|||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.CommitSplit = void 0;
|
exports.CommitSplit = void 0;
|
||||||
const manifest_1 = __nccwpck_require__(31999);
|
const manifest_1 = __nccwpck_require__(31999);
|
||||||
|
/**
|
||||||
|
* Helper class for splitting commits by component path. If `packagePaths`
|
||||||
|
* is configured, then only consider the provided paths. If `includeEmpty`
|
||||||
|
* is configured, then commits without any touched files apply to all
|
||||||
|
* configured component paths.
|
||||||
|
*/
|
||||||
class CommitSplit {
|
class CommitSplit {
|
||||||
constructor(opts) {
|
constructor(opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
@@ -87715,7 +87731,15 @@ class CommitSplit {
|
|||||||
this.packagePaths = paths;
|
this.packagePaths = paths;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// split(commits: Commit[]): Record<string, Commit[]>
|
/**
|
||||||
|
* Split commits by component path. If the commit splitter is configured
|
||||||
|
* with a set of tracked package paths, then only consider paths for
|
||||||
|
* configured components. If `includeEmpty` is configured, then a commit
|
||||||
|
* that does not touch any files will be applied to all components'
|
||||||
|
* commits.
|
||||||
|
* @param {Commit[]} commits The commits to split
|
||||||
|
* @returns {Record<string, Commit[]>} Commits indexed by component path
|
||||||
|
*/
|
||||||
split(commits) {
|
split(commits) {
|
||||||
const splitCommits = {};
|
const splitCommits = {};
|
||||||
commits.forEach(commit => {
|
commits.forEach(commit => {
|
||||||
@@ -87750,8 +87774,16 @@ class CommitSplit {
|
|||||||
splitCommits[pkgName].push(commit);
|
splitCommits[pkgName].push(commit);
|
||||||
}
|
}
|
||||||
if (commit.files.length === 0 && this.includeEmpty) {
|
if (commit.files.length === 0 && this.includeEmpty) {
|
||||||
for (const pkgName in splitCommits) {
|
if (this.packagePaths) {
|
||||||
splitCommits[pkgName].push(commit);
|
for (const pkgName of this.packagePaths) {
|
||||||
|
splitCommits[pkgName] = splitCommits[pkgName] || [];
|
||||||
|
splitCommits[pkgName].push(commit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (const pkgName in splitCommits) {
|
||||||
|
splitCommits[pkgName].push(commit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -113542,7 +113574,7 @@ module.exports = {};
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = {"i8":"13.16.3"};
|
module.exports = {"i8":"13.16.4"};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user