release-please 13.7.0 → 13.8.1
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 +27 -0
- package/build/src/bin/release-please.js +7 -0
- package/build/src/factory.d.ts +1 -1
- package/build/src/factory.js +3 -0
- package/build/src/manifest.d.ts +2 -0
- package/build/src/manifest.js +6 -4
- package/build/src/plugins/node-workspace.d.ts +1 -1
- package/build/src/strategies/base.d.ts +2 -0
- package/build/src/strategies/base.js +4 -3
- package/build/src/strategies/dotnet-yoshi.d.ts +12 -0
- package/build/src/strategies/dotnet-yoshi.js +96 -0
- package/build/src/strategies/php-yoshi.js +2 -1
- package/build/src/strategies/ruby-yoshi.d.ts +3 -3
- package/build/src/strategies/ruby-yoshi.js +11 -46
- package/build/src/updaters/dotnet/apis.d.ts +17 -0
- package/build/src/updaters/dotnet/apis.js +45 -0
- package/build/src/util/tag-name.d.ts +2 -1
- package/build/src/util/tag-name.js +6 -5
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.8.1](https://github.com/googleapis/release-please/compare/v13.8.0...v13.8.1) (2022-04-11)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Restore v12 changelog formatting for ruby-yoshi ([#1361](https://github.com/googleapis/release-please/issues/1361)) ([ff87c7d](https://github.com/googleapis/release-please/commit/ff87c7df00b652512641454ead34bb2cede2f67e))
|
|
13
|
+
|
|
14
|
+
## [13.8.0](https://github.com/googleapis/release-please/compare/v13.7.1...v13.8.0) (2022-03-31)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add dotnet-yoshi strategy ([#1346](https://github.com/googleapis/release-please/issues/1346)) ([3086e51](https://github.com/googleapis/release-please/commit/3086e5148e596751a2c2b82c28a7b3d3c1b960f2))
|
|
20
|
+
* allow configuring tag without "v" ([3086e51](https://github.com/googleapis/release-please/commit/3086e5148e596751a2c2b82c28a7b3d3c1b960f2))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **php-yoshi:** correctly ignore non-client directories ([#1358](https://github.com/googleapis/release-please/issues/1358)) ([58647dd](https://github.com/googleapis/release-please/commit/58647dd22d994ba670e762a2cef6b99b4b234af8)), closes [#1356](https://github.com/googleapis/release-please/issues/1356)
|
|
26
|
+
|
|
27
|
+
### [13.7.1](https://github.com/googleapis/release-please/compare/v13.7.0...v13.7.1) (2022-03-30)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* use lerna typings provided by DefinitelyTyped project ([#1351](https://github.com/googleapis/release-please/issues/1351)) ([86dccdf](https://github.com/googleapis/release-please/commit/86dccdf9dd2fbd8c517a88f4422412c18a944e07))
|
|
33
|
+
|
|
7
34
|
## [13.7.0](https://github.com/googleapis/release-please/compare/v13.6.0...v13.7.0) (2022-03-24)
|
|
8
35
|
|
|
9
36
|
|
|
@@ -238,6 +238,11 @@ function manifestOptions(yargs) {
|
|
|
238
238
|
}
|
|
239
239
|
function taggingOptions(yargs) {
|
|
240
240
|
return yargs
|
|
241
|
+
.option('include-v-in-tags', {
|
|
242
|
+
describe: 'include "v" in tag versions',
|
|
243
|
+
type: 'boolean',
|
|
244
|
+
default: true,
|
|
245
|
+
})
|
|
241
246
|
.option('monorepo-tags', {
|
|
242
247
|
describe: 'include library name in tags and release branches',
|
|
243
248
|
type: 'boolean',
|
|
@@ -275,6 +280,7 @@ const createReleasePullRequestCommand = {
|
|
|
275
280
|
extraFiles: argv.extraFiles,
|
|
276
281
|
versionFile: argv.versionFile,
|
|
277
282
|
includeComponentInTag: argv.monorepoTags,
|
|
283
|
+
includeVInTag: argv.includeVInTags,
|
|
278
284
|
}, extractManifestOptions(argv), argv.path);
|
|
279
285
|
}
|
|
280
286
|
else {
|
|
@@ -324,6 +330,7 @@ const createReleaseCommand = {
|
|
|
324
330
|
draft: argv.draft,
|
|
325
331
|
prerelease: argv.prerelease,
|
|
326
332
|
includeComponentInTag: argv.monorepoTags,
|
|
333
|
+
includeVInTag: argv.includeVInTags,
|
|
327
334
|
}, extractManifestOptions(argv), argv.path);
|
|
328
335
|
}
|
|
329
336
|
else {
|
package/build/src/factory.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { GitHub } from './github';
|
|
|
3
3
|
import { ReleaserConfig, PluginType, RepositoryConfig } from './manifest';
|
|
4
4
|
import { ManifestPlugin } from './plugin';
|
|
5
5
|
import { ChangelogNotes, ChangelogSection } from './changelog-notes';
|
|
6
|
-
declare const allReleaseTypes: readonly ["dart", "elixir", "go", "go-yoshi", "helm", "java-backport", "java-bom", "java-lts", "java-yoshi", "krm-blueprint", "node", "ocaml", "php", "php-yoshi", "python", "ruby", "ruby-yoshi", "rust", "simple", "terraform-module"];
|
|
6
|
+
declare const allReleaseTypes: readonly ["dart", "dotnet-yoshi", "elixir", "go", "go-yoshi", "helm", "java-backport", "java-bom", "java-lts", "java-yoshi", "krm-blueprint", "node", "ocaml", "php", "php-yoshi", "python", "ruby", "ruby-yoshi", "rust", "simple", "terraform-module"];
|
|
7
7
|
export declare type ReleaseType = typeof allReleaseTypes[number];
|
|
8
8
|
export declare function getReleaserTypes(): readonly ReleaseType[];
|
|
9
9
|
export declare function getVersioningStrategyTypes(): readonly VersioningStrategyType[];
|
package/build/src/factory.js
CHANGED
|
@@ -40,12 +40,14 @@ const cargo_workspace_1 = require("./plugins/cargo-workspace");
|
|
|
40
40
|
const github_1 = require("./changelog-notes/github");
|
|
41
41
|
const default_2 = require("./changelog-notes/default");
|
|
42
42
|
const linked_versions_1 = require("./plugins/linked-versions");
|
|
43
|
+
const dotnet_yoshi_1 = require("./strategies/dotnet-yoshi");
|
|
43
44
|
// Factory shared by GitHub Action and CLI for creating Release PRs
|
|
44
45
|
// and GitHub Releases:
|
|
45
46
|
// add any new releasers you create to this type as well as the `releasers`
|
|
46
47
|
// object below.
|
|
47
48
|
const allReleaseTypes = [
|
|
48
49
|
'dart',
|
|
50
|
+
'dotnet-yoshi',
|
|
49
51
|
'elixir',
|
|
50
52
|
'go',
|
|
51
53
|
'go-yoshi',
|
|
@@ -67,6 +69,7 @@ const allReleaseTypes = [
|
|
|
67
69
|
'terraform-module',
|
|
68
70
|
];
|
|
69
71
|
const releasers = {
|
|
72
|
+
'dotnet-yoshi': options => new dotnet_yoshi_1.DotnetYoshi(options),
|
|
70
73
|
go: options => new go_1.Go(options),
|
|
71
74
|
'go-yoshi': options => new go_yoshi_1.GoYoshi(options),
|
|
72
75
|
'java-yoshi': options => new java_yoshi_1.JavaYoshi(options),
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface ReleaserConfig {
|
|
|
32
32
|
component?: string;
|
|
33
33
|
packageName?: string;
|
|
34
34
|
includeComponentInTag?: boolean;
|
|
35
|
+
includeVInTag?: boolean;
|
|
35
36
|
pullRequestTitlePattern?: string;
|
|
36
37
|
tagSeparator?: string;
|
|
37
38
|
changelogSections?: ChangelogSection[];
|
|
@@ -64,6 +65,7 @@ interface ReleaserConfigJson {
|
|
|
64
65
|
label?: string;
|
|
65
66
|
'release-label'?: string;
|
|
66
67
|
'include-component-in-tag'?: boolean;
|
|
68
|
+
'include-v-in-tag'?: boolean;
|
|
67
69
|
'changelog-type'?: ChangelogNotesType;
|
|
68
70
|
'pull-request-title-pattern'?: string;
|
|
69
71
|
'tag-separator'?: string;
|
package/build/src/manifest.js
CHANGED
|
@@ -360,7 +360,7 @@ class Manifest {
|
|
|
360
360
|
continue;
|
|
361
361
|
}
|
|
362
362
|
const component = await strategiesByPath[path].getComponent();
|
|
363
|
-
const expectedTag = new tag_name_1.TagName(expectedVersion, component, this.repositoryConfig[path].tagSeparator);
|
|
363
|
+
const expectedTag = new tag_name_1.TagName(expectedVersion, component, this.repositoryConfig[path].tagSeparator, this.repositoryConfig[path].includeVInTag);
|
|
364
364
|
logger_1.logger.debug(`looking for tagName: ${expectedTag.toString()}`);
|
|
365
365
|
const foundTag = allTags[expectedTag.toString()];
|
|
366
366
|
if (foundTag) {
|
|
@@ -671,6 +671,7 @@ function extractReleaserConfig(config) {
|
|
|
671
671
|
versionFile: config['version-file'],
|
|
672
672
|
extraFiles: config['extra-files'],
|
|
673
673
|
includeComponentInTag: config['include-component-in-tag'],
|
|
674
|
+
includeVInTag: config['include-v-in-tag'],
|
|
674
675
|
changelogType: config['changelog-type'],
|
|
675
676
|
pullRequestTitlePattern: config['pull-request-title-pattern'],
|
|
676
677
|
tagSeparator: config['tag-separator'],
|
|
@@ -818,7 +819,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
|
|
|
818
819
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
819
820
|
}
|
|
820
821
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
821
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
822
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
822
823
|
return {
|
|
823
824
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
824
825
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -834,8 +835,9 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
834
835
|
versionFile: (_o = pathConfig.versionFile) !== null && _o !== void 0 ? _o : defaultConfig.versionFile,
|
|
835
836
|
extraFiles: (_p = pathConfig.extraFiles) !== null && _p !== void 0 ? _p : defaultConfig.extraFiles,
|
|
836
837
|
includeComponentInTag: (_q = pathConfig.includeComponentInTag) !== null && _q !== void 0 ? _q : defaultConfig.includeComponentInTag,
|
|
837
|
-
|
|
838
|
-
|
|
838
|
+
includeVInTag: (_r = pathConfig.includeVInTag) !== null && _r !== void 0 ? _r : defaultConfig.includeVInTag,
|
|
839
|
+
tagSeparator: (_s = pathConfig.tagSeparator) !== null && _s !== void 0 ? _s : defaultConfig.tagSeparator,
|
|
840
|
+
pullRequestTitlePattern: (_t = pathConfig.pullRequestTitlePattern) !== null && _t !== void 0 ? _t : defaultConfig.pullRequestTitlePattern,
|
|
839
841
|
};
|
|
840
842
|
}
|
|
841
843
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Package as LernaPackage, PackageJson } from '@lerna/package';
|
|
1
|
+
import { Package as LernaPackage, RawManifest as PackageJson } from '@lerna/package';
|
|
2
2
|
import { GitHub } from '../github';
|
|
3
3
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
4
4
|
import { Version, VersionsMap } from '../version';
|
|
@@ -37,6 +37,7 @@ export interface BaseStrategyOptions {
|
|
|
37
37
|
releaseAs?: string;
|
|
38
38
|
changelogNotes?: ChangelogNotes;
|
|
39
39
|
includeComponentInTag?: boolean;
|
|
40
|
+
includeVInTag?: boolean;
|
|
40
41
|
pullRequestTitlePattern?: string;
|
|
41
42
|
extraFiles?: ExtraFile[];
|
|
42
43
|
}
|
|
@@ -57,6 +58,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
57
58
|
private skipGitHubRelease;
|
|
58
59
|
private releaseAs?;
|
|
59
60
|
protected includeComponentInTag: boolean;
|
|
61
|
+
protected includeVInTag: boolean;
|
|
60
62
|
private pullRequestTitlePattern?;
|
|
61
63
|
readonly extraFiles: ExtraFile[];
|
|
62
64
|
readonly changelogNotes: ChangelogNotes;
|
|
@@ -35,7 +35,7 @@ const DEFAULT_CHANGELOG_PATH = 'CHANGELOG.md';
|
|
|
35
35
|
*/
|
|
36
36
|
class BaseStrategy {
|
|
37
37
|
constructor(options) {
|
|
38
|
-
var _a;
|
|
38
|
+
var _a, _b;
|
|
39
39
|
this.path = options.path || manifest_1.ROOT_PROJECT_PATH;
|
|
40
40
|
this.github = options.github;
|
|
41
41
|
this.packageName = options.packageName;
|
|
@@ -53,6 +53,7 @@ class BaseStrategy {
|
|
|
53
53
|
this.changelogNotes =
|
|
54
54
|
options.changelogNotes || new default_2.DefaultChangelogNotes(options);
|
|
55
55
|
this.includeComponentInTag = (_a = options.includeComponentInTag) !== null && _a !== void 0 ? _a : true;
|
|
56
|
+
this.includeVInTag = (_b = options.includeVInTag) !== null && _b !== void 0 ? _b : true;
|
|
56
57
|
this.pullRequestTitlePattern = options.pullRequestTitlePattern;
|
|
57
58
|
this.extraFiles = options.extraFiles || [];
|
|
58
59
|
}
|
|
@@ -136,7 +137,7 @@ class BaseStrategy {
|
|
|
136
137
|
const versionsMap = await this.updateVersionsMap(await this.buildVersionsMap(conventionalCommits), conventionalCommits);
|
|
137
138
|
const component = await this.getComponent();
|
|
138
139
|
logger_1.logger.debug('component:', component);
|
|
139
|
-
const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator);
|
|
140
|
+
const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator, this.includeVInTag);
|
|
140
141
|
logger_1.logger.debug('pull request title pattern:', this.pullRequestTitlePattern);
|
|
141
142
|
const pullRequestTitle = pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(component || '', this.targetBranch, newVersion, this.pullRequestTitlePattern);
|
|
142
143
|
const branchName = component
|
|
@@ -288,7 +289,7 @@ class BaseStrategy {
|
|
|
288
289
|
logger_1.logger.error('Pull request should have included version');
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
291
|
-
const tag = new tag_name_1.TagName(version, this.includeComponentInTag ? component : undefined, this.tagSeparator);
|
|
292
|
+
const tag = new tag_name_1.TagName(version, this.includeComponentInTag ? component : undefined, this.tagSeparator, this.includeVInTag);
|
|
292
293
|
const releaseName = component && this.includeComponentInTag
|
|
293
294
|
? `${component}: v${version.toString()}`
|
|
294
295
|
: `v${version.toString()}`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseStrategy, BuildUpdatesOptions, BaseStrategyOptions } from './base';
|
|
2
|
+
import { Update } from '../update';
|
|
3
|
+
import { ConventionalCommit } from '../commit';
|
|
4
|
+
import { Version } from '../version';
|
|
5
|
+
import { TagName } from '../util/tag-name';
|
|
6
|
+
import { Release } from '../release';
|
|
7
|
+
export declare class DotnetYoshi extends BaseStrategy {
|
|
8
|
+
constructor(options: BaseStrategyOptions);
|
|
9
|
+
protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
|
|
10
|
+
private getApi;
|
|
11
|
+
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DotnetYoshi = void 0;
|
|
17
|
+
const base_1 = require("./base");
|
|
18
|
+
const changelog_1 = require("../updaters/changelog");
|
|
19
|
+
const apis_1 = require("../updaters/dotnet/apis");
|
|
20
|
+
const logger_1 = require("../util/logger");
|
|
21
|
+
const errors_1 = require("../errors");
|
|
22
|
+
const CHANGELOG_SECTIONS = [
|
|
23
|
+
{ type: 'feat', section: 'New features' },
|
|
24
|
+
{ type: 'fix', section: 'Bug fixes' },
|
|
25
|
+
{ type: 'perf', section: 'Performance improvements' },
|
|
26
|
+
{ type: 'revert', section: 'Reverts' },
|
|
27
|
+
{ type: 'chore', section: 'Miscellaneous chores', hidden: true },
|
|
28
|
+
{ type: 'docs', section: 'Documentation improvements' },
|
|
29
|
+
{ type: 'style', section: 'Styles', hidden: true },
|
|
30
|
+
{ type: 'refactor', section: 'Code Refactoring', hidden: true },
|
|
31
|
+
{ type: 'test', section: 'Tests', hidden: true },
|
|
32
|
+
{ type: 'build', section: 'Build System', hidden: true },
|
|
33
|
+
{ type: 'ci', section: 'Continuous Integration', hidden: true },
|
|
34
|
+
];
|
|
35
|
+
const DEFAULT_CHANGELOG_PATH = 'docs/history.md';
|
|
36
|
+
const DEFAULT_PULL_REQUEST_TITLE_PATTERN = 'Release${component} version ${version}';
|
|
37
|
+
const RELEASE_NOTES_HEADER_PATTERN = /#{2,3} \[?(\d+\.\d+\.\d+-?[^\]]*)\]?.* \((\d{4}-\d{2}-\d{2})\)/;
|
|
38
|
+
class DotnetYoshi extends base_1.BaseStrategy {
|
|
39
|
+
constructor(options) {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
|
|
42
|
+
options.changelogPath = (_b = options.changelogPath) !== null && _b !== void 0 ? _b : DEFAULT_CHANGELOG_PATH;
|
|
43
|
+
options.pullRequestTitlePattern = (_c = options.pullRequestTitlePattern) !== null && _c !== void 0 ? _c : DEFAULT_PULL_REQUEST_TITLE_PATTERN;
|
|
44
|
+
options.includeVInTag = (_d = options.includeVInTag) !== null && _d !== void 0 ? _d : false;
|
|
45
|
+
super(options);
|
|
46
|
+
}
|
|
47
|
+
async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
|
|
48
|
+
const notes = await super.buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease);
|
|
49
|
+
return notes.replace(RELEASE_NOTES_HEADER_PATTERN, '## Version $1, released $2');
|
|
50
|
+
}
|
|
51
|
+
async getApi() {
|
|
52
|
+
try {
|
|
53
|
+
const contents = await this.github.getFileContentsOnBranch('apis/apis.json', this.targetBranch);
|
|
54
|
+
const apis = JSON.parse(contents.parsedContent);
|
|
55
|
+
const component = await this.getComponent();
|
|
56
|
+
return apis.apis.find(api => api.id === component);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
if (e instanceof errors_1.FileNotFoundError) {
|
|
60
|
+
throw new errors_1.MissingRequiredFileError('apis/apis.json', DotnetYoshi.name, `${this.repository.owner}/${this.repository.repo}`);
|
|
61
|
+
}
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async buildUpdates(options) {
|
|
66
|
+
const updates = [];
|
|
67
|
+
const version = options.newVersion;
|
|
68
|
+
const component = await this.getComponent();
|
|
69
|
+
const api = await this.getApi();
|
|
70
|
+
if (api === null || api === void 0 ? void 0 : api.noVersionHistory) {
|
|
71
|
+
logger_1.logger.info(`Skipping changelog for ${component} via noVersionHistory configuration`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
updates.push({
|
|
75
|
+
path: this.addPath(this.changelogPath),
|
|
76
|
+
createIfMissing: true,
|
|
77
|
+
updater: new changelog_1.Changelog({
|
|
78
|
+
version,
|
|
79
|
+
changelogEntry: options.changelogEntry,
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (!this.component) {
|
|
84
|
+
logger_1.logger.warn('Dotnet strategy expects to use components, could not update all files');
|
|
85
|
+
return updates;
|
|
86
|
+
}
|
|
87
|
+
updates.push({
|
|
88
|
+
path: 'apis/apis.json',
|
|
89
|
+
createIfMissing: false,
|
|
90
|
+
updater: new apis_1.Apis(this.component, version),
|
|
91
|
+
});
|
|
92
|
+
return updates;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.DotnetYoshi = DotnetYoshi;
|
|
96
|
+
//# sourceMappingURL=dotnet-yoshi.js.map
|
|
@@ -28,6 +28,7 @@ const tag_name_1 = require("../util/tag-name");
|
|
|
28
28
|
const pull_request_title_1 = require("../util/pull-request-title");
|
|
29
29
|
const branch_name_1 = require("../util/branch-name");
|
|
30
30
|
const pull_request_body_1 = require("../util/pull-request-body");
|
|
31
|
+
const errors_1 = require("../errors");
|
|
31
32
|
const CHANGELOG_SECTIONS = [
|
|
32
33
|
{ type: 'feat', section: 'Features' },
|
|
33
34
|
{ type: 'fix', section: 'Bug Fixes' },
|
|
@@ -89,7 +90,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
89
90
|
releaseNotesBody = updatePHPChangelogEntry(`${composer.name} ${newVersion.toString()}`, releaseNotesBody, partialReleaseNotes);
|
|
90
91
|
}
|
|
91
92
|
catch (err) {
|
|
92
|
-
if (err
|
|
93
|
+
if (err instanceof errors_1.FileNotFoundError) {
|
|
93
94
|
// if the updated path has no VERSION, assume this isn't a
|
|
94
95
|
// module that needs updating.
|
|
95
96
|
continue;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseStrategy, BuildUpdatesOptions, BaseStrategyOptions } from './base';
|
|
2
|
-
import { ConventionalCommit } from '../commit';
|
|
2
|
+
import { ConventionalCommit, Commit } from '../commit';
|
|
3
3
|
import { Update } from '../update';
|
|
4
4
|
import { Release } from '../release';
|
|
5
|
+
import { TagName } from '../util/tag-name';
|
|
5
6
|
import { Version } from '../version';
|
|
6
|
-
import { PullRequestBody } from '../util/pull-request-body';
|
|
7
7
|
interface RubyYoshiStrategyOptions extends BaseStrategyOptions {
|
|
8
8
|
versionFile?: string;
|
|
9
9
|
}
|
|
@@ -12,6 +12,6 @@ export declare class RubyYoshi extends BaseStrategy {
|
|
|
12
12
|
constructor(options: RubyYoshiStrategyOptions);
|
|
13
13
|
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
14
14
|
protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
|
|
15
|
-
protected
|
|
15
|
+
protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release, commits?: Commit[]): Promise<string>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -22,9 +22,6 @@ const version_rb_1 = require("../updaters/ruby/version-rb");
|
|
|
22
22
|
const base_1 = require("./base");
|
|
23
23
|
const fs_1 = require("fs");
|
|
24
24
|
const path_1 = require("path");
|
|
25
|
-
const manifest_1 = require("../manifest");
|
|
26
|
-
const logger_1 = require("../util/logger");
|
|
27
|
-
const pull_request_body_1 = require("../util/pull-request-body");
|
|
28
25
|
const CHANGELOG_SECTIONS = [
|
|
29
26
|
{ type: 'feat', section: 'Features' },
|
|
30
27
|
{ type: 'fix', section: 'Bug Fixes' },
|
|
@@ -80,49 +77,17 @@ class RubyYoshi extends base_1.BaseStrategy {
|
|
|
80
77
|
});
|
|
81
78
|
return commits;
|
|
82
79
|
}
|
|
83
|
-
async
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const splitMessage = commit.message.split('\n');
|
|
95
|
-
summary += `* [${splitMessage[0]}](https://github.com/${repoUrl}/commit/${commit.sha})\n`;
|
|
96
|
-
if (splitMessage.length > 2) {
|
|
97
|
-
summary = `${summary}<pre><code>${splitMessage
|
|
98
|
-
.slice(1)
|
|
99
|
-
.join('\n')}</code></pre>\n`;
|
|
100
|
-
}
|
|
101
|
-
if (commit.files === undefined) {
|
|
102
|
-
logger_1.logger.error('No files for commit - this is likely a bug.');
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
commit.files.forEach(file => {
|
|
106
|
-
if (this.path === manifest_1.ROOT_PROJECT_PATH || file.startsWith(this.path)) {
|
|
107
|
-
updatedFiles[file] = true;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
// summarize the files that changed:
|
|
112
|
-
summary = `${summary}\n### Files edited since last release:\n\n<pre><code>`;
|
|
113
|
-
Object.keys(updatedFiles).forEach(file => {
|
|
114
|
-
summary += `${file}\n`;
|
|
115
|
-
});
|
|
116
|
-
summary += `</code></pre>\n[Compare Changes](https://github.com/${repoUrl}/compare/${latestRelease.sha}...HEAD)\n`;
|
|
117
|
-
return new pull_request_body_1.PullRequestBody([
|
|
118
|
-
{
|
|
119
|
-
component,
|
|
120
|
-
version: newVersion,
|
|
121
|
-
notes: releaseNotesBody,
|
|
122
|
-
},
|
|
123
|
-
], {
|
|
124
|
-
extra: summary,
|
|
125
|
-
});
|
|
80
|
+
async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease, commits) {
|
|
81
|
+
const releaseNotes = await super.buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease, commits);
|
|
82
|
+
return (releaseNotes
|
|
83
|
+
// Remove links in version title line and standardize on h3
|
|
84
|
+
.replace(/^###? \[([\d.]+)\]\([^)]*\)/gm, '### $1')
|
|
85
|
+
// Remove PR and commit links from pull request title suffixes
|
|
86
|
+
.replace(/ \(\[#\d+\]\([^)]*\)\)( \(\[\w+\]\([^)]*\)\))?\s*$/gm, '')
|
|
87
|
+
// Standardize on h4 for change type subheaders
|
|
88
|
+
.replace(/^### (Features|Bug Fixes|Documentation)$/gm, '#### $1')
|
|
89
|
+
// Collapse 2 or more blank lines
|
|
90
|
+
.replace(/\n{3,}/g, '\n\n'));
|
|
126
91
|
}
|
|
127
92
|
}
|
|
128
93
|
exports.RubyYoshi = RubyYoshi;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Updater } from '../../update';
|
|
2
|
+
import { Version } from '../../version';
|
|
3
|
+
/**
|
|
4
|
+
* Updates the apis.json format. See
|
|
5
|
+
* https://github.com/googleapis/google-cloud-dotnet/blob/main/apis/README.md.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Apis implements Updater {
|
|
8
|
+
private version;
|
|
9
|
+
private component;
|
|
10
|
+
constructor(component: string, version: Version);
|
|
11
|
+
/**
|
|
12
|
+
* Given initial file contents, return updated contents.
|
|
13
|
+
* @param {string} content The initial content
|
|
14
|
+
* @returns {string} The updated content
|
|
15
|
+
*/
|
|
16
|
+
updateContent(content: string): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Apis = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
19
|
+
/**
|
|
20
|
+
* Updates the apis.json format. See
|
|
21
|
+
* https://github.com/googleapis/google-cloud-dotnet/blob/main/apis/README.md.
|
|
22
|
+
*/
|
|
23
|
+
class Apis {
|
|
24
|
+
constructor(component, version) {
|
|
25
|
+
this.component = component;
|
|
26
|
+
this.version = version;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Given initial file contents, return updated contents.
|
|
30
|
+
* @param {string} content The initial content
|
|
31
|
+
* @returns {string} The updated content
|
|
32
|
+
*/
|
|
33
|
+
updateContent(content) {
|
|
34
|
+
const data = JSON.parse(content);
|
|
35
|
+
const api = data.apis.find(api => api.id === this.component);
|
|
36
|
+
if (!api) {
|
|
37
|
+
logger_1.logger.warn(`Failed to find component: ${this.component} in apis.json`);
|
|
38
|
+
return content;
|
|
39
|
+
}
|
|
40
|
+
api.version = this.version.toString();
|
|
41
|
+
return json_stringify_1.jsonStringify(data, content);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Apis = Apis;
|
|
45
|
+
//# sourceMappingURL=apis.js.map
|
|
@@ -3,7 +3,8 @@ export declare class TagName {
|
|
|
3
3
|
component?: string;
|
|
4
4
|
version: Version;
|
|
5
5
|
separator: string;
|
|
6
|
-
|
|
6
|
+
includeV: boolean;
|
|
7
|
+
constructor(version: Version, component?: string, separator?: string, includeV?: boolean);
|
|
7
8
|
static parse(tagName: string): TagName | undefined;
|
|
8
9
|
toString(): string;
|
|
9
10
|
}
|
|
@@ -15,26 +15,27 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.TagName = void 0;
|
|
17
17
|
const version_1 = require("../version");
|
|
18
|
-
const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-Z]))?v(?<version>\d+\.\d+\.\d+.*)$/;
|
|
18
|
+
const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-Z]))?(?<v>v)?(?<version>\d+\.\d+\.\d+.*)$/;
|
|
19
19
|
const DEFAULT_SEPARATOR = '-';
|
|
20
20
|
class TagName {
|
|
21
|
-
constructor(version, component, separator = DEFAULT_SEPARATOR) {
|
|
21
|
+
constructor(version, component, separator = DEFAULT_SEPARATOR, includeV = true) {
|
|
22
22
|
this.version = version;
|
|
23
23
|
this.component = component;
|
|
24
24
|
this.separator = separator;
|
|
25
|
+
this.includeV = includeV;
|
|
25
26
|
}
|
|
26
27
|
static parse(tagName) {
|
|
27
28
|
const match = tagName.match(TAG_PATTERN);
|
|
28
29
|
if (match === null || match === void 0 ? void 0 : match.groups) {
|
|
29
|
-
return new TagName(version_1.Version.parse(match.groups.version), match.groups.component, match.groups.separator);
|
|
30
|
+
return new TagName(version_1.Version.parse(match.groups.version), match.groups.component, match.groups.separator, !!match.groups.v);
|
|
30
31
|
}
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
toString() {
|
|
34
35
|
if (this.component) {
|
|
35
|
-
return `${this.component}${this.separator}v${this.version.toString()}`;
|
|
36
|
+
return `${this.component}${this.separator}${this.includeV ? 'v' : ''}${this.version.toString()}`;
|
|
36
37
|
}
|
|
37
|
-
return
|
|
38
|
+
return `${this.includeV ? 'v' : ''}${this.version.toString()}`;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.TagName = TagName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.8.1",
|
|
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",
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"@types/iarna__toml": "^2.0.1",
|
|
43
43
|
"@types/js-yaml": "^4.0.0",
|
|
44
44
|
"@types/jsonpath": "^0.2.0",
|
|
45
|
+
"@types/lerna__collect-updates": "^4.0.0",
|
|
46
|
+
"@types/lerna__package": "^4.0.2",
|
|
47
|
+
"@types/lerna__package-graph": "^4.0.1",
|
|
48
|
+
"@types/lerna__run-topologically": "^4.0.0",
|
|
45
49
|
"@types/mocha": "^9.0.0",
|
|
46
50
|
"@types/node": "^16.0.0",
|
|
47
51
|
"@types/pino": "^7.0.0",
|