toys-release 0.1.1 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +4 -4
- data/docs/guide.md +826 -1
- data/lib/toys/release/version.rb +1 -1
- data/toys/.data/templates/release-request.yml.erb +1 -1
- data/toys/.lib/toys/release/artifact_dir.rb +21 -1
- data/toys/.lib/toys/release/change_set.rb +8 -8
- data/toys/.lib/toys/release/component.rb +24 -85
- data/toys/.lib/toys/release/environment_utils.rb +29 -6
- data/toys/.lib/toys/release/performer.rb +48 -43
- data/toys/.lib/toys/release/pipeline.rb +577 -0
- data/toys/.lib/toys/release/pull_request.rb +0 -2
- data/toys/.lib/toys/release/repo_settings.rb +494 -332
- data/toys/.lib/toys/release/repository.rb +7 -8
- data/toys/.lib/toys/release/request_spec.rb +1 -1
- data/toys/.lib/toys/release/steps.rb +295 -441
- data/toys/.toys.rb +2 -2
- data/toys/_onclosed.rb +9 -1
- data/toys/gen-config.rb +137 -0
- data/toys/gen-workflows.rb +23 -6
- data/toys/perform.rb +7 -5
- data/toys/retry.rb +20 -14
- metadata +5 -6
- data/toys/.data/templates/release-hook-on-open.yml.erb +0 -30
- data/toys/_onopen.rb +0 -158
- data/toys/gen-settings.rb +0 -46
data/docs/guide.md
CHANGED
|
@@ -4,4 +4,829 @@
|
|
|
4
4
|
|
|
5
5
|
# Toys-Release User Guide
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Toys-Release is a release pipeline system built on GitHub Actions and the Toys
|
|
8
|
+
RubyGem. It interprets [conventional commit](https://conventionalcommits.org/)
|
|
9
|
+
message format to automate changelog generation and updates library versions
|
|
10
|
+
based on semantic versioning. It supports fine tuning and approval of releases
|
|
11
|
+
using GitHub pull requests.
|
|
12
|
+
|
|
13
|
+
Out of the box, Toys-Release knows how to tag GitHub releases, build and push
|
|
14
|
+
RubyGems packages, and build and publish documentation to gh-pages. You can
|
|
15
|
+
customize the build pipeline and many aspects of its behavior.
|
|
16
|
+
|
|
17
|
+
This user's guide covers all the features of Toys-Release in detail, including
|
|
18
|
+
installation, normal operations, release pipeline customization, and a full
|
|
19
|
+
configuration reference.
|
|
20
|
+
|
|
21
|
+
**(This user's guide is still under construction.)**
|
|
22
|
+
|
|
23
|
+
## Conceptual overview
|
|
24
|
+
|
|
25
|
+
Toys-Release is a comprehensive release pipeline system. It includes a set of
|
|
26
|
+
**command line tools** (built using the Toys framework) and a set of
|
|
27
|
+
**GitHub actions** that can be integrated into a GitHub repository to provide a
|
|
28
|
+
way to release new versions of packages present in that repository.
|
|
29
|
+
|
|
30
|
+
Toys-Release depends on the repository utilizing the **conventional commits**
|
|
31
|
+
standard (https://conventionalcommits.org) to describe the changes made in each
|
|
32
|
+
commit to the repository. Using this information, it automatically generates
|
|
33
|
+
**changelog** entries and chooses a new package version to release, according
|
|
34
|
+
to the **semantic versioning** standard (https://semver.org/).
|
|
35
|
+
|
|
36
|
+
Releases are requested explicitly by a repository maintainer by running a
|
|
37
|
+
command line tool or triggering a GitHub action. Toys-Release will configure
|
|
38
|
+
the release and open a **release pull request** describing the release. When
|
|
39
|
+
this pull request is merged, Toys-Release will automatically perform the
|
|
40
|
+
release. The pull request can also be modified to customize the release, or
|
|
41
|
+
closed without merging to cancel the release.
|
|
42
|
+
|
|
43
|
+
Toys-Release depends on a **configuration file** to describe which packages are
|
|
44
|
+
present in a repository and how to release them. It supports repositories
|
|
45
|
+
containing either a single package, or multiple packages (i.e. "**monorepos**")
|
|
46
|
+
and can analyze a repository to identify changes applying to each package.
|
|
47
|
+
|
|
48
|
+
Toys-Release can build **GitHub releases**, publish **RubyGems packages**, and
|
|
49
|
+
build and publish documentation to **GitHub pages**.
|
|
50
|
+
|
|
51
|
+
Toys-Release uses the [Toys](https://dazuma.github.io/toys/gems/toys/latest)
|
|
52
|
+
RubyGem, but does not require familiarity with Toys.
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
Toys-Release must be installed into a GitHub repository. This involves:
|
|
57
|
+
|
|
58
|
+
* Installing a Toys tool;
|
|
59
|
+
* Writing a configuration file;
|
|
60
|
+
* Defining a set of GitHub Actions workflows and a set of GitHub labels
|
|
61
|
+
(a tool is provided to perform this step); and
|
|
62
|
+
* Providing necessary credentials.
|
|
63
|
+
|
|
64
|
+
### Prerequisites
|
|
65
|
+
|
|
66
|
+
Toys-Release is written in Ruby, using the Toys framework. The installation
|
|
67
|
+
process requires these items to be installed locally, but normal operation
|
|
68
|
+
happens in GitHub Actions and does not require any local installation.
|
|
69
|
+
|
|
70
|
+
If you do not have Ruby or Toys installed locally, do so first. Install
|
|
71
|
+
Ruby 3.0 or later, and then install the Toys RubyGem using:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
gem install toys
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Toys-Release requires Toys 0.18 or later. If you have an older version of Toys,
|
|
78
|
+
update it using:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
toys system update
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Finally, you also need the GitHub command line tool, `gh`. Find installation
|
|
85
|
+
instructions at https://cli.github.com/. If you are running on MacOS, for
|
|
86
|
+
example, the easiest way to install it is via homebrew:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
brew install gh
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Install the release tool
|
|
93
|
+
|
|
94
|
+
The Toys-Release tool needs to be installed in your repository, as a Toys tool
|
|
95
|
+
loaded from the [toys-release](https://rubygems.org/gems/toys-release) gem.
|
|
96
|
+
|
|
97
|
+
Create `.toys/release.rb` (note the leading period in the directory name) in
|
|
98
|
+
your git repository. Use the following content:
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
load_gem "toys-release"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This will cause Toys-Release to use the latest version of Toys-Release. You can
|
|
105
|
+
also pin to a specific version of Toys-Release by specifying version
|
|
106
|
+
requirements similar to how those requirements are specified in RubyGems or
|
|
107
|
+
Bundler:
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
load_gem "toys-release", "~> 0.3"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Commit and push this change to your repository.
|
|
114
|
+
|
|
115
|
+
### Write the configuration file
|
|
116
|
+
|
|
117
|
+
Next you will provide a configuration file for releases. This file is located
|
|
118
|
+
in your repository at `.toys/.data/releases.yml` (note the leading periods) and
|
|
119
|
+
lists all the releasable components (such as RubyGems packages) in your
|
|
120
|
+
repository, along with any customizations to the build/release process and
|
|
121
|
+
pipeline behavior.
|
|
122
|
+
|
|
123
|
+
To get you started, Toys-Release provides a config generation tool. Once the
|
|
124
|
+
release tool is installed as described above, you can run this from your local
|
|
125
|
+
repository clone directory:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
toys release gen-config
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This will analyze your repository and generate an initial configuration file
|
|
132
|
+
for you. It will make a guess as to what releasable components/RubyGems are
|
|
133
|
+
present in your repository. At this stage, you do not need to get every
|
|
134
|
+
configuration exactly correct, but feel free to begin editing it if you so
|
|
135
|
+
choose. The remaining sections in this user's guide will cover the release
|
|
136
|
+
capabilities that you may need to configure in this file, and the
|
|
137
|
+
[configuration reference](#configuration-reference) section below describes the
|
|
138
|
+
file format in detail.
|
|
139
|
+
|
|
140
|
+
### Install workflows and labels
|
|
141
|
+
|
|
142
|
+
Once an initial configuration file is present, you can finish the rest of the
|
|
143
|
+
installation by creating some needed labels in your GitHub repository and
|
|
144
|
+
installing some needed GitHub Actions workflows. These are done on the command
|
|
145
|
+
line using the release tool.
|
|
146
|
+
|
|
147
|
+
To create the GitHub repo labels, run this from your local repo clone directory:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
toys release create-labels
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Then, to generate the GitHub Actions workflows, run:
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
toys release gen-workflows
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
This will generate files in a `.github/workflows` directory in your repository.
|
|
160
|
+
Commit and push this change (along with the configuration file) to your
|
|
161
|
+
repository.
|
|
162
|
+
|
|
163
|
+
### Provide credentials
|
|
164
|
+
|
|
165
|
+
If Toys-Release will publish RubyGems packages, it will require credentials.
|
|
166
|
+
Provide those by creating a GitHub Actions Secret called `RUBYGEMS_API_KEY`.
|
|
167
|
+
|
|
168
|
+
In your GitHub repository web UI, go to the Settings tab, and choose
|
|
169
|
+
Secrets and Variables -> Actions in the left nav. Create a repository secret
|
|
170
|
+
called `RUBYGEMS_API_KEY` whose value is an API key from RubyGems with
|
|
171
|
+
"push rubygem" scope. You can also provide this secret at the organization
|
|
172
|
+
level.
|
|
173
|
+
|
|
174
|
+
## Release operations
|
|
175
|
+
|
|
176
|
+
This section describes how Toys-Release manages releases and how you control
|
|
177
|
+
and interact with the process.
|
|
178
|
+
|
|
179
|
+
Overall, the process looks like this:
|
|
180
|
+
|
|
181
|
+
1. A maintainer schedules a release by triggering the "Open release request"
|
|
182
|
+
GitHub Action. This action analyzes the repository, looking for changes in
|
|
183
|
+
each component, deciding which components have releasable updates,
|
|
184
|
+
determining the semver version bump for each, and building a changelog. It
|
|
185
|
+
then opens a pull request with the version and changelog updates.
|
|
186
|
+
|
|
187
|
+
2. The maintainer can either merge the pull request (possibly with manual
|
|
188
|
+
modifications to the changelogs and/or version numbers to release) or close
|
|
189
|
+
it unmerged.
|
|
190
|
+
|
|
191
|
+
3. If the pull request is merged, the release is automatically processed by
|
|
192
|
+
additional GitHub Actions. The automation verifies that the GitHub checks
|
|
193
|
+
pass, and runs the release pipeline.
|
|
194
|
+
|
|
195
|
+
4. The results of the run are reported back to the release pull request. If
|
|
196
|
+
the release failed, a GitHub issue is also automatically opened. A
|
|
197
|
+
maintainer can retry a failed release by triggering the "Retry release"
|
|
198
|
+
GitHub Action.
|
|
199
|
+
|
|
200
|
+
### Requesting releases
|
|
201
|
+
|
|
202
|
+
To request a release, navigate to the Actions tab in the GitHub UI, select the
|
|
203
|
+
"Open release request" workflow, and click the "Run workflow" dropdown. This
|
|
204
|
+
will open a confirmation drop-down. Click the "Run workflow" button to confirm
|
|
205
|
+
and begin the automatic release analysis.
|
|
206
|
+
|
|
207
|
+
The dropdown provides an optional "Components to release" field. Often you can
|
|
208
|
+
leave this blank, and Toys-Release will analyze all components in the repository
|
|
209
|
+
and select the ones that have releasable changes pending. Alternatively, you
|
|
210
|
+
can choose which components to release by entering their names, space-delimited
|
|
211
|
+
in the field.
|
|
212
|
+
|
|
213
|
+
The field also supports setting the version number for each component, by
|
|
214
|
+
appending the version to the component name, separated by a colon.
|
|
215
|
+
|
|
216
|
+
For example, to request releases of the `toys` and `toys-release` components,
|
|
217
|
+
you can enter the following text into "Components to release":
|
|
218
|
+
|
|
219
|
+
toys toys-release
|
|
220
|
+
|
|
221
|
+
To make the above request but specifically request version 0.3.0 of the
|
|
222
|
+
`toys-release` component:
|
|
223
|
+
|
|
224
|
+
toys toys-release:0.3.0
|
|
225
|
+
|
|
226
|
+
### Managing release pull requests
|
|
227
|
+
|
|
228
|
+
You can also specify which components get released and at which versions, by
|
|
229
|
+
modifying the release pull request. You can change the version in the pull
|
|
230
|
+
request, or even revert the version/changelog change for some components and/or
|
|
231
|
+
introduce version/changelog modifications for other components. The releases
|
|
232
|
+
that ultimately take place are simply dictated by what changes get introduced
|
|
233
|
+
by the commit introduced by merging the pull request.
|
|
234
|
+
|
|
235
|
+
**Important:** If you modify a release pull request, be sure to *squash* your
|
|
236
|
+
changes when you merge it. It is important that the entire pull request is
|
|
237
|
+
expressed in a single commit, because the automation will look only at the
|
|
238
|
+
changes in the most recent commit after merge.
|
|
239
|
+
|
|
240
|
+
You will also notice that the pull request opened by the "Open release request"
|
|
241
|
+
workflow will have the `release: pending` label applied. This label signals the
|
|
242
|
+
release automation that this is a release pull request. If you remove this
|
|
243
|
+
label, the automation will not process the release.
|
|
244
|
+
|
|
245
|
+
Finally, you can even create a release pull request manually. You must simply
|
|
246
|
+
ensure that:
|
|
247
|
+
|
|
248
|
+
* The pull request has the `release: pending` label applied
|
|
249
|
+
* The pull request merges as a single commit (i.e. "squashed")
|
|
250
|
+
* For each component you want to release, the version and changelog are
|
|
251
|
+
updated appropriately.
|
|
252
|
+
|
|
253
|
+
If you close a release pull request without merging, the release will be
|
|
254
|
+
canceled. The automation will apply the `release: aborted` label to indicate
|
|
255
|
+
this.
|
|
256
|
+
|
|
257
|
+
### Release results and logs
|
|
258
|
+
|
|
259
|
+
(TODO)
|
|
260
|
+
|
|
261
|
+
### Troubleshooting and retrying releases
|
|
262
|
+
|
|
263
|
+
(TODO)
|
|
264
|
+
|
|
265
|
+
### Documentation publication
|
|
266
|
+
|
|
267
|
+
(TODO)
|
|
268
|
+
|
|
269
|
+
### Special commit tags
|
|
270
|
+
|
|
271
|
+
(TODO)
|
|
272
|
+
|
|
273
|
+
### Running on the command line
|
|
274
|
+
|
|
275
|
+
(TODO)
|
|
276
|
+
|
|
277
|
+
## The release pipeline
|
|
278
|
+
|
|
279
|
+
Toys-Release features a highly configurable build pipeline. By default it is
|
|
280
|
+
configured to handle most RubyGems packages, and will:
|
|
281
|
+
|
|
282
|
+
* Tag and post a GitHub Release
|
|
283
|
+
* Build a RubyGems package and push it to rubygems.org
|
|
284
|
+
* Optionally build Yardoc documentation and push it to GitHub Pages
|
|
285
|
+
|
|
286
|
+
The pipeline system, however, lets you customize any aspect of the process, and
|
|
287
|
+
even replace it with an entirely different process altogether, possibly even
|
|
288
|
+
handling a completely different type of releasable artifact. This section
|
|
289
|
+
covers the build pipeline. See also the
|
|
290
|
+
[build step configuration](#build-step-configuration) section in the
|
|
291
|
+
configuration reference documentation.
|
|
292
|
+
|
|
293
|
+
### Pipeline steps
|
|
294
|
+
|
|
295
|
+
(TODO)
|
|
296
|
+
|
|
297
|
+
### Inter-step communication and dependencies
|
|
298
|
+
|
|
299
|
+
(TODO)
|
|
300
|
+
|
|
301
|
+
### The standard pipeline
|
|
302
|
+
|
|
303
|
+
(TODO)
|
|
304
|
+
|
|
305
|
+
### Custom steps
|
|
306
|
+
|
|
307
|
+
(TODO)
|
|
308
|
+
|
|
309
|
+
### Common pipeline modifications
|
|
310
|
+
|
|
311
|
+
(TODO)
|
|
312
|
+
|
|
313
|
+
## Configuration reference
|
|
314
|
+
|
|
315
|
+
The Toys-Release configuration file is a [YAML](https://yaml.org)-formatted
|
|
316
|
+
file located in your repository at `.toys/.data/releases.yml`. It controls all
|
|
317
|
+
aspects of the release process and behavior and is required.
|
|
318
|
+
|
|
319
|
+
This section will cover all keys in configuration file.
|
|
320
|
+
|
|
321
|
+
### Top level configuration
|
|
322
|
+
|
|
323
|
+
The top level of the yaml file is a dictionary that can include the following
|
|
324
|
+
keys. Out of these, **repo**, **git_user_name**, and **git_user_email** are all
|
|
325
|
+
required. The rest are optional.
|
|
326
|
+
|
|
327
|
+
* **append_steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
328
|
+
A list of build steps to append to the end of the default build pipeline.
|
|
329
|
+
This can be used to modify the default build pipeline instead of redefining
|
|
330
|
+
the entire pipeline using the **steps** key.
|
|
331
|
+
|
|
332
|
+
* **breaking_change_header**: *string* (optional) --
|
|
333
|
+
A changelog entry prefix that appears when a change is marked as breaking.
|
|
334
|
+
Default is `BREAKING CHANGE`.
|
|
335
|
+
|
|
336
|
+
* **commit_tags**: *array of [CommitTagConfig](#commit-tag-configuration)* (optional) --
|
|
337
|
+
A set of configurations defining how to interpret
|
|
338
|
+
[conventional commit](https://conventionalcommits.org) tags, including how
|
|
339
|
+
they trigger releases, bump versions, and generate changelog entries. See
|
|
340
|
+
[commit tag configuration](#commit-tag-configuration) for details.
|
|
341
|
+
If not included, Toys-Release will use a default configuration as follows:
|
|
342
|
+
|
|
343
|
+
- tag: feat
|
|
344
|
+
semver: minor
|
|
345
|
+
header: ADDED
|
|
346
|
+
- tag: fix
|
|
347
|
+
semver: patch
|
|
348
|
+
header: FIXED
|
|
349
|
+
- tag: docs
|
|
350
|
+
semver: patch
|
|
351
|
+
|
|
352
|
+
* **components**: *array of [ComponentConfig](#component-configuration)* (optional) --
|
|
353
|
+
An array of releasable components, usually RubyGems packages. See
|
|
354
|
+
[Component Configuration](#component-configuration) for details on the format
|
|
355
|
+
of each component. You can also use the name **gems** for this config key.
|
|
356
|
+
|
|
357
|
+
* **coordinate_versions**: *boolean* (optional) --
|
|
358
|
+
If set to true, this is a shorthand for setting up a coordination group
|
|
359
|
+
containing all components in this repository. Defaults to *false*.
|
|
360
|
+
|
|
361
|
+
* **coordination_groups**: *array of array of string* (optional) --
|
|
362
|
+
A list of disjoint sets of component names. Each set defines a group of
|
|
363
|
+
components that will always be released together with the same version
|
|
364
|
+
number. That is, if one or more components in a set are released, the entire
|
|
365
|
+
set is released, even components with no changes. This is useful for sets of
|
|
366
|
+
gems, such as the Rails gems, that are always released together.
|
|
367
|
+
|
|
368
|
+
* **enable_release_automation**: *boolean* (optional) --
|
|
369
|
+
When enabled, the release pipeline runs automatically when a release pull
|
|
370
|
+
request is merged. Defaults to *true*.
|
|
371
|
+
|
|
372
|
+
* **gh_pages_enabled**: *boolean* (optional) --
|
|
373
|
+
Whether to globally enable gh-pages publication for all releases. Defaults to
|
|
374
|
+
*false*.
|
|
375
|
+
|
|
376
|
+
* **git_user_email**: *string* (required) --
|
|
377
|
+
The git `user.email` setting to use when making git commits.
|
|
378
|
+
|
|
379
|
+
* **git_user_name**: *string* (required) --
|
|
380
|
+
The git `user.name` setting to use when making git commits.
|
|
381
|
+
|
|
382
|
+
* **main_branch**: *string* (optional) --
|
|
383
|
+
The name of the main branch. Defaults to `main` if not provided.
|
|
384
|
+
|
|
385
|
+
* **modify_steps**: *array of [BuildStepModification](#build-step-modification)* (optional) --
|
|
386
|
+
A set of modifications to the default build steps. This can be used to modify
|
|
387
|
+
the default build pipeline instead of redefining the entire pipeline using
|
|
388
|
+
the **steps** key.
|
|
389
|
+
|
|
390
|
+
* **no_significant_updates_notice**: *string* (optional) --
|
|
391
|
+
A notice that appears in a changelog when a release is done but no other
|
|
392
|
+
changelog entries are present. Default is `No significant updates.`
|
|
393
|
+
|
|
394
|
+
* **prepend_steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
395
|
+
A list of build steps to prepend to the start of the default build pipeline.
|
|
396
|
+
This can be used to modify the default build pipeline instead of redefining
|
|
397
|
+
the entire pipeline using the **steps** key.
|
|
398
|
+
|
|
399
|
+
* **release_branch_prefix**: *string* (optional) --
|
|
400
|
+
The prefix for all release branch names. Defaults to `release`.
|
|
401
|
+
|
|
402
|
+
* **release_aborted_label**: *string* (optional) --
|
|
403
|
+
The name of the GitHub issue label that identifies aborted release pull
|
|
404
|
+
requests. Defaults to `release: aborted`.
|
|
405
|
+
|
|
406
|
+
* **release_complete_label**: *string* (optional) --
|
|
407
|
+
The name of the GitHub issue label that identifies successfully completed
|
|
408
|
+
release pull requests. Defaults to `release: complete`.
|
|
409
|
+
|
|
410
|
+
* **release_error_label**: *string* (optional) --
|
|
411
|
+
The name of the GitHub issue label that identifies release pull requests in
|
|
412
|
+
an error state. Defaults to `release: error`.
|
|
413
|
+
|
|
414
|
+
* **release_pending_label**: *string* (optional) --
|
|
415
|
+
The name of the GitHub issue label that identifies pending release pull
|
|
416
|
+
requests. Defaults to `release: pending`.
|
|
417
|
+
|
|
418
|
+
* **repo**: *string* (required) --
|
|
419
|
+
The GitHub repository name in the form `owner/repo`. For example, the Toys
|
|
420
|
+
repo is `dazuma/toys`.
|
|
421
|
+
|
|
422
|
+
* **required_checks**: *regexp/boolean* (optional) --
|
|
423
|
+
Identifies which GitHub checks must pass as a prerequisite for a release. If
|
|
424
|
+
a string is provided, it is interpreted as a Ruby regexp (PCRE) and
|
|
425
|
+
identifies the check names. A boolean value of *true* (the default) means all
|
|
426
|
+
checks must pass. A boolean value of *false* disables checking.
|
|
427
|
+
|
|
428
|
+
* **required_checks_timeout**: *integer* (optional) --
|
|
429
|
+
The time to wait, in seconds, for required checks to pass during release
|
|
430
|
+
processing. Defaults to 900 (i.e. 15 minutes).
|
|
431
|
+
|
|
432
|
+
* **signoff_commits**: *boolean* (optional) --
|
|
433
|
+
Whether to make commits with `--signoff`. Set this to true if your repository
|
|
434
|
+
has a policy that commits require signoff. Defaults to *false*.
|
|
435
|
+
|
|
436
|
+
* **steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
437
|
+
The build pipeline as a list of build steps. See
|
|
438
|
+
[build step configuration](#build-step-configuration) for details on how to
|
|
439
|
+
define the pipeline. If this is not included, Toys-Release will use a default
|
|
440
|
+
pipeline as follows:
|
|
441
|
+
|
|
442
|
+
- name: bundle
|
|
443
|
+
- name: build_gem
|
|
444
|
+
- name: build_yard
|
|
445
|
+
- name: release_github
|
|
446
|
+
- name: release_gem
|
|
447
|
+
source: build_gem
|
|
448
|
+
- name: push_gh_pages
|
|
449
|
+
source: build_yard
|
|
450
|
+
|
|
451
|
+
### Commit tag configuration
|
|
452
|
+
|
|
453
|
+
A commit tag configuration specifies how the release system should handle a
|
|
454
|
+
particular [conventional commits](https://conventionalcommits.org) tag,
|
|
455
|
+
including what kind of [semver](https://semver.org) version bump it implies,
|
|
456
|
+
and how it should appear in the changelog. The format of the configuration is a
|
|
457
|
+
dictionary with the keys documented here. The **tag** key is required; the
|
|
458
|
+
remaining keys are optional and have defaults.
|
|
459
|
+
|
|
460
|
+
* **header**: *string,null* (optional) --
|
|
461
|
+
A prefix that appears before each changelog entry generated by this tag. The
|
|
462
|
+
special value *null* suppresses changelog entry generation for this scope.
|
|
463
|
+
Defaults to the tag itself in all caps.
|
|
464
|
+
|
|
465
|
+
* **scopes**: *array of [ScopeConfig](#scope-configuration)* (optional) --
|
|
466
|
+
Overrides for conventional commit scopes.
|
|
467
|
+
|
|
468
|
+
* **semver**: *string* (optional) --
|
|
469
|
+
The semver version bump implied by changes of this type. Possible values are
|
|
470
|
+
`patch`, `minor`, `major`, and `none`. Default is `none`.
|
|
471
|
+
|
|
472
|
+
* **tag**: *string* (required) -- The conventional commit tag.
|
|
473
|
+
|
|
474
|
+
#### Scope configuration
|
|
475
|
+
|
|
476
|
+
A scope configuration provides override behavior for a particular scope name
|
|
477
|
+
in a commit tag configuration. This lets you provide special behavior for
|
|
478
|
+
individual scopes. A common case might be `chore(deps):` which is used by some
|
|
479
|
+
dependency-updating bots. Typically, `chore:` does not indicate a significant
|
|
480
|
+
change that should trigger a release or appear in a changelog, but you might
|
|
481
|
+
choose different behavior for dependency changes.
|
|
482
|
+
|
|
483
|
+
* **header**: *string,null* (optional) --
|
|
484
|
+
A prefix that appears before each changelog entry generated by this tag. The
|
|
485
|
+
special value *null* suppresses changelog entry generation for this scope.
|
|
486
|
+
Defaults to the same setting used by the tag.
|
|
487
|
+
|
|
488
|
+
* **scope**: *string* (required) -- The scope name.
|
|
489
|
+
|
|
490
|
+
* **semver**: *string* (optional) --
|
|
491
|
+
The semver version bump implied by changes of this type. Possible values are
|
|
492
|
+
`patch`, `minor`, `major`, and `none`. Defaults to the same setting used by
|
|
493
|
+
the tag.
|
|
494
|
+
|
|
495
|
+
### Component configuration
|
|
496
|
+
|
|
497
|
+
A component configuration specifies how a particular component (often a
|
|
498
|
+
RubyGems package) should be released. Its format is a dictionary with the keys
|
|
499
|
+
documented here.
|
|
500
|
+
|
|
501
|
+
* **append_steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
502
|
+
A list of build steps to append to the end of this component's build
|
|
503
|
+
pipeline. This can be used to modify the build pipeline instead of redefining
|
|
504
|
+
the entire pipeline using the **steps** key.
|
|
505
|
+
|
|
506
|
+
* **changelog_path**: *string* (optional) --
|
|
507
|
+
The path to the component's changelog file, relative to the component's
|
|
508
|
+
directory. Default is `CHANGELOG.md`.
|
|
509
|
+
|
|
510
|
+
* **directory**: *string* (optional) --
|
|
511
|
+
The directory within the repository where this component is located. Defaults
|
|
512
|
+
to the component name, unless there is exactly one component in this
|
|
513
|
+
repository, in which case the default is the root of the repository, i.e.
|
|
514
|
+
"`.`". This directory is used to identify when files related to this
|
|
515
|
+
component have been changed, and is also used as a base directory for other
|
|
516
|
+
paths related to the component.
|
|
517
|
+
|
|
518
|
+
* **exclude_globs**: *array of string* (optional) --
|
|
519
|
+
An array of globs identifying files or directories that should be ignored
|
|
520
|
+
when identifying changes to this component. These paths are relative to the
|
|
521
|
+
repo root.
|
|
522
|
+
|
|
523
|
+
* **gh_pages_directory**: *string* (optional) --
|
|
524
|
+
The directory in the `gh-pages` branch under which this component's
|
|
525
|
+
documentation is published. The default is the component name.
|
|
526
|
+
|
|
527
|
+
* **gh_pages_enabled**: *boolean* (optional) --
|
|
528
|
+
Whether gh-pages documentation publishing is enabled for this component.
|
|
529
|
+
Default is *true* if either **gh_pages_directory** or **gh_pages_version_var**
|
|
530
|
+
is set explicitly; otherwise *false*.
|
|
531
|
+
|
|
532
|
+
* **gh_pages_version_var**: *string* (optional) --
|
|
533
|
+
The name of a Javascript variable within the `404.html` page under gh-pages
|
|
534
|
+
that identifies the latest release of this component. Defaults to a variable
|
|
535
|
+
name corresponding to the component name.
|
|
536
|
+
|
|
537
|
+
* **include_globs**: *array of string* (optional) --
|
|
538
|
+
An array of globs identifying additional files or directories, not located in
|
|
539
|
+
the component's directory itself, that should signal changes to this
|
|
540
|
+
component. This can be used, for example, if the repo has global files shared
|
|
541
|
+
by multiple components, where a change in such a file should trigger releases
|
|
542
|
+
for all those components. These paths are relative to the repo root.
|
|
543
|
+
|
|
544
|
+
* **modify_steps**: *array of [BuildStepModification](#build-step-modification)* (optional) --
|
|
545
|
+
A set of modifications to this component's build steps. This can be used to
|
|
546
|
+
modify the build pipeline instead of redefining the entire pipeline using
|
|
547
|
+
the **steps** key.
|
|
548
|
+
|
|
549
|
+
* **name**: *string* (required) --
|
|
550
|
+
The name of the component, e.g. the name of the RubyGems package if this
|
|
551
|
+
component represents a gem.
|
|
552
|
+
|
|
553
|
+
* **prepend_steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
554
|
+
A list of build steps to prepend to the start of this component's build
|
|
555
|
+
pipeline. This can be used to modify the build pipeline instead of redefining
|
|
556
|
+
the entire pipeline using the **steps** key.
|
|
557
|
+
|
|
558
|
+
* **steps**: *array of [BuildStepConfig](#build-step-configuration)* (optional) --
|
|
559
|
+
A way to override the complete build pipeline for this component. If not
|
|
560
|
+
present, the default pipeline for the entire repository is used. (See the
|
|
561
|
+
**steps** key under [Top level configuration](#top-level-configuration).)
|
|
562
|
+
|
|
563
|
+
* **version_constant**: *string* (optional) --
|
|
564
|
+
The fully-qualified name of the version constant. This is used to determine
|
|
565
|
+
the current version of the component. The default uses the module implied by
|
|
566
|
+
the component name. For example, if the component (gem) name is
|
|
567
|
+
`toys-release`, this defaults to `Toys::Release::VERSION`.
|
|
568
|
+
|
|
569
|
+
* **version_rb_path**: *string* (optional) --
|
|
570
|
+
The path to a Ruby file that contains the current version of the component.
|
|
571
|
+
This file *must* include Ruby code that looks like this:
|
|
572
|
+
|
|
573
|
+
VERSION = "1.2.3"
|
|
574
|
+
|
|
575
|
+
where the string is the latest released version. (Prior to the initial
|
|
576
|
+
release, this version should be `0.0.0`.) Typically, `VERSION` is a constant
|
|
577
|
+
defined in the "base module" for the Ruby library.
|
|
578
|
+
|
|
579
|
+
The default is `version.rb` within the lib path associated with the Ruby
|
|
580
|
+
module implied by the component name. For example, if the component (gem)
|
|
581
|
+
name is `toys-release`, this defaults to `lib/toys/release/version.rb`.
|
|
582
|
+
|
|
583
|
+
### Build step configuration
|
|
584
|
+
|
|
585
|
+
A build step describes one step in the release process. Its format is a
|
|
586
|
+
dictionary with the keys described below. Specific types of build steps may
|
|
587
|
+
define additional keys as documented under the section
|
|
588
|
+
[build step types](#build-step-types). For more introductory information, see
|
|
589
|
+
the section on [the release pipeline](#the-release-pipeline) above.
|
|
590
|
+
|
|
591
|
+
* **name**: *string* (optional) --
|
|
592
|
+
The unique name of this build step in the build pipeline. If not explicitly
|
|
593
|
+
provided, a unique name will be generated.
|
|
594
|
+
|
|
595
|
+
* **type**: *string* (optional) --
|
|
596
|
+
The type of build step, defining what it does. Possible values are:
|
|
597
|
+
`build_gem`, `build_yard`, `bundle`, `command`, `noop`, `push_gh_pages`,
|
|
598
|
+
`release_gem`, `release_github`, and `tool`. For more information, see the
|
|
599
|
+
section [build step types](#build-step-types).
|
|
600
|
+
|
|
601
|
+
* **run**: *boolean* (optional) --
|
|
602
|
+
Whether to force this step to run. Typically, build steps will run only if
|
|
603
|
+
the build type determines that it should run, or if the step is a dependency
|
|
604
|
+
of another step that will run. You can, however, force a step to run that
|
|
605
|
+
would otherwise not do so by setting this key to *true*.
|
|
606
|
+
|
|
607
|
+
* **inputs**: *array of [InputConfig](#step-input-configuration)* (optional) --
|
|
608
|
+
Inputs to this step, indicating dependencies on other steps and files to copy
|
|
609
|
+
from those steps' outputs.
|
|
610
|
+
|
|
611
|
+
* **outputs**: *array of [OutputConfig](#step-output-configuration)* (optional) --
|
|
612
|
+
Files to copy to this step's output so they become available to other steps.
|
|
613
|
+
|
|
614
|
+
#### Step input configuration
|
|
615
|
+
|
|
616
|
+
A step input represents a dependency on another step: if this step is run, the
|
|
617
|
+
other step will also be run. It also describes files that should be copied from
|
|
618
|
+
the dependent step's output and made available to the depending step. This
|
|
619
|
+
configuration is a dictionary supporting the following keys:
|
|
620
|
+
|
|
621
|
+
* **collisions**: *string* (optional) --
|
|
622
|
+
A symbolic value indicating what to do if a collision occurs between incoming
|
|
623
|
+
and existing files. Possible values are:
|
|
624
|
+
|
|
625
|
+
* `error`: (the default) Abort with an error
|
|
626
|
+
* `keep`: Keep the existing file
|
|
627
|
+
* `replace`: Replace the existing file with the incoming file
|
|
628
|
+
|
|
629
|
+
* **dest**: *string or false* (optional) --
|
|
630
|
+
A symbolic value indicating where to copy the dependent step's output to.
|
|
631
|
+
Possible values are:
|
|
632
|
+
|
|
633
|
+
* `component`: (the default) Copy files to the component directory
|
|
634
|
+
* `repo_root`: Copy files to the repository root
|
|
635
|
+
* `output`: Copy files to this step's output directory
|
|
636
|
+
* `temp`: Copy files to this step's temp directory
|
|
637
|
+
* `none`: Do not copy any files, but just declare a dependency
|
|
638
|
+
|
|
639
|
+
* **dest_path**: *string* (optional) --
|
|
640
|
+
The path in the destination to copy to. If **source_path** is provided,
|
|
641
|
+
**dest_path** is the corresponding path in the destination. If **source_path**
|
|
642
|
+
is not provided, **dest_path** is a directory into which the source contents
|
|
643
|
+
are copied. If **dest_path** is not provided, it defaults to the effective
|
|
644
|
+
value of **source_path**, i.e. things are copied into the same locations
|
|
645
|
+
within the destination as they were in the source.
|
|
646
|
+
|
|
647
|
+
* **name**: *string* (required) --
|
|
648
|
+
The name of the step to depend on. The dependent step must be located earlier
|
|
649
|
+
in the pipeline than the depending step.
|
|
650
|
+
|
|
651
|
+
* **source_path**: *string* (optional) --
|
|
652
|
+
The path of the file or directory to copy from the source output. Only this
|
|
653
|
+
item (recursively, if a directory) is copied. If this key is not provided,
|
|
654
|
+
*all* contents of the source output are copied (e.g. the default is
|
|
655
|
+
effectively "`.`")
|
|
656
|
+
|
|
657
|
+
#### Step output configuration
|
|
658
|
+
|
|
659
|
+
A step output represents files automatically copied to the step's output
|
|
660
|
+
directory after the step runs. This configuration is a dictionary supporting
|
|
661
|
+
the following keys:
|
|
662
|
+
|
|
663
|
+
* **collisions**: *string* (optional) --
|
|
664
|
+
A symbolic value indicating what to do if a collision occurs between incoming
|
|
665
|
+
and existing files. Possible values are:
|
|
666
|
+
|
|
667
|
+
* `error`: (the default) Abort with an error
|
|
668
|
+
* `keep`: Keep the existing file
|
|
669
|
+
* `replace`: Replace the existing file with the incoming file
|
|
670
|
+
|
|
671
|
+
* **dest_path**: *string* (optional) --
|
|
672
|
+
The path in the output directory to copy to. If **source_path** is provided,
|
|
673
|
+
**dest_path** is the corresponding path in the output. If **source_path** is
|
|
674
|
+
not provided, **dest_path** is a directory into which the source contents are
|
|
675
|
+
copied. If **dest_path** is not provided, it defaults to the effective value
|
|
676
|
+
of **source_path**, i.e. things are copied into the same locations within the
|
|
677
|
+
output as they were in the source.
|
|
678
|
+
|
|
679
|
+
* **source**: *string* (optional) --
|
|
680
|
+
A symbolic value indicating where to copy from. Possible values are:
|
|
681
|
+
|
|
682
|
+
* `component`: (the default) Copy files from the component directory
|
|
683
|
+
* `repo_root`: Copy files from the repository root
|
|
684
|
+
* `temp`: Copy files from this step's temp directory
|
|
685
|
+
|
|
686
|
+
* **source_path**: *string* (optional) --
|
|
687
|
+
The path of the file or directory to copy from the source. Only this item
|
|
688
|
+
(recursively, if a directory) is copied. If this key is not provided, *all*
|
|
689
|
+
contents of the source are copied (e.g. the default is effectively "`.`")
|
|
690
|
+
|
|
691
|
+
#### Build step types
|
|
692
|
+
|
|
693
|
+
This is a list of the available build step types, including their behavior and
|
|
694
|
+
any additional configuration keys supported by each.
|
|
695
|
+
|
|
696
|
+
* **build_gem** -- A step that builds a gem package.
|
|
697
|
+
|
|
698
|
+
This step builds the gem described by the properly named gemspec file for
|
|
699
|
+
this component. The built package file is copied to this step's output. Other
|
|
700
|
+
steps (such as **release_gem**) can declare it as an input to get access to
|
|
701
|
+
the built package. This step does not run unless it is so declared as a
|
|
702
|
+
dependency or unless it is requested explicitly.
|
|
703
|
+
|
|
704
|
+
* **build_yard** -- A step that builds Yardocs.
|
|
705
|
+
|
|
706
|
+
This step builds documentation using [YARD](https://yardoc.org). The built
|
|
707
|
+
documentation is copied to this step's output in the directory `doc/`. Other
|
|
708
|
+
steps (such as **push_gh_pages**) can declare it as an input to get access to
|
|
709
|
+
the built documentation. This step does not run unless it is so declared as a
|
|
710
|
+
dependency or unless it is requested explicitly.
|
|
711
|
+
|
|
712
|
+
This step supports the following additional configuration keys:
|
|
713
|
+
|
|
714
|
+
* **bundle_step**: *string* (optional) --
|
|
715
|
+
The name of the bundle step. Defaults to `bundle`. This is used if the
|
|
716
|
+
**uses_gems** key is *not* provided.
|
|
717
|
+
|
|
718
|
+
* **uses_gems**: *array of (string or array of string)* (optional) --
|
|
719
|
+
An array of gem specifications, each of which can be a simple gem name or
|
|
720
|
+
an array including rubygems-style version requirements. These gems are
|
|
721
|
+
provided to Yard, and can include gems such as `redcarpet` that may be
|
|
722
|
+
needed for markup handling. If this key is included, the specified gems
|
|
723
|
+
are installed directly; if not, the bundle step is declared as a
|
|
724
|
+
dependency instead.
|
|
725
|
+
|
|
726
|
+
* **bundle** -- A step that installs the bundle in the component directory.
|
|
727
|
+
|
|
728
|
+
This step copies the resulting `Gemfile.lock` to its output. Other steps can
|
|
729
|
+
declare it as an input to get access to the `Gemfile.lock`. This step
|
|
730
|
+
does not run unless it is so declared as a dependency or unless it is
|
|
731
|
+
requested explicitly.
|
|
732
|
+
|
|
733
|
+
This step supports the following additional configuration keys:
|
|
734
|
+
|
|
735
|
+
* **chdir**: *string* (optional) --
|
|
736
|
+
Change to the specified directory (relative to the component directory)
|
|
737
|
+
when installing the bundle. By default, runs in the component directory.
|
|
738
|
+
|
|
739
|
+
* **command** -- A step that runs a command in the component directory.
|
|
740
|
+
|
|
741
|
+
This step supports the following additional configuration keys:
|
|
742
|
+
|
|
743
|
+
* **chdir**: *string* (optional) --
|
|
744
|
+
Change to the specified directory (relative to the component directory)
|
|
745
|
+
when running the command. By default, runs in the component directory.
|
|
746
|
+
|
|
747
|
+
* **command**: *array of string* (required) --
|
|
748
|
+
The command to run
|
|
749
|
+
|
|
750
|
+
* **continue_on_error**: *boolean* (optional) --
|
|
751
|
+
If *true*, continue to run the pipeline if the command exits abnormally.
|
|
752
|
+
If *false* (the default), the pipeline aborts.
|
|
753
|
+
|
|
754
|
+
This step does not run unless it is requested explicitly using the **run**
|
|
755
|
+
configuration or it is declared as a dependency.
|
|
756
|
+
|
|
757
|
+
* **noop** -- A no-op step that does nothing. This type is usually configured
|
|
758
|
+
with inputs and outputs and is used to collect or consolidate data from other
|
|
759
|
+
steps.
|
|
760
|
+
|
|
761
|
+
This step does not run unless it is requested explicitly using the **run**
|
|
762
|
+
configuration or it is declared as a dependency.
|
|
763
|
+
|
|
764
|
+
* **push_gh_pages** -- A step that pushes documentation to the gh-pages branch.
|
|
765
|
+
|
|
766
|
+
The documentation to publish should be under `doc/` in the output directory
|
|
767
|
+
of a "source" step, normally the **build_yard** step. This source step is
|
|
768
|
+
automatically declared as a dependency.
|
|
769
|
+
|
|
770
|
+
This step supports the following additional configuration keys:
|
|
771
|
+
|
|
772
|
+
* **source**: *string* (optional) --
|
|
773
|
+
The name of the source step. Defaults to `build_yard`.
|
|
774
|
+
|
|
775
|
+
This step runs if gh-pages publishing is enabled in the component.
|
|
776
|
+
|
|
777
|
+
* **release_gem** -- A step that pushes a gem package to rubygems.org.
|
|
778
|
+
|
|
779
|
+
The package must be provided under `pkg/` in the output directory of a
|
|
780
|
+
"source" step, normally the **build_gem** step. This source step is
|
|
781
|
+
automatically declared as a dependency.
|
|
782
|
+
|
|
783
|
+
This step supports the following additional configuration keys:
|
|
784
|
+
|
|
785
|
+
* **source**: *string* (optional) --
|
|
786
|
+
The name of the source step. Defaults to `build_gem`.
|
|
787
|
+
|
|
788
|
+
This step runs if a correctly-named gemspec file is present in the component
|
|
789
|
+
directory.
|
|
790
|
+
|
|
791
|
+
* **release_github** -- A step that creates a git tag and GitHub release.
|
|
792
|
+
|
|
793
|
+
This step always runs if present in the pipeline.
|
|
794
|
+
|
|
795
|
+
* **tool** -- A step that runs a Toys tool in the component directory.
|
|
796
|
+
|
|
797
|
+
This step supports the following additional configuration keys:
|
|
798
|
+
|
|
799
|
+
* **chdir**: *string* (optional) --
|
|
800
|
+
Change to the specified directory (relative to the component directory)
|
|
801
|
+
when running the tool. By default, runs in the component directory.
|
|
802
|
+
|
|
803
|
+
* **continue_on_error**: *boolean* (optional) --
|
|
804
|
+
If *true*, continue to run the pipeline if the tool exits abnormally. If
|
|
805
|
+
*false* (the default), the pipeline aborts.
|
|
806
|
+
|
|
807
|
+
* **tool**: *array of string* (required) --
|
|
808
|
+
The tool to run
|
|
809
|
+
|
|
810
|
+
This step does not run unless it is requested explicitly using the **run**
|
|
811
|
+
configuration or it is declared as a dependency.
|
|
812
|
+
|
|
813
|
+
#### Build step modification
|
|
814
|
+
|
|
815
|
+
A build step modification is a dictionary that modifies one or more existing
|
|
816
|
+
steps in the build pipeline. Its format is a dictionary with the keys described
|
|
817
|
+
below.
|
|
818
|
+
|
|
819
|
+
The **name** and **type** fields filter the steps to modify. If neither is
|
|
820
|
+
provided, *all* steps are modified.
|
|
821
|
+
|
|
822
|
+
* **name**: *string* (optional) --
|
|
823
|
+
Modify only the step with this unique name.
|
|
824
|
+
|
|
825
|
+
* **type**: *string* (optional) --
|
|
826
|
+
Modify only steps matching this type.
|
|
827
|
+
|
|
828
|
+
All other keys represent changes to the configuration of matching steps. You
|
|
829
|
+
can provide either the *null* value to delete the key, or a new full value for
|
|
830
|
+
the key. See [build step configuration](#build-step-configuration) and
|
|
831
|
+
[build step types](#build-step-types) for details on the available keys and
|
|
832
|
+
their formats.
|