2.0.1 • Published 10 months ago

@marcoceppi/release-please-bot v2.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

release-please

A GitHub App built with Probot that proposes releases based on semantic version commits defined by conventionalcommits.org.

This bot wraps the release-please npm package to provide an easy way to integrate with your GitHub repository.

Setup

# Install dependencies
npm install

# Run the bot
npm start

Configuration

To configure the bot, you can create a configuration file: .github/release-please.yml. The contents of this file allow for the following options:

NameDescriptionTypeDefault
primaryBranchThe primary branch from which releases are startedstringdetected from repository
handleGHReleaseWhether or not to tag releases on GitHubbooleanfalse
manifestWhether or not this is a manifest releasebooleanfalse
manifestConfigPath to the manifest configstringrelease-please-config.json
manifestFilePath to the manifest filestring.release-please-manifest.json
branchesAdditional release branches to trackBranchConfiguration[][]

BranchConfiguration:

NameDescriptionTypeDefault
branchThe branch from which releases are startedstringrequired
handleGHReleaseWhether or not to tag releases on GitHubbooleanfalse
manifestWhether or not this is a manifest releasebooleanfalse
manifestConfigPath to the manifest configstringrelease-please-config.json
manifestFilePath to the manifest filestring.release-please-manifest.json

Using a manifest config

We highly recommend using a manifest to configure your repository as the newest features will only be configurable there. To configure a manifest, create a release-please-config.json and a .release-please-manifest.json in the root of the repository.

The release-please-config.json contains the configuration for all modules in the repository. If you are converting from configurations in the release-please.yml, then you likely only have a single component in the repository. In this case, you will configure a single package path with ..

Example:

{
  "release-type": "node",
  "packages": {
    ".": {}
  }
}

The .release-please-manifest.json contains a mapping of paths to the current version (latest release of your artifact).

Example:

{
  ".": "1.2.3"
}

For more information on manifest configurations, see the documentation.

Validating the configuration

If the bot is installed, it will create a failing GitHub check on any pull request that modifies the .github/release-please.yml config file. It will validate both the yaml config (schema) and the manifest config (schema) if you are using a manifest config.

Deprecated Options

The following options are still supported, but can also be configured in a manifest configuration file. Future configuration options will only be available in a manifest configuration file. Note that the configuration names are often the "dasherized" versions of these camel-cased names.

NameDescriptionTypeDefault
releaseLabelsList of labels to add to the release PR.string[]null
releaseTypeRelease strategystringstrategy detected from the repository's primary language
versioningVersioning strategystringdefault
bumpMinorPreMajorBump minor for breaking changes before GAbooleandefault from underlying release strategy
bumpPatchForMinorPreMajorBump patch for feature changes before GAbooleandefault from underlying release strategy
packageNameThe name of the package to publish to publish to an upstream registry such as npm.stringthe repository name
pathCreate a release from a path other than the repository's rootstringthe repository root
changelogHostOverride the host for the git sourcestringhttps://github.com
changelogPathPath to the changelog to write releases notes to when creating a releasestringCHANGELOG.md
changelogTypeStrategy for generating the changelog entries. One of default or githubstringdefault
extraFilesAdditional files to track (if language supports it)string[][]
versionFilePath to the version file (if language supports it)string
branchesAdditional release branches to trackBranchConfiguration[][]
releaseLabelThe label applied to pull request after creating the GitHub releasestringrelease-please default (autorelease: tagged)
draftWhether to create the release as a draftbooleanfalse
draftPullRequestWhether to create the pull request as a draftbooleanfalse
pullRequestTitlePatternCustomize the pull request titlestring
monorepoTagsWhether to include the component name in the releaseboolean`false

BranchConfiguration:

NameDescriptionTypeDefault
releaseLabelsList of labels to add to the release PR.string[]null
releaseTypeRelease strategystringstrategy detected from the repository's primary language
versioningVersioning strategystringdefault
bumpMinorPreMajorBump minor for breaking changes before GAbooleandefault from underlying release strategy
bumpPatchForMinorPreMajorBump patch for feature changes before GAbooleandefault from underlying release strategy
packageNameThe name of the package to publish to publish to an upstream registry such as npm.stringthe repository name
pathCreate a release from a path other than the repository's rootstringthe repository root
changelogHostOverride the host for the git sourcestringhttps://github.com
changelogPathPath to the changelog to write releases notes to when creating a releasestringCHANGELOG.md
changelogTypeStrategy for generating the changelog entries. One of default or githubstringdefault
extraFilesAdditional files to track (if language supports it)string[][]
versionFilePath to the version file (if language supports it)string
releaseLabelThe label applied to pull request after creating the GitHub releasestringrelease-please default (autorelease: tagged)
draftWhether to create the release as a draftbooleanfalse
draftPullRequestWhether to create the pull request as a draftbooleanfalse
pullRequestTitlePatternCustomize the pull request titlestring
monorepoTagsWhether to include the component name in the releasebooleanfalse

Usage

After installing the GitHub app, and creating a .github/release-please.yml configuration, releases should be automatically proposed on commits to the configured branch(es).

Forcing the bot to run

To force a re-run, you may add the release-please:force-run label to any pull request. The bot should respond by running and removing that label.

Handling GitHub releases

The bot can optionally, tag the GitHub releases after a release pull request is merged. To do so, set handleGHRelease to true in your .github/release-please.yml configuration.

Testing

This bot uses nock for mocking requests to GitHub, and snap-shot-it for capturing responses; This allows updates to the API surface to be treated as a visual diff, rather than tediously asserting against each field.

Running tests:

npm run test

To update snapshots:

npm run test:snap

Contributing

If you have suggestions for how release-please could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

Apache 2.0 © 2019 Google Inc.