From ec4b1061734bdc0b2e732a3e80b160b35502e154 Mon Sep 17 00:00:00 2001 From: Google GitHub Actions Bot <72759630+google-github-actions-bot@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:45:42 -0500 Subject: [PATCH] chore: build dist (#538) chore: build dist release-please-action --- dist/index.js | 60 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9f4c615..39d993c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -79497,6 +79497,7 @@ function toConventionalChangelogFormat(ast) { text: '', // "text" will be populated if a BREAKING CHANGE token is parsed. }; visitWithAncestors(ast, ['breaking-change'], (node, ancestors) => { + let hitBreakingMarker = false; let parent = ancestors.pop(); if (!parent) { return; @@ -79509,7 +79510,13 @@ function toConventionalChangelogFormat(ast) { breaking.text = ''; // We treat text from the BREAKING CHANGE marker forward as // the breaking change notes: - visit(parent, ['text', 'newline'], (node) => { + visit(parent, ['breaking-change', 'text', 'newline'], (node) => { + if (node.type === 'breaking-change') { + hitBreakingMarker = true; + return; + } + if (!hitBreakingMarker) + return; breaking.text += node.value; }); break; @@ -83794,11 +83801,17 @@ class BaseStrategy { releaseData = pullRequestBody.releaseData[0]; } else { - // manifest release with multiple components - releaseData = pullRequestBody.releaseData.find(releaseData => { - return (this.normalizeComponent(releaseData.component) === + // manifest release with multiple components - find the release notes + // for the component to see if it was included in this release (parsed + // from the release pull request body) + releaseData = pullRequestBody.releaseData.find(datum => { + return (this.normalizeComponent(datum.component) === this.normalizeComponent(component)); }); + if (!releaseData && pullRequestBody.releaseData.length > 0) { + logger_1.logger.info(`Pull request contains releases, but not for component: ${component}`); + return; + } } const notes = releaseData === null || releaseData === void 0 ? void 0 : releaseData.notes; if (notes === undefined) { @@ -85491,20 +85504,16 @@ class Python extends base_1.BaseStrategy { logger_1.logger.warn('No project/component found.'); } else { - updates.push({ - path: this.addPath(`${projectName}/__init__.py`), + [projectName, projectName.replace(/-/g, '_')] + .flatMap(packageName => [ + `${packageName}/__init__.py`, + `src/${packageName}/__init__.py`, + ]) + .forEach(packagePath => updates.push({ + path: this.addPath(packagePath), createIfMissing: false, - updater: new python_file_with_version_1.PythonFileWithVersion({ - version, - }), - }); - updates.push({ - path: this.addPath(`src/${projectName}/__init__.py`), - createIfMissing: false, - updater: new python_file_with_version_1.PythonFileWithVersion({ - version, - }), - }); + updater: new python_file_with_version_1.PythonFileWithVersion({ version }), + })); } // There should be only one version.py, but foreach in case that is incorrect const versionPyFilesSearch = this.github.findFilesByFilenameAndRef('version.py', this.targetBranch, this.path); @@ -86204,19 +86213,24 @@ class PubspecYaml extends default_1.DefaultUpdater { * @returns {string} The updated content */ updateContent(content) { - const oldVersion = content.match(/version: ([0-9.]+)\+?([0-9]*$)/); + const oldVersion = content.match(/^version: ([0-9.]+)\+?(.*$)/m); let buildNumber = ''; if (oldVersion) { - buildNumber = `${oldVersion[2]}`; - if (buildNumber.length > 0) { + buildNumber = oldVersion[2]; + const parsedBuild = parseInt(buildNumber); + if (!isNaN(parsedBuild)) { + buildNumber = `+${parsedBuild + 1}`; + logger_1.logger.info(`updating from ${oldVersion[1]}+${oldVersion[2]} to ${this.version}${buildNumber}`); + } + else if (buildNumber.length > 0) { buildNumber = `+${buildNumber}`; - logger_1.logger.info(`updating from ${oldVersion[1]}${buildNumber} to ${this.version}${buildNumber}`); + logger_1.logger.info(`updating from ${oldVersion[1]}+${oldVersion[2]} to ${this.version}${buildNumber}`); } else { logger_1.logger.info(`updating from ${oldVersion[1]} to ${this.version}`); } } - return content.replace(/version: ([0-9.]+)\+?([0-9]*$)/, `version: ${this.version}${buildNumber}`); + return content.replace(/^version: .*$/m, `version: ${this.version}${buildNumber}`); } } exports.PubspecYaml = PubspecYaml; @@ -114295,7 +114309,7 @@ module.exports = {}; /***/ ((module) => { "use strict"; -module.exports = {"i8":"13.19.3"}; +module.exports = {"i8":"13.19.6"}; /***/ }),