release-please 13.0.0-candidate.2 → 13.0.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 +52 -0
- package/README.md +33 -131
- package/build/src/bin/release-please.d.ts +0 -1
- package/build/src/bin/release-please.js +24 -6
- package/build/src/changelog-notes/default.d.ts +1 -3
- package/build/src/changelog-notes/default.js +2 -3
- package/build/src/changelog-notes/github.d.ts +8 -0
- package/build/src/changelog-notes/github.js +26 -0
- package/build/src/changelog-notes.d.ts +3 -0
- package/build/src/changelog-notes.js +24 -0
- package/build/src/commit.d.ts +1 -1
- package/build/src/commit.js +14 -1
- package/build/src/factory.d.ts +13 -0
- package/build/src/factory.js +26 -1
- package/build/src/github.d.ts +48 -7
- package/build/src/github.js +73 -19
- package/build/src/manifest.d.ts +7 -3
- package/build/src/manifest.js +94 -25
- package/build/src/plugins/cargo-workspace.js +2 -2
- package/build/src/plugins/merge.js +4 -1
- package/build/src/plugins/node-workspace.js +2 -2
- package/build/src/pull-request.d.ts +8 -8
- package/build/src/release-pull-request.d.ts +6 -6
- package/build/src/strategies/base.d.ts +108 -0
- package/build/src/strategies/base.js +253 -0
- package/build/src/strategies/dart.d.ts +2 -2
- package/build/src/strategies/dart.js +2 -2
- package/build/src/strategies/elixir.d.ts +2 -2
- package/build/src/strategies/elixir.js +2 -2
- package/build/src/strategies/go-yoshi.d.ts +3 -3
- package/build/src/strategies/go-yoshi.js +10 -2
- package/build/src/strategies/go.d.ts +2 -2
- package/build/src/strategies/go.js +2 -2
- package/build/src/strategies/helm.d.ts +2 -2
- package/build/src/strategies/helm.js +2 -2
- package/build/src/strategies/java-yoshi.d.ts +5 -4
- package/build/src/strategies/java-yoshi.js +58 -2
- package/build/src/strategies/krm-blueprint.d.ts +2 -2
- package/build/src/strategies/krm-blueprint.js +3 -3
- package/build/src/strategies/node.d.ts +2 -2
- package/build/src/strategies/node.js +2 -2
- package/build/src/strategies/ocaml.d.ts +2 -2
- package/build/src/strategies/ocaml.js +2 -2
- package/build/src/strategies/php-yoshi.d.ts +3 -3
- package/build/src/strategies/php-yoshi.js +3 -2
- package/build/src/strategies/php.d.ts +3 -3
- package/build/src/strategies/php.js +2 -2
- package/build/src/strategies/python.d.ts +2 -2
- package/build/src/strategies/python.js +2 -2
- package/build/src/strategies/ruby-yoshi.d.ts +3 -3
- package/build/src/strategies/ruby-yoshi.js +7 -2
- package/build/src/strategies/ruby.d.ts +3 -3
- package/build/src/strategies/ruby.js +2 -2
- package/build/src/strategies/rust.d.ts +2 -2
- package/build/src/strategies/rust.js +2 -2
- package/build/src/strategies/simple.d.ts +2 -2
- package/build/src/strategies/simple.js +2 -2
- package/build/src/strategies/terraform-module.d.ts +2 -2
- package/build/src/strategies/terraform-module.js +2 -2
- package/build/src/strategy.d.ts +8 -70
- package/build/src/strategy.js +0 -217
- package/build/src/updaters/go/version-go.d.ts +4 -0
- package/build/src/updaters/go/version-go.js +24 -0
- package/build/src/updaters/rust/cargo-toml.js +5 -1
- package/build/src/util/branch-name.js +65 -7
- package/build/src/util/commit-split.js +3 -0
- package/build/src/util/pull-request-title.js +1 -0
- package/build/src/version.d.ts +28 -5
- package/build/src/version.js +26 -0
- package/build/src/versioning-strategies/always-bump-patch.d.ts +4 -0
- package/build/src/versioning-strategies/always-bump-patch.js +4 -0
- package/build/src/versioning-strategies/default.d.ts +31 -0
- package/build/src/versioning-strategies/default.js +31 -0
- package/build/src/versioning-strategies/dependency-manifest.d.ts +8 -0
- package/build/src/versioning-strategies/dependency-manifest.js +8 -0
- package/build/src/versioning-strategies/java-add-snapshot.d.ts +4 -0
- package/build/src/versioning-strategies/java-add-snapshot.js +6 -5
- package/build/src/versioning-strategies/java-snapshot.d.ts +4 -0
- package/build/src/versioning-strategies/java-snapshot.js +4 -1
- package/build/src/versioning-strategies/service-pack.d.ts +5 -0
- package/build/src/versioning-strategies/service-pack.js +10 -3
- package/build/src/versioning-strategy.d.ts +67 -5
- package/build/src/versioning-strategy.js +37 -10
- package/package.json +4 -4
- package/build/src/release-notes.d.ts +0 -29
- package/build/src/release-notes.js +0 -71
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,58 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [13.0.0](https://www.github.com/googleapis/release-please/compare/v12.6.0...v13.0.0) (2021-12-22)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* releasers are now "strategies", more logic moved into base classes
|
|
13
|
+
* Node 12 is now required
|
|
14
|
+
* manifest is now main entrypoint for release please, and logic is shared between mono-repo/split-repo flow
|
|
15
|
+
* versioning straregy now handled by VersionStrategies rather than regexes
|
|
16
|
+
* merge Manifest and standard PR paths (#1104)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add `includeComponentInTag` option for strategies and hook up to `--monorepo-tags` ([#1119](https://www.github.com/googleapis/release-please/issues/1119)) ([bf9aacd](https://www.github.com/googleapis/release-please/commit/bf9aacdde3a97c453f6e3280035607c97c7dffcd))
|
|
21
|
+
* add ability to override merged commit message ([#1161](https://www.github.com/googleapis/release-please/issues/1161)) ([c568b57](https://www.github.com/googleapis/release-please/commit/c568b57280f2048f6dabbb716cdb4174c3386b91)), closes [#967](https://www.github.com/googleapis/release-please/issues/967)
|
|
22
|
+
* add GitHub changelog notes generator ([#1120](https://www.github.com/googleapis/release-please/issues/1120)) ([1470661](https://www.github.com/googleapis/release-please/commit/1470661bd76a1e731585ed3fbf7363224c7a7a3e))
|
|
23
|
+
* enable specifying changelog section headings in the CLI ([#1162](https://www.github.com/googleapis/release-please/issues/1162)) ([aaa8342](https://www.github.com/googleapis/release-please/commit/aaa8342cd48062c56fe87b3296904274b7fb9dbe)), closes [#511](https://www.github.com/googleapis/release-please/issues/511)
|
|
24
|
+
* **go:** add support for bumping a Go version file ([#1112](https://www.github.com/googleapis/release-please/issues/1112)) ([8f6e52b](https://www.github.com/googleapis/release-please/commit/8f6e52b27811e6838800c7152be74e13201eb9e1))
|
|
25
|
+
* reimplement custom pull request title ([#1122](https://www.github.com/googleapis/release-please/issues/1122)) ([2f3e84c](https://www.github.com/googleapis/release-please/commit/2f3e84c8c51f367cad8baae44c8d9f0727aa02a5))
|
|
26
|
+
* reimplement Java 1.0.0 special version bumping ([#1126](https://www.github.com/googleapis/release-please/issues/1126)) ([28bc76b](https://www.github.com/googleapis/release-please/commit/28bc76b35d9e1eff218a5be1b9b8cebb4b1e6f9d))
|
|
27
|
+
* return path along with created release ([#1114](https://www.github.com/googleapis/release-please/issues/1114)) ([81fc0f4](https://www.github.com/googleapis/release-please/commit/81fc0f49d75ec66ef1915be26330734abddd11d7))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* add back version/major/minor/patch ([#1118](https://www.github.com/googleapis/release-please/issues/1118)) ([4b6ae50](https://www.github.com/googleapis/release-please/commit/4b6ae5049e39e6f5bca10b514256090ea76ef5bd))
|
|
33
|
+
* allow setting release-type at root of manifest config ([#1159](https://www.github.com/googleapis/release-please/issues/1159)) ([fc73b6d](https://www.github.com/googleapis/release-please/commit/fc73b6dd3f5f7ed449b9d304e53bada911e3190f))
|
|
34
|
+
* backfill commit files ([#1110](https://www.github.com/googleapis/release-please/issues/1110)) ([173ce70](https://www.github.com/googleapis/release-please/commit/173ce704c9413d7f0da820fdd2961166a5ff0b73))
|
|
35
|
+
* backfill latest release with version found in manifest ([#1131](https://www.github.com/googleapis/release-please/issues/1131)) ([94859a0](https://www.github.com/googleapis/release-please/commit/94859a0cfbc58724016daaefaca03f34a43e0473))
|
|
36
|
+
* **cli:** pass pull-request-title-pattern ([#1128](https://www.github.com/googleapis/release-please/issues/1128)) ([28d7727](https://www.github.com/googleapis/release-please/commit/28d7727bc827612b02a8fde58d13cd87f962a399))
|
|
37
|
+
* combined manifest PR should include labels ([#1137](https://www.github.com/googleapis/release-please/issues/1137)) ([d8bb7ca](https://www.github.com/googleapis/release-please/commit/d8bb7caddfa14aabd3bfa19008c10ed911638a66))
|
|
38
|
+
* fallback to look at releases when looking for latest release ([#1146](https://www.github.com/googleapis/release-please/issues/1146)) ([76ed1a7](https://www.github.com/googleapis/release-please/commit/76ed1a77e64f28b0af7d8125dce457b885f80e52))
|
|
39
|
+
* fallback to look at tags when looking for latest release ([#1160](https://www.github.com/googleapis/release-please/issues/1160)) ([e06c6ba](https://www.github.com/googleapis/release-please/commit/e06c6ba5c3ce29689275e495934d4a6785962d5b))
|
|
40
|
+
* GitHub#findFilesByExtension should treat prefix as a directory ([#1165](https://www.github.com/googleapis/release-please/issues/1165)) ([b48ec5b](https://www.github.com/googleapis/release-please/commit/b48ec5bc285233436d7cb1b367326a3c6dd555a9))
|
|
41
|
+
* **github:** correctly return maxResults releases ([#1134](https://www.github.com/googleapis/release-please/issues/1134)) ([25f6811](https://www.github.com/googleapis/release-please/commit/25f68113d0e0bfa5a181d616c11bfd5e573cfaf5))
|
|
42
|
+
* make PullRequest, ReleasePullRequest, Version fields readonly ([#1150](https://www.github.com/googleapis/release-please/issues/1150)) ([9659c1c](https://www.github.com/googleapis/release-please/commit/9659c1c868395394a40ff8f6caf9aaa7998fb8b8))
|
|
43
|
+
* Manifest.fromConfig can find latest release version without component ([#1123](https://www.github.com/googleapis/release-please/issues/1123)) ([0aeb67b](https://www.github.com/googleapis/release-please/commit/0aeb67b4c4a497b5570bdec10f5ab15e620b235d))
|
|
44
|
+
* merge manifest release PRs unless separatePullRequests is configured ([#1129](https://www.github.com/googleapis/release-please/issues/1129)) ([328009d](https://www.github.com/googleapis/release-please/commit/328009d10b4609441a6f8432fa0d2aa9df1f5ff0))
|
|
45
|
+
* only backfill files if requested ([#1151](https://www.github.com/googleapis/release-please/issues/1151)) ([ae007fe](https://www.github.com/googleapis/release-please/commit/ae007feb430e97f2995d6fd431f2825512651e3a))
|
|
46
|
+
* reimplement draft releases ([#1111](https://www.github.com/googleapis/release-please/issues/1111)) ([6f38b4a](https://www.github.com/googleapis/release-please/commit/6f38b4aa5a206b358468e623a020ef715257ddfe))
|
|
47
|
+
* **rust:** Don't update dev-dependencies lacking a version key ([#1095](https://www.github.com/googleapis/release-please/issues/1095)) ([#1152](https://www.github.com/googleapis/release-please/issues/1152)) ([56f37d9](https://www.github.com/googleapis/release-please/commit/56f37d997c75ec5bcc330b08b0e9e25c68329b7a)), closes [#1094](https://www.github.com/googleapis/release-please/issues/1094)
|
|
48
|
+
* switch branch delimiter to `--` ([#1127](https://www.github.com/googleapis/release-please/issues/1127)) ([26442f1](https://www.github.com/googleapis/release-please/commit/26442f14356c387c9117f5d660b532185c8084c4))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Code Refactoring
|
|
52
|
+
|
|
53
|
+
* manifest is now main entrypoint for release please, and logic is shared between mono-repo/split-repo flow ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
|
|
54
|
+
* merge Manifest and standard PR paths ([#1104](https://www.github.com/googleapis/release-please/issues/1104)) ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
|
|
55
|
+
* Node 12 is now required ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
|
|
56
|
+
* releasers are now "strategies", more logic moved into base classes ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
|
|
57
|
+
* versioning straregy now handled by VersionStrategies rather than regexes ([fd8f9fc](https://www.github.com/googleapis/release-please/commit/fd8f9fc82838f3a3a05470dfe4dab4d3b47c6fa1))
|
|
58
|
+
|
|
7
59
|
## [12.6.0](https://www.github.com/googleapis/release-please/compare/v12.5.0...v12.6.0) (2021-10-11)
|
|
8
60
|
|
|
9
61
|
|
package/README.md
CHANGED
|
@@ -75,6 +75,8 @@ The above commit message will contain:
|
|
|
75
75
|
that it's a breaking change.
|
|
76
76
|
3. an entry for the feature **"update encode to support unicode"**.
|
|
77
77
|
|
|
78
|
+
> :warning: **Important:** The additional messages must be added to the bottom of the commit.
|
|
79
|
+
|
|
78
80
|
## How do I change the version number?
|
|
79
81
|
|
|
80
82
|
When a commit to the main branch has `Release-As: x.x.x`(case insensitive) in the **commit body**, Release Please will open a new pull request for the specified version.
|
|
@@ -89,31 +91,25 @@ chore: release 2.0.0
|
|
|
89
91
|
Release-As: 2.0.0
|
|
90
92
|
```
|
|
91
93
|
|
|
92
|
-
##
|
|
94
|
+
## Strategy (Language) types supported
|
|
93
95
|
|
|
94
96
|
Release Please automates releases for the following flavors of repositories:
|
|
95
97
|
|
|
96
98
|
| release type | description
|
|
97
99
|
|-------------------|---------------------------------------------------------|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
To add a new release type, simply use the existing [releasers](https://github.com/googleapis/release-please/tree/main/src/releasers) and [updaters](https://github.com/googleapis/release-please/tree/main/src/updaters)
|
|
112
|
-
as a starting point.
|
|
113
|
-
|
|
114
|
-
**releasers** describe the files that should be updated for a release.
|
|
115
|
-
|
|
116
|
-
**updaters** describe how to update the version in these files.
|
|
100
|
+
| `dart` | A repository with a pubspec.yaml and a CHANGELOG.md |
|
|
101
|
+
| `elixir` | A repository with a mix.exs and a CHANGELOG.md |
|
|
102
|
+
| `go` | A repository with a CHANGELOG.md |
|
|
103
|
+
| `helm` | A repository with a Chart.yaml and a CHANGELOG.md |
|
|
104
|
+
| `krm-blueprint` | [A kpt package, with 1 or more KRM files and a CHANGELOG.md](https://github.com/GoogleCloudPlatform/blueprints/tree/main/catalog/project) |
|
|
105
|
+
| `node` | [A Node.js repository, with a package.json and CHANGELOG.md](https://github.com/yargs/yargs) |
|
|
106
|
+
| `ocaml` | [An OCaml repository, containing 1 or more opam or esy files and a CHANGELOG.md](https://github.com/grain-lang/binaryen.ml) |
|
|
107
|
+
| `php` | A repository with a composer.json and a CHANGELOG.md |
|
|
108
|
+
| `python` | [A Python repository, with a setup.py, setup.cfg, CHANGELOG.md](https://github.com/googleapis/python-storage) and optionally a pyproject.toml and a <project>/\_\_init\_\_.py |
|
|
109
|
+
| `ruby` | A repository with a version.rb and a CHANGELOG.md |
|
|
110
|
+
| `rust` | A Rust repository, with a Cargo.toml (either as a crate or workspace) and a CHANGELOG.md |
|
|
111
|
+
| `simple` | [A repository with a version.txt and a CHANGELOG.md](https://github.com/googleapis/gapic-generator) |
|
|
112
|
+
| `terraform-module` | [A terraform module, with a version in the README.md, and a CHANGELOG.md](https://github.com/terraform-google-modules/terraform-google-project-factory) |
|
|
117
113
|
|
|
118
114
|
## Setting up Release Please
|
|
119
115
|
|
|
@@ -121,128 +117,34 @@ There are a variety of ways you can deploy release-please:
|
|
|
121
117
|
|
|
122
118
|
### GitHub Action (recommended)
|
|
123
119
|
|
|
124
|
-
The easiest way to run release please is as a GitHub action
|
|
125
|
-
|
|
126
|
-
1. If you haven't already done so, create a `.github/workflows` folder in your
|
|
127
|
-
repository (_this is where your actions will live_).
|
|
128
|
-
2. Now create a `.github/workflows/release-please.yml` file with these contents:
|
|
129
|
-
|
|
130
|
-
```yaml
|
|
131
|
-
on:
|
|
132
|
-
push:
|
|
133
|
-
branches:
|
|
134
|
-
- main
|
|
135
|
-
name: release-please
|
|
136
|
-
jobs:
|
|
137
|
-
release-please:
|
|
138
|
-
runs-on: ubuntu-latest
|
|
139
|
-
steps:
|
|
140
|
-
- uses: GoogleCloudPlatform/release-please-action@v2
|
|
141
|
-
with:
|
|
142
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
143
|
-
release-type: node
|
|
144
|
-
package-name: release-please-action
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
3. Merge the above action into your repository and make sure new commits follow
|
|
148
|
-
the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
149
|
-
convention, [release-please](https://github.com/googleapis/release-please)
|
|
150
|
-
will start creating Release PRs for you.
|
|
151
|
-
|
|
152
|
-
#### Automating publication to npm
|
|
153
|
-
|
|
154
|
-
With a few additions, the Release Please action can be made to publish to
|
|
155
|
-
npm when a Release PR is merged:
|
|
156
|
-
|
|
157
|
-
```yaml
|
|
158
|
-
on:
|
|
159
|
-
push:
|
|
160
|
-
branches:
|
|
161
|
-
- main
|
|
162
|
-
name: release-please
|
|
163
|
-
jobs:
|
|
164
|
-
release-please:
|
|
165
|
-
runs-on: ubuntu-latest
|
|
166
|
-
steps:
|
|
167
|
-
- uses: GoogleCloudPlatform/release-please-action@v2
|
|
168
|
-
id: release
|
|
169
|
-
with:
|
|
170
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
171
|
-
release-type: node
|
|
172
|
-
package-name: test-release-please
|
|
173
|
-
# The logic below handles the npm publication:
|
|
174
|
-
- uses: actions/checkout@v2
|
|
175
|
-
# these if statements ensure that a publication only occurs when
|
|
176
|
-
# a new release is created:
|
|
177
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
178
|
-
- uses: actions/setup-node@v1
|
|
179
|
-
with:
|
|
180
|
-
node-version: 12
|
|
181
|
-
registry-url: 'https://registry.npmjs.org'
|
|
182
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
183
|
-
# if you are using Yarn, substitute the command below with `yarn install --frozen-lockfile`
|
|
184
|
-
- run: npm ci
|
|
185
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
186
|
-
- run: npm publish
|
|
187
|
-
env:
|
|
188
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
189
|
-
if: ${{ steps.release.outputs.release_created }}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
> So that you can keep 2FA enabled for npm publications, we recommend setting
|
|
193
|
-
`registry-url` to your own [Wombat Dressing Room](https://github.com/GoogleCloudPlatform/wombat-dressing-room) deployment.
|
|
120
|
+
The easiest way to run release please is as a GitHub action. Please see [google-github-actions/release-please-action](https://github.com/google-github-actions/release-please-action) for installation and configuration instructions.
|
|
194
121
|
|
|
195
122
|
### Running as CLI
|
|
196
123
|
|
|
197
|
-
|
|
124
|
+
Please see [Running release-please CLI](docs/cli.md) for all the configuration options.
|
|
198
125
|
|
|
199
|
-
|
|
200
|
-
npm i release-please -g
|
|
201
|
-
```
|
|
126
|
+
### Install the GitHub App
|
|
202
127
|
|
|
203
|
-
|
|
128
|
+
There is a probot application available, which allows you to deploy Release
|
|
129
|
+
Please as a GitHub App. Please see
|
|
130
|
+
[github.com/googleapis/repo-automation-bots](https://github.com/googleapis/repo-automation-bots/tree/main/packages/release-please)
|
|
131
|
+
for installation and configuration instructions.
|
|
204
132
|
|
|
205
|
-
|
|
206
|
-
release-please release-pr --package-name=@google-cloud/firestore" \
|
|
207
|
-
--repo-url=googleapis/nodejs-firestore \
|
|
208
|
-
--token=$GITHUB_TOKEN
|
|
209
|
-
```
|
|
133
|
+
## Bootstrapping your Repository
|
|
210
134
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
| `--repo-url` | is the URL of the repository on GitHub. |
|
|
215
|
-
| `--token` | a token with write access to `--repo-url`. |
|
|
216
|
-
| `--default-branch`| branch to open pull release PR against (detected by default). |
|
|
217
|
-
| `--path` | create a release from a path other than the repository's root |
|
|
218
|
-
| `--monorepo-tags` | add prefix to tags and branches, allowing multiple libraries to be released from the same repository. |
|
|
219
|
-
| `--pull-request-title-pattern` | add title pattern to make release PR, defaults to using `chore${scope}: release${component} ${version}`. |
|
|
220
|
-
| `--signoff` | Add [`Signed-off-by`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) line at the end of the commit log message using the user and email provided. (format "Name \<email@example.com\>") |
|
|
221
|
-
| `--api-url` | URL to use when making API requests [default: "https://api.github.com"] |
|
|
222
|
-
| `--graphql-url` | URL to use when making GraphQL requests [default: "https://api.github.com"] |
|
|
223
|
-
|
|
224
|
-
### Creating a release on GitHub
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
release-please github-release --repo-url=googleapis/nodejs-firestore \
|
|
228
|
-
--token=$GITHUB_TOKEN
|
|
229
|
-
```
|
|
135
|
+
Release Please looks at commits since your last release tag. It may or may not be able to find
|
|
136
|
+
your previous releases. The easiest way to on-board your repository is to
|
|
137
|
+
[bootstrap a manifest config](/docs/cli.md#bootstrapping).
|
|
230
138
|
|
|
231
|
-
|
|
232
|
-
|-------------------|---------------------------------------------------------|
|
|
233
|
-
| `--package-name` | is the name of the package to publish to publish to an upstream registry such as npm. |
|
|
234
|
-
| `--repo-url` | is the URL of the repository on GitHub. |
|
|
235
|
-
| `--token` | a token with write access to `--repo-url`. |
|
|
236
|
-
| `--path` | create a release from a path other than the repository's root |
|
|
237
|
-
| `--api-url` | URL to use when making API requests [default: "https://api.github.com"] |
|
|
238
|
-
| `--graphql-url` | URL to use when making GraphQL requests [default: "https://api.github.com"] |
|
|
139
|
+
## Customizing Release Please
|
|
239
140
|
|
|
240
|
-
|
|
141
|
+
Release Please provides several configuration options to allow customizing
|
|
142
|
+
your release process. Please see [customizing.md](docs/customizing.md) for more details.
|
|
241
143
|
|
|
242
|
-
|
|
243
|
-
Please as a GitHub App:
|
|
144
|
+
## Supporting Monorepos via Manifest Configuration
|
|
244
145
|
|
|
245
|
-
|
|
146
|
+
Release Please also supports releasing multiple artifacts from the same repository.
|
|
147
|
+
See more at [manifest-releaser.md](docs/manifest-releaser.md).
|
|
246
148
|
|
|
247
149
|
## Supported Node.js Versions
|
|
248
150
|
|
|
@@ -53,7 +53,6 @@ interface PullRequestStrategyArgs {
|
|
|
53
53
|
changelogPath?: string;
|
|
54
54
|
versioningStrategy?: VersioningStrategyType;
|
|
55
55
|
versionFile?: string;
|
|
56
|
-
pullRequestTitlePattern?: string;
|
|
57
56
|
extraFiles?: string[];
|
|
58
57
|
}
|
|
59
58
|
interface BootstrapArgs extends GitHubArgs, ManifestArgs, ManifestConfigArgs, VersioningArgs, PullRequestArgs, PullRequestStrategyArgs, ReleaseArgs {
|
|
@@ -19,6 +19,7 @@ const coerce_option_1 = require("../util/coerce-option");
|
|
|
19
19
|
const yargs = require("yargs");
|
|
20
20
|
const github_1 = require("../github");
|
|
21
21
|
const manifest_1 = require("../manifest");
|
|
22
|
+
const changelog_notes_1 = require("../changelog-notes");
|
|
22
23
|
const logger_1 = require("../util/logger");
|
|
23
24
|
const factory_1 = require("../factory");
|
|
24
25
|
const bootstrapper_1 = require("../bootstrapper");
|
|
@@ -148,15 +149,25 @@ function pullRequestStrategyOptions(yargs) {
|
|
|
148
149
|
describe: 'strategy used for bumping versions',
|
|
149
150
|
choices: factory_1.getVersioningStrategyTypes(),
|
|
150
151
|
default: 'default',
|
|
151
|
-
})
|
|
152
|
-
.option('pull-request-title-pattern', {
|
|
153
|
-
describe: 'Title pattern to make release PR',
|
|
154
|
-
type: 'string',
|
|
155
152
|
})
|
|
156
153
|
.option('changelog-path', {
|
|
157
154
|
default: 'CHANGELOG.md',
|
|
158
155
|
describe: 'where can the CHANGELOG be found in the project?',
|
|
159
156
|
type: 'string',
|
|
157
|
+
})
|
|
158
|
+
.option('changelog-type', {
|
|
159
|
+
describe: 'type of changelog to build',
|
|
160
|
+
choices: factory_1.getChangelogTypes(),
|
|
161
|
+
})
|
|
162
|
+
.option('changelog-sections', {
|
|
163
|
+
describe: 'comma-separated list of scopes to include in the changelog',
|
|
164
|
+
type: 'string',
|
|
165
|
+
coerce: (arg) => {
|
|
166
|
+
if (arg) {
|
|
167
|
+
return changelog_notes_1.buildChangelogSections(arg.split(','));
|
|
168
|
+
}
|
|
169
|
+
return arg;
|
|
170
|
+
},
|
|
160
171
|
})
|
|
161
172
|
.option('last-package-version', {
|
|
162
173
|
describe: 'last version # that package was released as',
|
|
@@ -220,10 +231,15 @@ function manifestOptions(yargs) {
|
|
|
220
231
|
});
|
|
221
232
|
}
|
|
222
233
|
function taggingOptions(yargs) {
|
|
223
|
-
return yargs
|
|
234
|
+
return yargs
|
|
235
|
+
.option('monorepo-tags', {
|
|
224
236
|
describe: 'include library name in tags and release branches',
|
|
225
237
|
type: 'boolean',
|
|
226
238
|
default: false,
|
|
239
|
+
})
|
|
240
|
+
.option('pull-request-title-pattern', {
|
|
241
|
+
describe: 'Title pattern to make release PR',
|
|
242
|
+
type: 'string',
|
|
227
243
|
});
|
|
228
244
|
}
|
|
229
245
|
const createReleasePullRequestCommand = {
|
|
@@ -245,6 +261,8 @@ const createReleasePullRequestCommand = {
|
|
|
245
261
|
bumpMinorPreMajor: argv.bumpMinorPreMajor,
|
|
246
262
|
bumpPatchForMinorPreMajor: argv.bumpPatchForMinorPreMajor,
|
|
247
263
|
changelogPath: argv.changelogPath,
|
|
264
|
+
changelogType: argv.changelogType,
|
|
265
|
+
pullRequestTitlePattern: argv.pullRequestTitlePattern,
|
|
248
266
|
changelogSections: argv.changelogSections,
|
|
249
267
|
releaseAs: argv.releaseAs,
|
|
250
268
|
versioning: argv.versioningStrategy,
|
|
@@ -382,7 +400,7 @@ const bootstrapCommand = {
|
|
|
382
400
|
command: 'bootstrap',
|
|
383
401
|
describe: 'configure release manifest',
|
|
384
402
|
builder(yargs) {
|
|
385
|
-
return manifestOptions(releaseOptions(pullRequestStrategyOptions(gitHubOptions(yargs))))
|
|
403
|
+
return manifestConfigOptions(manifestOptions(releaseOptions(pullRequestStrategyOptions(gitHubOptions(yargs)))))
|
|
386
404
|
.option('initial-version', {
|
|
387
405
|
description: 'current version',
|
|
388
406
|
})
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChangelogNotes, BuildNotesOptions } from '../changelog-notes';
|
|
2
2
|
import { ConventionalCommit } from '../commit';
|
|
3
3
|
interface DefaultChangelogNotesOptions {
|
|
4
|
-
changelogSections?: ChangelogSection[];
|
|
5
4
|
commitPartial?: string;
|
|
6
5
|
headerPartial?: string;
|
|
7
6
|
mainTemplate?: string;
|
|
8
7
|
}
|
|
9
8
|
export declare class DefaultChangelogNotes implements ChangelogNotes {
|
|
10
|
-
private changelogSections?;
|
|
11
9
|
private commitPartial?;
|
|
12
10
|
private headerPartial?;
|
|
13
11
|
private mainTemplate?;
|
|
@@ -21,7 +21,6 @@ const presetFactory = require('conventional-changelog-conventionalcommits');
|
|
|
21
21
|
const DEFAULT_HOST = 'https://github.com';
|
|
22
22
|
class DefaultChangelogNotes {
|
|
23
23
|
constructor(options = {}) {
|
|
24
|
-
this.changelogSections = options.changelogSections;
|
|
25
24
|
this.commitPartial = options.commitPartial;
|
|
26
25
|
this.headerPartial = options.headerPartial;
|
|
27
26
|
this.mainTemplate = options.mainTemplate;
|
|
@@ -37,8 +36,8 @@ class DefaultChangelogNotes {
|
|
|
37
36
|
linkCompare: !!options.previousTag,
|
|
38
37
|
};
|
|
39
38
|
const config = {};
|
|
40
|
-
if (
|
|
41
|
-
config.types =
|
|
39
|
+
if (options.changelogSections) {
|
|
40
|
+
config.types = options.changelogSections;
|
|
42
41
|
}
|
|
43
42
|
const preset = await presetFactory(config);
|
|
44
43
|
preset.writerOpts.commitPartial =
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChangelogNotes, BuildNotesOptions } from '../changelog-notes';
|
|
2
|
+
import { ConventionalCommit } from '../commit';
|
|
3
|
+
import { GitHub } from '../github';
|
|
4
|
+
export declare class GitHubChangelogNotes implements ChangelogNotes {
|
|
5
|
+
private github;
|
|
6
|
+
constructor(github: GitHub);
|
|
7
|
+
buildNotes(_commits: ConventionalCommit[], options: BuildNotesOptions): Promise<string>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2021 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.GitHubChangelogNotes = void 0;
|
|
17
|
+
class GitHubChangelogNotes {
|
|
18
|
+
constructor(github) {
|
|
19
|
+
this.github = github;
|
|
20
|
+
}
|
|
21
|
+
async buildNotes(_commits, options) {
|
|
22
|
+
return await this.github.generateReleaseNotes(options.currentTag, options.targetBranch, options.previousTag);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GitHubChangelogNotes = GitHubChangelogNotes;
|
|
26
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -6,6 +6,8 @@ export interface BuildNotesOptions {
|
|
|
6
6
|
version: string;
|
|
7
7
|
previousTag?: string;
|
|
8
8
|
currentTag: string;
|
|
9
|
+
targetBranch: string;
|
|
10
|
+
changelogSections?: ChangelogSection[];
|
|
9
11
|
}
|
|
10
12
|
export interface ChangelogNotes {
|
|
11
13
|
buildNotes(commits: ConventionalCommit[], options: BuildNotesOptions): Promise<string>;
|
|
@@ -15,3 +17,4 @@ export interface ChangelogSection {
|
|
|
15
17
|
section: string;
|
|
16
18
|
hidden?: boolean;
|
|
17
19
|
}
|
|
20
|
+
export declare function buildChangelogSections(scopes: string[]): ChangelogSection[];
|
|
@@ -13,4 +13,28 @@
|
|
|
13
13
|
// See the License for the specific language governing permissions and
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.buildChangelogSections = void 0;
|
|
17
|
+
const DEFAULT_HEADINGS = {
|
|
18
|
+
feat: 'Features',
|
|
19
|
+
fix: 'Bug Fixes',
|
|
20
|
+
perf: 'Performance Improvements',
|
|
21
|
+
deps: 'Dependencies',
|
|
22
|
+
revert: 'Reverts',
|
|
23
|
+
docs: 'Documentation',
|
|
24
|
+
style: 'Styles',
|
|
25
|
+
chore: 'Miscellaneous Chores',
|
|
26
|
+
refactor: 'Code Refactoring',
|
|
27
|
+
test: 'Tests',
|
|
28
|
+
build: 'Build System',
|
|
29
|
+
ci: 'Continuous Integration',
|
|
30
|
+
};
|
|
31
|
+
function buildChangelogSections(scopes) {
|
|
32
|
+
return scopes.map(scope => {
|
|
33
|
+
return {
|
|
34
|
+
type: scope,
|
|
35
|
+
section: DEFAULT_HEADINGS[scope] || scope,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.buildChangelogSections = buildChangelogSections;
|
|
16
40
|
//# sourceMappingURL=changelog-notes.js.map
|
package/build/src/commit.d.ts
CHANGED
package/build/src/commit.js
CHANGED
|
@@ -288,8 +288,9 @@ function parseCommits(message) {
|
|
|
288
288
|
function parseConventionalCommits(commits) {
|
|
289
289
|
const conventionalCommits = [];
|
|
290
290
|
for (const commit of commits) {
|
|
291
|
+
const commitMessage = preprocessCommitMessage(commit);
|
|
291
292
|
try {
|
|
292
|
-
for (const parsedCommit of parseCommits(
|
|
293
|
+
for (const parsedCommit of parseCommits(commitMessage)) {
|
|
293
294
|
const breaking = parsedCommit.notes.filter(note => note.title === 'BREAKING CHANGE')
|
|
294
295
|
.length > 0;
|
|
295
296
|
conventionalCommits.push({
|
|
@@ -313,4 +314,16 @@ function parseConventionalCommits(commits) {
|
|
|
313
314
|
return conventionalCommits;
|
|
314
315
|
}
|
|
315
316
|
exports.parseConventionalCommits = parseConventionalCommits;
|
|
317
|
+
function preprocessCommitMessage(commit) {
|
|
318
|
+
// look for 'BEGIN_COMMIT_OVERRIDE' section of pull request body
|
|
319
|
+
if (commit.pullRequest) {
|
|
320
|
+
const overrideMessage = (commit.pullRequest.body.split('BEGIN_COMMIT_OVERRIDE')[1] || '')
|
|
321
|
+
.split('END_COMMIT_OVERRIDE')[0]
|
|
322
|
+
.trim();
|
|
323
|
+
if (overrideMessage) {
|
|
324
|
+
return overrideMessage;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return commit.message;
|
|
328
|
+
}
|
|
316
329
|
//# sourceMappingURL=commit.js.map
|
package/build/src/factory.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ import { Strategy } from './strategy';
|
|
|
2
2
|
import { GitHub } from './github';
|
|
3
3
|
import { ReleaserConfig, PluginType, RepositoryConfig } from './manifest';
|
|
4
4
|
import { ManifestPlugin } from './plugin';
|
|
5
|
+
import { ChangelogNotes, ChangelogSection } from './changelog-notes';
|
|
5
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
7
|
export declare type ReleaseType = typeof allReleaseTypes[number];
|
|
7
8
|
export declare function getReleaserTypes(): readonly ReleaseType[];
|
|
8
9
|
export declare function getVersioningStrategyTypes(): readonly VersioningStrategyType[];
|
|
10
|
+
export declare function getChangelogTypes(): readonly ChangelogNotesType[];
|
|
9
11
|
export interface StrategyFactoryOptions extends ReleaserConfig {
|
|
10
12
|
github: GitHub;
|
|
11
13
|
path?: string;
|
|
@@ -23,4 +25,15 @@ interface PluginFactoryOptions {
|
|
|
23
25
|
updateAllPackages?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export declare function buildPlugin(options: PluginFactoryOptions): ManifestPlugin;
|
|
28
|
+
declare const allChangelogNotesTypes: readonly ["default", "github"];
|
|
29
|
+
export declare type ChangelogNotesType = typeof allChangelogNotesTypes[number];
|
|
30
|
+
interface ChangelogNotesFactoryOptions {
|
|
31
|
+
type: ChangelogNotesType;
|
|
32
|
+
github: GitHub;
|
|
33
|
+
changelogSections?: ChangelogSection[];
|
|
34
|
+
commitPartial?: string;
|
|
35
|
+
headerPartial?: string;
|
|
36
|
+
mainTemplate?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function buildChangelogNotes(options: ChangelogNotesFactoryOptions): ChangelogNotes;
|
|
26
39
|
export {};
|
package/build/src/factory.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// See the License for the specific language governing permissions and
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.buildPlugin = exports.buildStrategy = exports.getVersioningStrategyTypes = exports.getReleaserTypes = void 0;
|
|
16
|
+
exports.buildChangelogNotes = exports.buildPlugin = exports.buildStrategy = exports.getChangelogTypes = exports.getVersioningStrategyTypes = exports.getReleaserTypes = void 0;
|
|
17
17
|
const go_1 = require("./strategies/go");
|
|
18
18
|
const go_yoshi_1 = require("./strategies/go-yoshi");
|
|
19
19
|
const java_yoshi_1 = require("./strategies/java-yoshi");
|
|
@@ -37,6 +37,8 @@ const service_pack_1 = require("./versioning-strategies/service-pack");
|
|
|
37
37
|
const dependency_manifest_1 = require("./versioning-strategies/dependency-manifest");
|
|
38
38
|
const node_workspace_1 = require("./plugins/node-workspace");
|
|
39
39
|
const cargo_workspace_1 = require("./plugins/cargo-workspace");
|
|
40
|
+
const github_1 = require("./changelog-notes/github");
|
|
41
|
+
const default_2 = require("./changelog-notes/default");
|
|
40
42
|
// Factory shared by GitHub Action and CLI for creating Release PRs
|
|
41
43
|
// and GitHub Releases:
|
|
42
44
|
// add any new releasers you create to this type as well as the `releasers`
|
|
@@ -87,6 +89,10 @@ function getVersioningStrategyTypes() {
|
|
|
87
89
|
return allVersioningTypes;
|
|
88
90
|
}
|
|
89
91
|
exports.getVersioningStrategyTypes = getVersioningStrategyTypes;
|
|
92
|
+
function getChangelogTypes() {
|
|
93
|
+
return allChangelogNotesTypes;
|
|
94
|
+
}
|
|
95
|
+
exports.getChangelogTypes = getChangelogTypes;
|
|
90
96
|
async function buildStrategy(options) {
|
|
91
97
|
var _a;
|
|
92
98
|
const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
|
|
@@ -95,6 +101,11 @@ async function buildStrategy(options) {
|
|
|
95
101
|
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
96
102
|
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
97
103
|
});
|
|
104
|
+
const changelogNotes = buildChangelogNotes({
|
|
105
|
+
type: options.changelogType || 'default',
|
|
106
|
+
github: options.github,
|
|
107
|
+
changelogSections: options.changelogSections,
|
|
108
|
+
});
|
|
98
109
|
const strategyOptions = {
|
|
99
110
|
github: options.github,
|
|
100
111
|
targetBranch,
|
|
@@ -109,6 +120,8 @@ async function buildStrategy(options) {
|
|
|
109
120
|
skipGitHubRelease: options.skipGithubRelease,
|
|
110
121
|
releaseAs: options.releaseAs,
|
|
111
122
|
includeComponentInTag: options.includeComponentInTag,
|
|
123
|
+
changelogNotes,
|
|
124
|
+
pullRequestTitlePattern: options.pullRequestTitlePattern,
|
|
112
125
|
};
|
|
113
126
|
switch (options.releaseType) {
|
|
114
127
|
case 'ruby': {
|
|
@@ -189,4 +202,16 @@ function buildPlugin(options) {
|
|
|
189
202
|
}
|
|
190
203
|
}
|
|
191
204
|
exports.buildPlugin = buildPlugin;
|
|
205
|
+
const allChangelogNotesTypes = ['default', 'github'];
|
|
206
|
+
function buildChangelogNotes(options) {
|
|
207
|
+
switch (options.type) {
|
|
208
|
+
case 'github':
|
|
209
|
+
return new github_1.GitHubChangelogNotes(options.github);
|
|
210
|
+
case 'default':
|
|
211
|
+
return new default_2.DefaultChangelogNotes(options);
|
|
212
|
+
default:
|
|
213
|
+
throw new Error(`Unknown changelog type: ${options.type}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
exports.buildChangelogNotes = buildChangelogNotes;
|
|
192
217
|
//# sourceMappingURL=factory.js.map
|