release-please 13.9.0 → 13.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.10.0](https://github.com/googleapis/release-please/compare/v13.9.0...v13.10.0) (2022-04-12)
8
+
9
+
10
+ ### Features
11
+
12
+ * enable overriding release-as ([ffa0f7c](https://github.com/googleapis/release-please/commit/ffa0f7c7b0d0d2b65ce6285b62802ac08951a43c))
13
+ * support selecting a single path when releasing from a manifest ([#1362](https://github.com/googleapis/release-please/issues/1362)) ([ffa0f7c](https://github.com/googleapis/release-please/commit/ffa0f7c7b0d0d2b65ce6285b62802ac08951a43c))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **rust:** update Cargo.lock for single Rust crate ([#1374](https://github.com/googleapis/release-please/issues/1374)) ([e3571d3](https://github.com/googleapis/release-please/commit/e3571d32c44ae2bef8bac7dd8cdc3556a9d621c7))
19
+
7
20
  ## [13.9.0](https://github.com/googleapis/release-please/compare/v13.8.1...v13.9.0) (2022-04-12)
8
21
 
9
22
 
@@ -290,7 +290,7 @@ const createReleasePullRequestCommand = {
290
290
  }
291
291
  else {
292
292
  const manifestOptions = extractManifestOptions(argv);
293
- manifest = await manifest_1.Manifest.fromManifest(github, targetBranch, argv.configFile, argv.manifestFile, manifestOptions);
293
+ manifest = await manifest_1.Manifest.fromManifest(github, targetBranch, argv.configFile, argv.manifestFile, manifestOptions, argv.path, argv.releaseAs);
294
294
  }
295
295
  if (argv.dryRun) {
296
296
  const pullRequests = await manifest.buildPullRequests();
@@ -192,9 +192,10 @@ export declare class Manifest {
192
192
  * @param {string} targetBranch The releaseable base branch
193
193
  * @param {string} configFile Optional. The path to the manifest config file
194
194
  * @param {string} manifestFile Optional. The path to the manifest versions file
195
+ * @param {string} path The single path to check. Optional
195
196
  * @returns {Manifest}
196
197
  */
197
- static fromManifest(github: GitHub, targetBranch: string, configFile?: string, manifestFile?: string, manifestOptionOverrides?: ManifestOptions): Promise<Manifest>;
198
+ static fromManifest(github: GitHub, targetBranch: string, configFile?: string, manifestFile?: string, manifestOptionOverrides?: ManifestOptions, path?: string, releaseAs?: string): Promise<Manifest>;
198
199
  /**
199
200
  * Create a Manifest from explicit config in code. This assumes that the
200
201
  * repository has a single component at the root path.
@@ -91,11 +91,12 @@ class Manifest {
91
91
  * @param {string} targetBranch The releaseable base branch
92
92
  * @param {string} configFile Optional. The path to the manifest config file
93
93
  * @param {string} manifestFile Optional. The path to the manifest versions file
94
+ * @param {string} path The single path to check. Optional
94
95
  * @returns {Manifest}
95
96
  */
96
- static async fromManifest(github, targetBranch, configFile = exports.DEFAULT_RELEASE_PLEASE_CONFIG, manifestFile = exports.DEFAULT_RELEASE_PLEASE_MANIFEST, manifestOptionOverrides = {}) {
97
+ static async fromManifest(github, targetBranch, configFile = exports.DEFAULT_RELEASE_PLEASE_CONFIG, manifestFile = exports.DEFAULT_RELEASE_PLEASE_MANIFEST, manifestOptionOverrides = {}, path, releaseAs) {
97
98
  const [{ config: repositoryConfig, options: manifestOptions }, releasedVersions,] = await Promise.all([
98
- parseConfig(github, configFile, targetBranch),
99
+ parseConfig(github, configFile, targetBranch, path, releaseAs),
99
100
  parseReleasedVersions(github, manifestFile, targetBranch),
100
101
  ]);
101
102
  return new Manifest(github, targetBranch, repositoryConfig, releasedVersions, {
@@ -690,13 +691,20 @@ function extractReleaserConfig(config) {
690
691
  * @param {GitHub} github GitHub client
691
692
  * @param {string} configFile Path in the repository to the manifest config
692
693
  * @param {string} branch Branch to fetch the config file from
694
+ * @param {string} onlyPath Optional. Use only the given package
695
+ * @param {string} releaseAs Optional. Override release-as and use the given version
693
696
  */
694
- async function parseConfig(github, configFile, branch) {
697
+ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
695
698
  const config = await github.getFileJson(configFile, branch);
696
699
  const defaultConfig = extractReleaserConfig(config);
697
700
  const repositoryConfig = {};
698
701
  for (const path in config.packages) {
702
+ if (onlyPath && onlyPath !== path)
703
+ continue;
699
704
  repositoryConfig[path] = mergeReleaserConfig(defaultConfig, extractReleaserConfig(config.packages[path]));
705
+ if (releaseAs) {
706
+ repositoryConfig[path].releaseAs = releaseAs;
707
+ }
700
708
  }
701
709
  const configLabel = config['label'];
702
710
  const configReleaseLabel = config['release-label'];
@@ -88,10 +88,16 @@ class Rust extends base_1.BaseStrategy {
88
88
  });
89
89
  }
90
90
  else {
91
- const manifestPath = this.addPath('Cargo.toml');
92
- logger_1.logger.info(`single crate found, updating ${manifestPath}`);
91
+ logger_1.logger.info('single crate found, updating Cargo.toml');
92
+ const packageName = await this.getDefaultPackageName();
93
+ if (packageName) {
94
+ versionsMap.set(packageName, version);
95
+ }
96
+ else {
97
+ logger_1.logger.warn('No crate package name found');
98
+ }
93
99
  updates.push({
94
- path: manifestPath,
100
+ path: this.addPath('Cargo.toml'),
95
101
  createIfMissing: false,
96
102
  updater: new cargo_toml_1.CargoToml({
97
103
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.9.0",
3
+ "version": "13.10.0",
4
4
  "description": "generate release PRs based on the conventionalcommits.org spec",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": "./build/src/bin/release-please.js",