release-please 15.1.1 → 15.2.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 +17 -0
- package/build/src/bin/release-please.d.ts +4 -19
- package/build/src/bin/release-please.js +22 -0
- package/build/src/factory.js +2 -0
- package/build/src/index.d.ts +1 -0
- package/build/src/plugins/maven-workspace.js +7 -1
- package/build/src/strategies/base.d.ts +1 -0
- package/build/src/strategies/base.js +1 -0
- package/build/src/strategies/java-yoshi-mono-repo.d.ts +21 -0
- package/build/src/strategies/java-yoshi-mono-repo.js +254 -0
- package/build/src/strategies/java.js +1 -0
- package/build/src/strategies/php-yoshi.js +1 -0
- package/build/src/updaters/changelog-json.d.ts +29 -0
- package/build/src/updaters/changelog-json.js +82 -0
- package/build/src/updaters/ruby/gemfile-lock.js +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [15.2.0](https://github.com/googleapis/release-please/compare/v15.1.2...v15.2.0) (2023-01-23)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **cli:** Add ability to dynamically load release-please plugin ([#1811](https://github.com/googleapis/release-please/issues/1811)) ([609383b](https://github.com/googleapis/release-please/commit/609383be5a05bb0107b489314b4bcd7615ddafd9))
|
|
13
|
+
* Export Strategy interface so external packages can implement ([609383b](https://github.com/googleapis/release-please/commit/609383be5a05bb0107b489314b4bcd7615ddafd9))
|
|
14
|
+
* Introduce ChangelogJson updater ([#1808](https://github.com/googleapis/release-please/issues/1808)) ([fe3a979](https://github.com/googleapis/release-please/commit/fe3a979a1c228610612aa2d6c303d408be956e2e))
|
|
15
|
+
* Introduce JavaYoshiMonoRepo strategy ([#1810](https://github.com/googleapis/release-please/issues/1810)) ([2d14307](https://github.com/googleapis/release-please/commit/2d143077a545b92e1d9de923ab81ae1e12b7a468))
|
|
16
|
+
|
|
17
|
+
## [15.1.2](https://github.com/googleapis/release-please/compare/v15.1.1...v15.1.2) (2023-01-17)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **ruby:** Gemfile.lock should not update when gem name is empty ([#1805](https://github.com/googleapis/release-please/issues/1805)) ([b54d499](https://github.com/googleapis/release-please/commit/b54d499a6b38e13175402fbd7eb7be75094d5014))
|
|
23
|
+
|
|
7
24
|
## [15.1.1](https://github.com/googleapis/release-please/compare/v15.1.0...v15.1.1) (2023-01-06)
|
|
8
25
|
|
|
9
26
|
|
|
@@ -6,27 +6,12 @@ interface ErrorObject {
|
|
|
6
6
|
message: string;
|
|
7
7
|
stack: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
dryRun?: boolean;
|
|
11
|
-
trace?: boolean;
|
|
12
|
-
repoUrl?: string;
|
|
13
|
-
token?: string;
|
|
14
|
-
apiUrl?: string;
|
|
15
|
-
graphqlUrl?: string;
|
|
16
|
-
fork?: boolean;
|
|
17
|
-
defaultBranch?: string;
|
|
18
|
-
targetBranch?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ManifestArgs {
|
|
21
|
-
configFile?: string;
|
|
22
|
-
manifestFile?: string;
|
|
23
|
-
}
|
|
24
|
-
interface DebugConfigArgs extends GitHubArgs, ManifestArgs {
|
|
25
|
-
}
|
|
26
|
-
export declare const parser: yargs.Argv<yargs.Omit<DebugConfigArgs & {
|
|
9
|
+
export declare const parser: yargs.Argv<{
|
|
27
10
|
debug: boolean;
|
|
28
|
-
}
|
|
11
|
+
} & {
|
|
29
12
|
trace: boolean;
|
|
13
|
+
} & {
|
|
14
|
+
plugin: (string | number)[] | never[];
|
|
30
15
|
}>;
|
|
31
16
|
interface HandleError {
|
|
32
17
|
(err: ErrorObject): void;
|
|
@@ -570,6 +570,28 @@ exports.parser = yargs
|
|
|
570
570
|
else if (argv.debug) {
|
|
571
571
|
(0, logger_1.setLogger)(new logger_1.CheckpointLogger(true));
|
|
572
572
|
}
|
|
573
|
+
})
|
|
574
|
+
.option('plugin', {
|
|
575
|
+
describe: 'load plugin named release-please-<plugin-name>',
|
|
576
|
+
type: 'array',
|
|
577
|
+
default: [],
|
|
578
|
+
})
|
|
579
|
+
.middleware(argv => {
|
|
580
|
+
for (const pluginName of argv.plugin) {
|
|
581
|
+
console.log(`requiring plugin: ${pluginName}`);
|
|
582
|
+
try {
|
|
583
|
+
const plugin = require(pluginName.toString());
|
|
584
|
+
if (plugin === null || plugin === void 0 ? void 0 : plugin.init) {
|
|
585
|
+
console.log(`loading plugin: ${pluginName}`);
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
console.warn(`plugin: ${pluginName} did not have an init() function.`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
catch (e) {
|
|
592
|
+
console.warn(`failed to require plugin: ${pluginName}:`, e);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
573
595
|
})
|
|
574
596
|
.demandCommand(1)
|
|
575
597
|
.strict(true)
|
package/build/src/factory.js
CHANGED
|
@@ -31,6 +31,7 @@ exports.getReleaserTypes = exports.unregisterReleaseType = exports.registerRelea
|
|
|
31
31
|
const go_1 = require("./strategies/go");
|
|
32
32
|
const go_yoshi_1 = require("./strategies/go-yoshi");
|
|
33
33
|
const java_yoshi_1 = require("./strategies/java-yoshi");
|
|
34
|
+
const java_yoshi_mono_repo_1 = require("./strategies/java-yoshi-mono-repo");
|
|
34
35
|
const krm_blueprint_1 = require("./strategies/krm-blueprint");
|
|
35
36
|
const ocaml_1 = require("./strategies/ocaml");
|
|
36
37
|
const php_1 = require("./strategies/php");
|
|
@@ -65,6 +66,7 @@ const releasers = {
|
|
|
65
66
|
java: options => new java_1.Java(options),
|
|
66
67
|
maven: options => new maven_1.Maven(options),
|
|
67
68
|
'java-yoshi': options => new java_yoshi_1.JavaYoshi(options),
|
|
69
|
+
'java-yoshi-mono-repo': options => new java_yoshi_mono_repo_1.JavaYoshiMonoRepo(options),
|
|
68
70
|
'java-backport': options => new java_yoshi_1.JavaYoshi({
|
|
69
71
|
...options,
|
|
70
72
|
versioningStrategy: new always_bump_patch_1.AlwaysBumpPatch(),
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Errors from './errors';
|
|
2
2
|
export { Manifest, ReleaserConfig, ManifestOptions, PluginType, } from './manifest';
|
|
3
3
|
export { Commit, ConventionalCommit } from './commit';
|
|
4
|
+
export { Strategy } from './strategy';
|
|
4
5
|
export { BaseStrategyOptions, BuildUpdatesOptions } from './strategies/base';
|
|
5
6
|
export { ReleaseBuilder, ReleaseType, getReleaserTypes, registerReleaseType, } from './factory';
|
|
6
7
|
export { ChangelogNotesBuilder, ChangelogNotesFactoryOptions, ChangelogNotesType, getChangelogTypes, registerChangelogNotes, } from './factories/changelog-notes-factory';
|
|
@@ -28,7 +28,13 @@ const logger_1 = require("../util/logger");
|
|
|
28
28
|
const java_snapshot_1 = require("../versioning-strategies/java-snapshot");
|
|
29
29
|
const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
|
|
30
30
|
const composite_1 = require("../updaters/composite");
|
|
31
|
-
const JAVA_RELEASE_TYPES = new Set([
|
|
31
|
+
const JAVA_RELEASE_TYPES = new Set([
|
|
32
|
+
'java',
|
|
33
|
+
'java-bom',
|
|
34
|
+
'java-yoshi',
|
|
35
|
+
'java-yoshi-mono-repo',
|
|
36
|
+
'maven',
|
|
37
|
+
]);
|
|
32
38
|
const XPATH_PROJECT_GROUP = '/*[local-name()="project"]/*[local-name()="groupId"]';
|
|
33
39
|
const XPATH_PROJECT_ARTIFACT = '/*[local-name()="project"]/*[local-name()="artifactId"]';
|
|
34
40
|
const XPATH_PROJECT_VERSION = '/*[local-name()="project"]/*[local-name()="version"]';
|
|
@@ -15,6 +15,7 @@ import { PullRequestBody } from '../util/pull-request-body';
|
|
|
15
15
|
import { PullRequest } from '../pull-request';
|
|
16
16
|
export interface BuildUpdatesOptions {
|
|
17
17
|
changelogEntry: string;
|
|
18
|
+
commits?: ConventionalCommit[];
|
|
18
19
|
newVersion: Version;
|
|
19
20
|
versionsMap: VersionsMap;
|
|
20
21
|
latestVersion?: Version;
|
|
@@ -165,6 +165,7 @@ class BaseStrategy {
|
|
|
165
165
|
newVersion,
|
|
166
166
|
versionsMap,
|
|
167
167
|
latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
|
|
168
|
+
commits: conventionalCommits,
|
|
168
169
|
});
|
|
169
170
|
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...(await this.extraFileUpdates(newVersion, versionsMap))));
|
|
170
171
|
const pullRequestBody = await this.buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease, this.pullRequestHeader);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Update } from '../update';
|
|
2
|
+
import { Version, VersionsMap } from '../version';
|
|
3
|
+
import { GitHubFileContents } from '@google-automations/git-file-utils';
|
|
4
|
+
import { ConventionalCommit } from '../commit';
|
|
5
|
+
import { Java, JavaBuildUpdatesOption } from './java';
|
|
6
|
+
export declare class JavaYoshiMonoRepo extends Java {
|
|
7
|
+
private versionsContent?;
|
|
8
|
+
/**
|
|
9
|
+
* Override this method to post process commits
|
|
10
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
11
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
12
|
+
*/
|
|
13
|
+
protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
|
|
14
|
+
protected needsSnapshot(): Promise<boolean>;
|
|
15
|
+
protected buildVersionsMap(): Promise<VersionsMap>;
|
|
16
|
+
protected getVersionsContent(): Promise<GitHubFileContents>;
|
|
17
|
+
protected buildUpdates(options: JavaBuildUpdatesOption): Promise<Update[]>;
|
|
18
|
+
private getArtifactMap;
|
|
19
|
+
protected updateVersionsMap(versionsMap: VersionsMap, conventionalCommits: ConventionalCommit[]): Promise<VersionsMap>;
|
|
20
|
+
protected initialReleaseVersion(): Version;
|
|
21
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 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.JavaYoshiMonoRepo = void 0;
|
|
17
|
+
const versions_manifest_1 = require("../updaters/java/versions-manifest");
|
|
18
|
+
const version_1 = require("../version");
|
|
19
|
+
const changelog_1 = require("../updaters/changelog");
|
|
20
|
+
const changelog_json_1 = require("../updaters/changelog-json");
|
|
21
|
+
const commit_split_1 = require("../util/commit-split");
|
|
22
|
+
const composite_1 = require("../updaters/composite");
|
|
23
|
+
const errors_1 = require("../errors");
|
|
24
|
+
const java_1 = require("./java");
|
|
25
|
+
const java_update_1 = require("../updaters/java/java-update");
|
|
26
|
+
const BREAKING_CHANGE_NOTE = 'BREAKING CHANGE';
|
|
27
|
+
class JavaYoshiMonoRepo extends java_1.Java {
|
|
28
|
+
/**
|
|
29
|
+
* Override this method to post process commits
|
|
30
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
31
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
32
|
+
*/
|
|
33
|
+
async postProcessCommits(commits) {
|
|
34
|
+
if (commits.length === 0) {
|
|
35
|
+
// For Java commits, push a fake commit so we force a
|
|
36
|
+
// SNAPSHOT release
|
|
37
|
+
commits.push({
|
|
38
|
+
type: 'fake',
|
|
39
|
+
bareMessage: 'fake commit',
|
|
40
|
+
message: 'fake commit',
|
|
41
|
+
breaking: false,
|
|
42
|
+
scope: null,
|
|
43
|
+
notes: [],
|
|
44
|
+
files: [],
|
|
45
|
+
references: [],
|
|
46
|
+
sha: 'fake',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return commits;
|
|
50
|
+
}
|
|
51
|
+
async needsSnapshot() {
|
|
52
|
+
return versions_manifest_1.VersionsManifest.needsSnapshot((await this.getVersionsContent()).parsedContent);
|
|
53
|
+
}
|
|
54
|
+
async buildVersionsMap() {
|
|
55
|
+
this.versionsContent = await this.getVersionsContent();
|
|
56
|
+
return versions_manifest_1.VersionsManifest.parseVersions(this.versionsContent.parsedContent);
|
|
57
|
+
}
|
|
58
|
+
async getVersionsContent() {
|
|
59
|
+
if (!this.versionsContent) {
|
|
60
|
+
try {
|
|
61
|
+
this.versionsContent = await this.github.getFileContentsOnBranch(this.addPath('versions.txt'), this.targetBranch);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
if (err instanceof errors_1.GitHubAPIError) {
|
|
65
|
+
throw new errors_1.MissingRequiredFileError(this.addPath('versions.txt'), JavaYoshiMonoRepo.name, `${this.repository.owner}/${this.repository.repo}`);
|
|
66
|
+
}
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return this.versionsContent;
|
|
71
|
+
}
|
|
72
|
+
async buildUpdates(options) {
|
|
73
|
+
const updates = [];
|
|
74
|
+
const version = options.newVersion;
|
|
75
|
+
const versionsMap = options.versionsMap;
|
|
76
|
+
updates.push({
|
|
77
|
+
path: this.addPath('versions.txt'),
|
|
78
|
+
createIfMissing: false,
|
|
79
|
+
cachedFileContents: this.versionsContent,
|
|
80
|
+
updater: new versions_manifest_1.VersionsManifest({
|
|
81
|
+
version,
|
|
82
|
+
versionsMap,
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
const pomFilesSearch = this.github.findFilesByFilenameAndRef('pom.xml', this.targetBranch, this.path);
|
|
86
|
+
const buildFilesSearch = this.github.findFilesByFilenameAndRef('build.gradle', this.targetBranch, this.path);
|
|
87
|
+
const dependenciesSearch = this.github.findFilesByFilenameAndRef('dependencies.properties', this.targetBranch, this.path);
|
|
88
|
+
const pomFiles = await pomFilesSearch;
|
|
89
|
+
pomFiles.forEach(path => {
|
|
90
|
+
updates.push({
|
|
91
|
+
path: this.addPath(path),
|
|
92
|
+
createIfMissing: false,
|
|
93
|
+
updater: new java_update_1.JavaUpdate({
|
|
94
|
+
version,
|
|
95
|
+
versionsMap,
|
|
96
|
+
isSnapshot: options.isSnapshot,
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const buildFiles = await buildFilesSearch;
|
|
101
|
+
buildFiles.forEach(path => {
|
|
102
|
+
updates.push({
|
|
103
|
+
path: this.addPath(path),
|
|
104
|
+
createIfMissing: false,
|
|
105
|
+
updater: new java_update_1.JavaUpdate({
|
|
106
|
+
version,
|
|
107
|
+
versionsMap,
|
|
108
|
+
isSnapshot: options.isSnapshot,
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
const dependenciesFiles = await dependenciesSearch;
|
|
113
|
+
dependenciesFiles.forEach(path => {
|
|
114
|
+
updates.push({
|
|
115
|
+
path: this.addPath(path),
|
|
116
|
+
createIfMissing: false,
|
|
117
|
+
updater: new java_update_1.JavaUpdate({
|
|
118
|
+
version,
|
|
119
|
+
versionsMap,
|
|
120
|
+
isSnapshot: options.isSnapshot,
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
this.extraFiles.forEach(extraFile => {
|
|
125
|
+
if (typeof extraFile === 'object') {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
updates.push({
|
|
129
|
+
path: extraFile,
|
|
130
|
+
createIfMissing: false,
|
|
131
|
+
updater: new java_update_1.JavaUpdate({
|
|
132
|
+
version,
|
|
133
|
+
versionsMap,
|
|
134
|
+
isSnapshot: options.isSnapshot,
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
if (!options.isSnapshot) {
|
|
139
|
+
updates.push({
|
|
140
|
+
path: this.addPath(this.changelogPath),
|
|
141
|
+
createIfMissing: true,
|
|
142
|
+
updater: new changelog_1.Changelog({
|
|
143
|
+
version,
|
|
144
|
+
changelogEntry: options.changelogEntry,
|
|
145
|
+
}),
|
|
146
|
+
});
|
|
147
|
+
// The artifact map maps from directory paths in repo to artifact names on
|
|
148
|
+
// Maven, e.g, java-secretmanager to com.google.cloud/google-cloud-secretmanager.
|
|
149
|
+
const artifactMap = await this.getArtifactMap('artifact-map.json');
|
|
150
|
+
if (artifactMap && options.commits) {
|
|
151
|
+
const changelogUpdates = [];
|
|
152
|
+
const cs = new commit_split_1.CommitSplit({
|
|
153
|
+
includeEmpty: false,
|
|
154
|
+
});
|
|
155
|
+
const splitCommits = cs.split(options.commits.filter(commit => {
|
|
156
|
+
const isBreaking = commit.notes.find(note => {
|
|
157
|
+
return note.title === BREAKING_CHANGE_NOTE;
|
|
158
|
+
});
|
|
159
|
+
return commit.type !== 'chore' || isBreaking;
|
|
160
|
+
}));
|
|
161
|
+
for (const path of Object.keys(splitCommits)) {
|
|
162
|
+
if (artifactMap[path]) {
|
|
163
|
+
this.logger.info(`Found artifact ${artifactMap[path]} for ${path}`);
|
|
164
|
+
changelogUpdates.push(new changelog_json_1.ChangelogJson({
|
|
165
|
+
artifactName: artifactMap[path],
|
|
166
|
+
version,
|
|
167
|
+
// We filter out "chore:" commits, to reduce noise in the upstream
|
|
168
|
+
// release notes. We will only show a product release note entry
|
|
169
|
+
// if there has been a substantial change, such as a fix or feature.
|
|
170
|
+
commits: splitCommits[path],
|
|
171
|
+
language: 'JAVA',
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
updates.push({
|
|
176
|
+
path: 'changelog.json',
|
|
177
|
+
createIfMissing: false,
|
|
178
|
+
updater: new composite_1.CompositeUpdater(...changelogUpdates),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return updates;
|
|
183
|
+
}
|
|
184
|
+
async getArtifactMap(path) {
|
|
185
|
+
try {
|
|
186
|
+
const content = await this.github.getFileContentsOnBranch(path, this.targetBranch);
|
|
187
|
+
return JSON.parse(content.parsedContent);
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async updateVersionsMap(versionsMap, conventionalCommits) {
|
|
194
|
+
let isPromotion = false;
|
|
195
|
+
const modifiedCommits = [];
|
|
196
|
+
for (const commit of conventionalCommits) {
|
|
197
|
+
if (isPromotionCommit(commit)) {
|
|
198
|
+
isPromotion = true;
|
|
199
|
+
modifiedCommits.push({
|
|
200
|
+
...commit,
|
|
201
|
+
notes: commit.notes.filter(note => !isPromotionNote(note)),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
modifiedCommits.push(commit);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
for (const versionKey of versionsMap.keys()) {
|
|
209
|
+
const version = versionsMap.get(versionKey);
|
|
210
|
+
if (!version) {
|
|
211
|
+
this.logger.warn(`didn't find version for ${versionKey}`);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (isPromotion && isStableArtifact(versionKey)) {
|
|
215
|
+
versionsMap.set(versionKey, version_1.Version.parse('1.0.0'));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const newVersion = await this.versioningStrategy.bump(version, modifiedCommits);
|
|
219
|
+
versionsMap.set(versionKey, newVersion);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return versionsMap;
|
|
223
|
+
}
|
|
224
|
+
initialReleaseVersion() {
|
|
225
|
+
return version_1.Version.parse('0.1.0');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.JavaYoshiMonoRepo = JavaYoshiMonoRepo;
|
|
229
|
+
const VERSIONED_ARTIFACT_REGEX = /^.*-(v\d+[^-]*)$/;
|
|
230
|
+
const VERSION_REGEX = /^v\d+(.*)$/;
|
|
231
|
+
/**
|
|
232
|
+
* Returns true if the artifact should be considered stable
|
|
233
|
+
* @param artifact name of the artifact to check
|
|
234
|
+
*/
|
|
235
|
+
function isStableArtifact(artifact) {
|
|
236
|
+
const match = artifact.match(VERSIONED_ARTIFACT_REGEX);
|
|
237
|
+
if (!match) {
|
|
238
|
+
// The artifact does not have a version qualifier at the end
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
const versionMatch = match[1].match(VERSION_REGEX);
|
|
242
|
+
if (versionMatch && versionMatch[1]) {
|
|
243
|
+
// The version is not stable (probably alpha/beta/rc)
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
function isPromotionCommit(commit) {
|
|
249
|
+
return commit.notes.some(isPromotionNote);
|
|
250
|
+
}
|
|
251
|
+
function isPromotionNote(note) {
|
|
252
|
+
return note.title === 'RELEASE AS' && note.text === '1.0.0';
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=java-yoshi-mono-repo.js.map
|
|
@@ -93,6 +93,7 @@ class Java extends base_1.BaseStrategy {
|
|
|
93
93
|
versionsMap,
|
|
94
94
|
changelogEntry: notes,
|
|
95
95
|
isSnapshot: true,
|
|
96
|
+
commits: [],
|
|
96
97
|
});
|
|
97
98
|
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...(await this.extraFileUpdates(newVersion, versionsMap))));
|
|
98
99
|
return {
|
|
@@ -110,6 +110,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
110
110
|
newVersion,
|
|
111
111
|
versionsMap,
|
|
112
112
|
latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
|
|
113
|
+
commits: conventionalCommits, // TODO(@bcoe): these commits will need to be divided into multiple changelog.json updates.
|
|
113
114
|
});
|
|
114
115
|
for (const directory in directoryVersionContents) {
|
|
115
116
|
const componentInfo = directoryVersionContents[directory];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConventionalCommit } from '../commit';
|
|
2
|
+
import { Logger } from '../util/logger';
|
|
3
|
+
import { DefaultUpdater, UpdateOptions } from './default';
|
|
4
|
+
interface ChangelogJsonOptions extends UpdateOptions {
|
|
5
|
+
artifactName: string;
|
|
6
|
+
language: string;
|
|
7
|
+
commits: ConventionalCommit[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Maintians a machine readable CHANGELOG in chnagelog.json.
|
|
11
|
+
* See: https://gist.github.com/bcoe/50ef0a0024bbf107cd5bc0adbdc04758
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChangelogJson extends DefaultUpdater {
|
|
14
|
+
artifactName: string;
|
|
15
|
+
language: string;
|
|
16
|
+
commits: ConventionalCommit[];
|
|
17
|
+
/**
|
|
18
|
+
* Instantiate a new SamplesPackageJson updater
|
|
19
|
+
* @param options
|
|
20
|
+
*/
|
|
21
|
+
constructor(options: ChangelogJsonOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Given initial file contents, return updated contents.
|
|
24
|
+
* @param {string} content The initial content
|
|
25
|
+
* @returns {string} The updated content
|
|
26
|
+
*/
|
|
27
|
+
updateContent(content: string, logger?: Logger): string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 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.ChangelogJson = void 0;
|
|
17
|
+
const logger_1 = require("../util/logger");
|
|
18
|
+
const default_1 = require("./default");
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
20
|
+
const BREAKING_CHANGE_TITLE = 'BREAKING CHANGE';
|
|
21
|
+
const COMMIT_PREFIX = /^[^:]+: ?/;
|
|
22
|
+
/**
|
|
23
|
+
* Maintians a machine readable CHANGELOG in chnagelog.json.
|
|
24
|
+
* See: https://gist.github.com/bcoe/50ef0a0024bbf107cd5bc0adbdc04758
|
|
25
|
+
*/
|
|
26
|
+
class ChangelogJson extends default_1.DefaultUpdater {
|
|
27
|
+
/**
|
|
28
|
+
* Instantiate a new SamplesPackageJson updater
|
|
29
|
+
* @param options
|
|
30
|
+
*/
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super(options);
|
|
33
|
+
this.language = options.language;
|
|
34
|
+
this.artifactName = options.artifactName;
|
|
35
|
+
this.commits = options.commits;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Given initial file contents, return updated contents.
|
|
39
|
+
* @param {string} content The initial content
|
|
40
|
+
* @returns {string} The updated content
|
|
41
|
+
*/
|
|
42
|
+
updateContent(content, logger = logger_1.logger) {
|
|
43
|
+
const parsed = JSON.parse(content);
|
|
44
|
+
logger.info(`adding release ${this.version} for ${this.artifactName}`);
|
|
45
|
+
const changes = [];
|
|
46
|
+
for (const commit of this.commits) {
|
|
47
|
+
// The commit.message field contains the type/scope prefix.
|
|
48
|
+
const message = commit.message.replace(COMMIT_PREFIX, '');
|
|
49
|
+
const change = {
|
|
50
|
+
type: commit.type,
|
|
51
|
+
sha: commit.sha,
|
|
52
|
+
message: message,
|
|
53
|
+
};
|
|
54
|
+
if (commit.scope)
|
|
55
|
+
change.scope = commit.scope;
|
|
56
|
+
for (const note of commit.notes) {
|
|
57
|
+
if (note.title === BREAKING_CHANGE_TITLE) {
|
|
58
|
+
change.breakingChangeNote = note.text;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
changes.push(change);
|
|
62
|
+
}
|
|
63
|
+
// If all commits were ignored, simply return the original changelog.json.
|
|
64
|
+
if (changes.length === 0) {
|
|
65
|
+
return content;
|
|
66
|
+
}
|
|
67
|
+
const time = new Date().toISOString();
|
|
68
|
+
const release = {
|
|
69
|
+
changes,
|
|
70
|
+
version: this.version.toString(),
|
|
71
|
+
language: this.language,
|
|
72
|
+
artifactName: this.artifactName,
|
|
73
|
+
id: (0, crypto_1.randomUUID)(),
|
|
74
|
+
createTime: time,
|
|
75
|
+
};
|
|
76
|
+
parsed.entries.unshift(release);
|
|
77
|
+
parsed.updateTime = time;
|
|
78
|
+
return JSON.stringify(parsed, null, 2);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.ChangelogJson = ChangelogJson;
|
|
82
|
+
//# sourceMappingURL=changelog-json.js.map
|
|
@@ -40,6 +40,9 @@ class GemfileLock extends default_1.DefaultUpdater {
|
|
|
40
40
|
* @returns {string} The updated content
|
|
41
41
|
*/
|
|
42
42
|
updateContent(content) {
|
|
43
|
+
if (!this.gemName) {
|
|
44
|
+
return content;
|
|
45
|
+
}
|
|
43
46
|
// Bundler will convert 1.0.0-alpha1 to 1.0.0.pre.alpha1, so we need to
|
|
44
47
|
// do the same here.
|
|
45
48
|
const versionString = (0, common_1.resolveRubyGemfileLockVersion)(this.version.toString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@octokit/types": "^
|
|
41
|
+
"@octokit/types": "^9.0.0",
|
|
42
42
|
"@types/chai": "^4.1.7",
|
|
43
43
|
"@types/diff": "^5.0.2",
|
|
44
44
|
"@types/iarna__toml": "^2.0.1",
|